diff --git a/config/certmanager/certificate.yaml b/config/certmanager/certificate.yaml index c493d05a4..2c93395ae 100644 --- a/config/certmanager/certificate.yaml +++ b/config/certmanager/certificate.yaml @@ -12,7 +12,7 @@ spec: apiVersion: cert-manager.io/v1 kind: Certificate metadata: - name: serving-cert # this name should match the one appeared in kustomizeconfig.yaml + name: serving-cert namespace: system spec: # WEBHOOK_SERVICE_NAME_PLACEHOLDER and WEBHOOK_SERVICE_NAMESPACE_PLACEHOLDER will be substituted by kustomize diff --git a/config/certmanager/kustomization.yaml b/config/certmanager/kustomization.yaml index e0182475f..438e93c2c 100644 --- a/config/certmanager/kustomization.yaml +++ b/config/certmanager/kustomization.yaml @@ -1,5 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization + resources: - certificate.yaml diff --git a/config/certmanager/kustomizeconfig.yaml b/config/certmanager/kustomizeconfig.yaml index d6109c9d8..29091b12d 100644 --- a/config/certmanager/kustomizeconfig.yaml +++ b/config/certmanager/kustomizeconfig.yaml @@ -1,4 +1,4 @@ -# This configuration is for teaching kustomize how to update name ref and var substitution +# nameReference teaches Kustomize which fields represent a resource name. nameReference: - kind: Issuer group: cert-manager.io @@ -6,14 +6,3 @@ nameReference: - kind: Certificate group: cert-manager.io path: spec/issuerRef/name - -varReference: -- kind: Certificate - group: cert-manager.io - path: spec/commonName -- kind: Certificate - group: cert-manager.io - path: spec/dnsNames -- kind: Certificate - group: cert-manager.io - path: spec/secretName diff --git a/config/crd/kustomizeconfig.yaml b/config/crd/kustomizeconfig.yaml index 8e2d8d6b1..69dff6de6 100644 --- a/config/crd/kustomizeconfig.yaml +++ b/config/crd/kustomizeconfig.yaml @@ -1,4 +1,4 @@ -# This file is for teaching kustomize how to substitute name and namespace reference in CRD +# nameReference teaches Kustomize which fields represent a resource name. nameReference: - kind: Service version: v1 @@ -7,11 +7,9 @@ nameReference: group: apiextensions.k8s.io path: spec/conversion/webhook/clientConfig/service/name +# namespace teaches Kustomize which fields represent a resource namespace. namespace: - kind: CustomResourceDefinition group: apiextensions.k8s.io path: spec/conversion/webhook/clientConfig/service/namespace create: false - -varReference: -- path: metadata/annotations diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 50a3d7a6e..7f6cd3a09 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -1,9 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -configurations: -- kustomizeconfig.yaml - resources: - ../crd - ../manager diff --git a/config/default/kustomizeconfig.yaml b/config/default/kustomizeconfig.yaml deleted file mode 100644 index eb7da15ba..000000000 --- a/config/default/kustomizeconfig.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# the following config is for teaching kustomize where to look at when substituting vars. -# It requires kustomize v2.1.0 or newer to work properly. -varReference: -- path: spec/template/spec/containers/ports/containerPort - kind: Deployment -- path: spec/template/spec/containers/volumeMounts/name - kind: Deployment -- path: spec/template/spec/containers/volumeMounts/mountPath - kind: Deployment -- path: spec/template/spec/volumes/secret/secretName - kind: Deployment -- path: spec/template/spec/volumes/name - kind: Deployment diff --git a/config/webhook/kustomizeconfig.yaml b/config/webhook/kustomizeconfig.yaml index 25e21e3c9..0916ac341 100644 --- a/config/webhook/kustomizeconfig.yaml +++ b/config/webhook/kustomizeconfig.yaml @@ -1,5 +1,4 @@ -# the following config is for teaching kustomize where to look at when substituting vars. -# It requires kustomize v2.1.0 or newer to work properly. +# nameReference teaches Kustomize which fields represent a resource name. nameReference: - kind: Service version: v1 @@ -11,6 +10,7 @@ nameReference: group: admissionregistration.k8s.io path: webhooks/clientConfig/service/name +# namespace teaches Kustomize which fields represent a resource namespace. namespace: - kind: MutatingWebhookConfiguration group: admissionregistration.k8s.io @@ -20,6 +20,3 @@ namespace: group: admissionregistration.k8s.io path: webhooks/clientConfig/service/namespace create: true - -varReference: -- path: metadata/annotations