kustomize

package
Version: v3.0.0-...-c7e9b3a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2020 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OverlayParamName = "overlay"
)

Variables

This section is empty.

Functions

func CreateKustomizationMaps

func CreateKustomizationMaps() map[MapType]map[string]bool

func EvaluateKustomizeManifest

func EvaluateKustomizeManifest(compDir string) (resmap.ResMap, error)

EvaluateKustomizeManifest evaluates the kustomize dir compDir, and returns the resources.

func GenerateKustomizationFile

func GenerateKustomizationFile(kfDef *kfconfig.KfConfig, root string,
	compPath string, overlays []string, params []kfconfig.NameValue) error

GenerateKustomizationFile will create a kustomization.yaml It will parse a args structure that provides mixin or multiple overlays to be merged with the base kustomization file for example

componentParams:
 tf-job-operator:
 - name: overlay
   value: namespaced-gangscheduled

TODO(https://github.com/kubeflow/kubeflow/issues/3491): As part of fixing the discovery logic we should change the KfDef spec to provide a list of applications (not a map). and preserve order when applying them so we can get rid of the logic hard-coding moving some applications to the front.

TODO(jlewi): Why is the path split between root and compPath? TODO(jlewi): Why is this taking kfDef and writing kfDef? Is this because it is reordering components? TODO(jlewi): This function appears to special case handling of using kustomize for KfDef. Presumably this is because of the code in coordinator which is using it to generate KfDef from overlays. But this function is also used to generate the manifests for the individual kustomize packages.

func GetKfApp

func GetKfApp(kfdef *kfconfig.KfConfig) kftypesv3.KfApp

GetKfApp is the common entry point for all implementations of the KfApp interface

func GetKustomization

func GetKustomization(kustomizationPath string) *types.Kustomization

GetKustomization will read a kustomization.yaml and return Kustomization type

func MergeKustomization

func MergeKustomization(compDir string, targetDir string, kfDef *kfconfig.KfConfig, params []kfconfig.NameValue,
	parent *types.Kustomization, child *types.Kustomization, kustomizationMaps map[MapType]map[string]bool) error

MergeKustomization will merge the child into the parent if the child has no bases, then the parent just needs to add the child as base otherwise the parent needs to merge with behaviors Multiple overlays are constrained in what they can merge which exclude NamePrefixes, NameSuffixes, CommonLabels, CommonAnnotations. Any of these will generate an error

func MergeKustomizations

func MergeKustomizations(kfDef *kfconfig.KfConfig, compDir string, overlayParams []string, params []kfconfig.NameValue) (*types.Kustomization, error)

MergeKustomizations will merge base and all overlay kustomization files into a single kustomization file

func ReadKfDef

func ReadKfDef(kfDefFile string) *kfdefsv3.KfDef

ReadKfDef will read a config .yaml and return the KfDef type

func ReadUnstructured

func ReadUnstructured(kfDefFile string) (*unstructured.Unstructured, error)

ReadUnstructured will read a resource .yaml and return the Unstructured type

func WriteKfDef

func WriteKfDef(kfdef *kfdefsv3.KfDef, kfdefpath string) error

WriteKfDef will write a KfDef to a config .yaml

func WriteKustomizationFile

func WriteKustomizationFile(name string, kustomizeDir string, resMap resmap.ResMap) error

Types

type MapType

type MapType int

type Setter

type Setter interface {
	SetK8sRestConfig(r *rest.Config)
}

Setter defines an interface for modifying the plugin.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL