From 819b2e99d02468c87afdc3da4c736bc69d296aa8 Mon Sep 17 00:00:00 2001 From: Jingfang Liu Date: Tue, 18 Dec 2018 11:00:50 -0800 Subject: [PATCH 1/3] add apiVersion and kind to docs/kustomization.yaml --- docs/kustomization.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/kustomization.yaml b/docs/kustomization.yaml index 74cd29794..4cf8a0a84 100644 --- a/docs/kustomization.yaml +++ b/docs/kustomization.yaml @@ -32,6 +32,10 @@ # visible in configuration reviews. # ---------------------------------------------------- +# apiVersion and Kind for current kustomization.yaml +apiVersion: v1 +kind: Kustomization + # Adds namespace to all resources. namespace: my-namespace From 64372a786b33405c9007716d3f79358902749691 Mon Sep 17 00:00:00 2001 From: Jingfang Liu Date: Tue, 18 Dec 2018 11:01:10 -0800 Subject: [PATCH 2/3] add apiVersion and kind to example kustomizations --- examples/helloWorld/kustomization.yaml | 2 ++ examples/ldap/base/kustomization.yaml | 2 ++ examples/ldap/overlays/production/kustomization.yaml | 2 ++ examples/ldap/overlays/staging/kustomization.yaml | 2 ++ examples/multibases/base/kustomization.yaml | 4 +++- examples/multibases/dev/kustomization.yaml | 2 ++ examples/multibases/kustomization.yaml | 2 ++ examples/multibases/production/kustomization.yaml | 2 ++ examples/multibases/staging/kustomization.yaml | 2 ++ examples/springboot/overlays/production/kustomization.yaml | 2 ++ examples/springboot/overlays/staging/kustomization.yaml | 2 ++ examples/transformerconfigs/crd/kustomization.yaml | 2 ++ examples/wordpress/kustomization.yaml | 2 ++ examples/wordpress/mysql/kustomization.yaml | 2 ++ examples/wordpress/wordpress/kustomization.yaml | 2 ++ 15 files changed, 31 insertions(+), 1 deletion(-) diff --git a/examples/helloWorld/kustomization.yaml b/examples/helloWorld/kustomization.yaml index 41965951e..f4e18e6af 100644 --- a/examples/helloWorld/kustomization.yaml +++ b/examples/helloWorld/kustomization.yaml @@ -1,5 +1,7 @@ # Example configuration for the webserver # at https://github.com/monopole/hello +apiVersion: v1 +kind: Kustomization commonLabels: app: hello diff --git a/examples/ldap/base/kustomization.yaml b/examples/ldap/base/kustomization.yaml index 6cd10dfad..c039b6e66 100644 --- a/examples/ldap/base/kustomization.yaml +++ b/examples/ldap/base/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization resources: - deployment.yaml - service.yaml diff --git a/examples/ldap/overlays/production/kustomization.yaml b/examples/ldap/overlays/production/kustomization.yaml index 84a159c96..82217a7d3 100644 --- a/examples/ldap/overlays/production/kustomization.yaml +++ b/examples/ldap/overlays/production/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - ../../base patchesStrategicMerge: diff --git a/examples/ldap/overlays/staging/kustomization.yaml b/examples/ldap/overlays/staging/kustomization.yaml index 18bbf920f..0f9e4c258 100644 --- a/examples/ldap/overlays/staging/kustomization.yaml +++ b/examples/ldap/overlays/staging/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - ../../base patchesStrategicMerge: diff --git a/examples/multibases/base/kustomization.yaml b/examples/multibases/base/kustomization.yaml index d577d5e5f..2bdaded8f 100644 --- a/examples/multibases/base/kustomization.yaml +++ b/examples/multibases/base/kustomization.yaml @@ -1,2 +1,4 @@ +apiVersion: v1 +kind: Kustomization resources: -- pod.yaml \ No newline at end of file +- pod.yaml diff --git a/examples/multibases/dev/kustomization.yaml b/examples/multibases/dev/kustomization.yaml index d92695ed7..10257a866 100644 --- a/examples/multibases/dev/kustomization.yaml +++ b/examples/multibases/dev/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - ./../base diff --git a/examples/multibases/kustomization.yaml b/examples/multibases/kustomization.yaml index 387ca23ae..f658b850a 100644 --- a/examples/multibases/kustomization.yaml +++ b/examples/multibases/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - ./dev - ./staging diff --git a/examples/multibases/production/kustomization.yaml b/examples/multibases/production/kustomization.yaml index f6ae0c76d..c2b3b3ead 100644 --- a/examples/multibases/production/kustomization.yaml +++ b/examples/multibases/production/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - ./../base diff --git a/examples/multibases/staging/kustomization.yaml b/examples/multibases/staging/kustomization.yaml index 0606f73c9..cd13840c1 100644 --- a/examples/multibases/staging/kustomization.yaml +++ b/examples/multibases/staging/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - ./../base diff --git a/examples/springboot/overlays/production/kustomization.yaml b/examples/springboot/overlays/production/kustomization.yaml index c892f877a..baf52ab77 100644 --- a/examples/springboot/overlays/production/kustomization.yaml +++ b/examples/springboot/overlays/production/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - ../../base patchesStrategicMerge: diff --git a/examples/springboot/overlays/staging/kustomization.yaml b/examples/springboot/overlays/staging/kustomization.yaml index f2f34a742..538fb1721 100644 --- a/examples/springboot/overlays/staging/kustomization.yaml +++ b/examples/springboot/overlays/staging/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - ../../base namePrefix: staging- diff --git a/examples/transformerconfigs/crd/kustomization.yaml b/examples/transformerconfigs/crd/kustomization.yaml index 04c6ec5ad..0d1ecf3b9 100644 --- a/examples/transformerconfigs/crd/kustomization.yaml +++ b/examples/transformerconfigs/crd/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization resources: - resources.yaml diff --git a/examples/wordpress/kustomization.yaml b/examples/wordpress/kustomization.yaml index cda9e01f0..cc8afc5cd 100644 --- a/examples/wordpress/kustomization.yaml +++ b/examples/wordpress/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization bases: - wordpress - mysql diff --git a/examples/wordpress/mysql/kustomization.yaml b/examples/wordpress/mysql/kustomization.yaml index bc664d1b1..022387f9c 100644 --- a/examples/wordpress/mysql/kustomization.yaml +++ b/examples/wordpress/mysql/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization resources: - deployment.yaml - service.yaml diff --git a/examples/wordpress/wordpress/kustomization.yaml b/examples/wordpress/wordpress/kustomization.yaml index a944d005c..26b0f7980 100644 --- a/examples/wordpress/wordpress/kustomization.yaml +++ b/examples/wordpress/wordpress/kustomization.yaml @@ -1,3 +1,5 @@ +apiVersion: v1 +kind: Kustomization resources: - deployment.yaml - service.yaml From 0d14e8954958db98cd032f71dd653e2bf9af795c Mon Sep 17 00:00:00 2001 From: Jingfang Liu Date: Tue, 18 Dec 2018 11:22:18 -0800 Subject: [PATCH 3/3] add apiVersion and kind in README.md for examples --- examples/breakfast.md | 6 ++++++ examples/combineConfigs.md | 6 ++++++ examples/configGeneration.md | 4 ++++ examples/generatorOptions.md | 2 ++ examples/helloWorld/README.md | 4 ++++ examples/imageTags.md | 2 ++ examples/jsonpatch.md | 2 ++ examples/multibases/README.md | 10 ++++++++++ examples/remoteBuild.md | 2 ++ examples/wordpress/README.md | 2 ++ 10 files changed, 40 insertions(+) diff --git a/examples/breakfast.md b/examples/breakfast.md index a98fbb408..1c1670dc9 100644 --- a/examples/breakfast.md +++ b/examples/breakfast.md @@ -24,6 +24,8 @@ breakfast. This breakfast has coffee and pancakes: ``` cat <$DEMO_HOME/breakfast/base/kustomization.yaml +apiVersion: v1 +kind: Kustomization resources: - coffee.yaml - pancakes.yaml @@ -69,6 +71,8 @@ likes her coffee hot: mkdir -p $DEMO_HOME/breakfast/overlays/alice cat <$DEMO_HOME/breakfast/overlays/alice/kustomization.yaml +apiVersion: v1 +kind: Kustomization commonLabels: who: alice bases: @@ -92,6 +96,8 @@ And likewise a [variant] for Bob, who wants _five_ pancakes, with strawberries: mkdir -p $DEMO_HOME/breakfast/overlays/bob cat <$DEMO_HOME/breakfast/overlays/bob/kustomization.yaml +apiVersion: v1 +kind: Kustomization commonLabels: who: bob bases: diff --git a/examples/combineConfigs.md b/examples/combineConfigs.md index 86e46d34d..9abd56f2e 100644 --- a/examples/combineConfigs.md +++ b/examples/combineConfigs.md @@ -158,6 +158,8 @@ height=10m EOF cat <$DEMO_HOME/base/kustomization.yaml +apiVersion: v1 +kind: Kustomization configMapGenerator: - name: my-configmap files: @@ -191,6 +193,8 @@ dbpassword=mothersMaidenName EOF cat <$OVERLAYS/development/kustomization.yaml +apiVersion: v1 +kind: Kustomization bases: - ../../base namePrefix: dev- @@ -273,6 +277,8 @@ dbpassword=thisShouldProbablyBeInASecretInstead EOF cat <$OVERLAYS/production/kustomization.yaml +apiVersion: v1 +kind: Kustomization bases: - ../../base namePrefix: prod- diff --git a/examples/configGeneration.md b/examples/configGeneration.md index 7a3750ade..2bc8438a4 100644 --- a/examples/configGeneration.md +++ b/examples/configGeneration.md @@ -39,6 +39,8 @@ curl -s -o "$BASE/#1.yaml" "https://raw.githubusercontent.com\ /{deployment,service}.yaml" cat <<'EOF' >$BASE/kustomization.yaml +apiVersion: v1 +kind: Kustomization commonLabels: app: hello resources: @@ -59,6 +61,8 @@ OVERLAYS=$DEMO_HOME/overlays mkdir -p $OVERLAYS/staging cat <<'EOF' >$OVERLAYS/staging/kustomization.yaml +apiVersion: v1 +kind: Kustomization namePrefix: staging- nameSuffix: -v1 commonLabels: diff --git a/examples/generatorOptions.md b/examples/generatorOptions.md index a9fc3c3c0..d92ce7a3b 100644 --- a/examples/generatorOptions.md +++ b/examples/generatorOptions.md @@ -18,6 +18,8 @@ Create a kustomization and add a ConfigMap generator to it. ``` cat > $DEMO_HOME/kustomization.yaml << EOF +apiVersion: v1 +kind: Kustomization configMapGenerator: - name: my-configmap literals: diff --git a/examples/helloWorld/README.md b/examples/helloWorld/README.md index a812ad9a2..942a8d664 100644 --- a/examples/helloWorld/README.md +++ b/examples/helloWorld/README.md @@ -142,6 +142,8 @@ defining a new name prefix, and some different labels. ``` cat <<'EOF' >$OVERLAYS/staging/kustomization.yaml +apiVersion: v1 +kind: Kustomization namePrefix: staging- commonLabels: variant: staging @@ -183,6 +185,8 @@ with a different name prefix and labels. ``` cat <$OVERLAYS/production/kustomization.yaml +apiVersion: v1 +kind: Kustomization namePrefix: production- commonLabels: variant: production diff --git a/examples/imageTags.md b/examples/imageTags.md index d6a5fe11a..43a725b68 100644 --- a/examples/imageTags.md +++ b/examples/imageTags.md @@ -13,6 +13,8 @@ Make a `kustomization` containing a pod resource ``` cat <$DEMO_HOME/kustomization.yaml +apiVersion: v1 +kind: Kustomization resources: - pod.yaml EOF diff --git a/examples/jsonpatch.md b/examples/jsonpatch.md index 61c00f38f..e861464e5 100644 --- a/examples/jsonpatch.md +++ b/examples/jsonpatch.md @@ -11,6 +11,8 @@ Make a `kustomization` containing an ingress resource. DEMO_HOME=$(mktemp -d) cat <$DEMO_HOME/kustomization.yaml +apiVersion: v1 +kind: Kustomization resources: - ingress.yaml EOF diff --git a/examples/multibases/README.md b/examples/multibases/README.md index ae3d471a4..6a8567721 100644 --- a/examples/multibases/README.md +++ b/examples/multibases/README.md @@ -22,6 +22,8 @@ BASE=$DEMO_HOME/base mkdir $BASE cat <$BASE/kustomization.yaml +apiVersion: v1 +kind: Kustomization resources: - pod.yaml EOF @@ -47,6 +49,8 @@ DEV=$DEMO_HOME/dev mkdir $DEV cat <$DEV/kustomization.yaml +apiVersion: v1 +kind: Kustomization bases: - ./../base namePrefix: dev- @@ -60,6 +64,8 @@ STAG=$DEMO_HOME/staging mkdir $STAG cat <$STAG/kustomization.yaml +apiVersion: v1 +kind: Kustomization bases: - ./../base namePrefix: stag- @@ -73,6 +79,8 @@ PROD=$DEMO_HOME/production mkdir $PROD cat <$PROD/kustomization.yaml +apiVersion: v1 +kind: Kustomization bases: - ./../base namePrefix: prod- @@ -83,6 +91,8 @@ Then define a _Kustomization_ composing three variants together: ``` cat <$DEMO_HOME/kustomization.yaml +apiVersion: v1 +kind: Kustomization bases: - ./dev - ./staging diff --git a/examples/remoteBuild.md b/examples/remoteBuild.md index 747724fca..3800c856a 100644 --- a/examples/remoteBuild.md +++ b/examples/remoteBuild.md @@ -34,6 +34,8 @@ A base can also be specified as a URL: DEMO_HOME=$(mktemp -d) cat <$DEMO_HOME/kustomization.yaml +apiVersion: v1 +kind: Kustomization bases: - github.com/kubernetes-sigs/kustomize//examples/multibases?ref=v1.0.6 namePrefix: remote- diff --git a/examples/wordpress/README.md b/examples/wordpress/README.md index 2b7a86749..29fd290cb 100644 --- a/examples/wordpress/README.md +++ b/examples/wordpress/README.md @@ -49,6 +49,8 @@ Create a new kustomization with two bases: ``` cat <$DEMO_HOME/kustomization.yaml +apiVersion: v1 +kind: Kustomization bases: - wordpress - mysql