From 2f70e5b83b2b380f28c92ae0fc9ee65aa5a4b001 Mon Sep 17 00:00:00 2001 From: Pete Savage Date: Fri, 29 Nov 2024 14:49:13 +0000 Subject: [PATCH] Fix kustomize for new ver --- config/crd/kustomization.yaml | 2 +- config/default/kustomization.yaml | 52 +++++++++--------- config/deployment-template/kustomization.yaml | 24 ++++----- config/release-manifest/kustomization.yaml | 53 ++++++++++--------- 4 files changed, 69 insertions(+), 62 deletions(-) diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index ec685c8a9..2aaa318b5 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -7,7 +7,7 @@ resources: - bases/cloud.redhat.com_clowdapps.yaml #+kubebuilder:scaffold:crdkustomizeresource -patchesStrategicMerge: +patches: [] # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix. # patches here are for enabling the conversion webhook for each CRD #- patches/webhook_in_clowdenvironments.yaml diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index 4df7c95e4..c1d483e46 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -12,19 +12,12 @@ namePrefix: clowder- #commonLabels: # someName: someValue -bases: -- ../crd -- ../rbac -- ../manager # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml -- ../webhook # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -- ../certmanager # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. #- ../prometheus -patchesStrategicMerge: # Protect the /metrics endpoint by putting it behind auth. # If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line. @@ -36,39 +29,50 @@ patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml -- manager_webhook_patch.yaml # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. # Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. # 'CERTMANAGER' needs to be enabled to use ca injection -- webhookcainjection_patch.yaml # the following config is for teaching kustomize how to do var substitution -vars: # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR +vars: +- fieldref: + fieldPath: metadata.namespace + name: CERTIFICATE_NAMESPACE objref: - kind: Certificate group: cert-manager.io + kind: Certificate + name: serving-cert version: v1 - name: serving-cert # this name should match the one in certificate.yaml - fieldref: - fieldpath: metadata.namespace -- name: CERTIFICATE_NAME +- fieldref: {} + name: CERTIFICATE_NAME objref: - kind: Certificate group: cert-manager.io + kind: Certificate + name: serving-cert version: v1 - name: serving-cert # this name should match the one in certificate.yaml -- name: SERVICE_NAMESPACE # namespace of the service +- fieldref: + fieldPath: metadata.namespace + name: SERVICE_NAMESPACE objref: kind: Service - version: v1 name: webhook-service - fieldref: - fieldpath: metadata.namespace -- name: SERVICE_NAME + version: v1 +- fieldref: {} + name: SERVICE_NAME objref: kind: Service - version: v1 name: webhook-service + version: v1 +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- ../crd +- ../rbac +- ../manager +- ../webhook +- ../certmanager +patches: +- path: manager_webhook_patch.yaml +- path: webhookcainjection_patch.yaml diff --git a/config/deployment-template/kustomization.yaml b/config/deployment-template/kustomization.yaml index db5078a9f..8591a2203 100644 --- a/config/deployment-template/kustomization.yaml +++ b/config/deployment-template/kustomization.yaml @@ -12,23 +12,23 @@ namePrefix: clowder- #commonLabels: # someName: someValue -bases: -- ../crd -- ../rbac -- ../manager # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml -- ../webhook -patchesStrategicMerge: -- manager_webhook_patch.yaml -- manager.yaml # Put template param refs into image field # - clowder_config.yaml -- webhook_cert_annotation.yaml -- webhook_cert.yaml -- mutate_webhook_cert.yaml -vars: [] resources: - legacy_service.yaml +- ../crd +- ../rbac +- ../manager +- ../webhook +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +patches: +- path: manager_webhook_patch.yaml +- path: manager.yaml +- path: webhook_cert_annotation.yaml +- path: webhook_cert.yaml +- path: mutate_webhook_cert.yaml diff --git a/config/release-manifest/kustomization.yaml b/config/release-manifest/kustomization.yaml index 5898e4aec..8642b53ec 100644 --- a/config/release-manifest/kustomization.yaml +++ b/config/release-manifest/kustomization.yaml @@ -12,19 +12,12 @@ namePrefix: clowder- #commonLabels: # someName: someValue -bases: -- ../crd -- ../rbac -- ../manager # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml -- ../webhook # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required. -- ../certmanager # [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'. #- ../prometheus -patchesStrategicMerge: # Protect the /metrics endpoint by putting it behind auth. # If you want your controller-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line. @@ -36,42 +29,52 @@ patchesStrategicMerge: # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml -- manager_webhook_patch.yaml # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. # Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks. # 'CERTMANAGER' needs to be enabled to use ca injection -- webhookcainjection_patch.yaml # the following config is for teaching kustomize how to do var substitution -vars: # [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix. -- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR +vars: +- fieldref: + fieldPath: metadata.namespace + name: CERTIFICATE_NAMESPACE objref: - kind: Certificate group: cert-manager.io + kind: Certificate + name: serving-cert version: v1 - name: serving-cert # this name should match the one in certificate.yaml - fieldref: - fieldpath: metadata.namespace -- name: CERTIFICATE_NAME +- fieldref: {} + name: CERTIFICATE_NAME objref: - kind: Certificate group: cert-manager.io + kind: Certificate + name: serving-cert version: v1 - name: serving-cert # this name should match the one in certificate.yaml -- name: SERVICE_NAMESPACE # namespace of the service +- fieldref: + fieldPath: metadata.namespace + name: SERVICE_NAMESPACE objref: kind: Service - version: v1 name: webhook-service - fieldref: - fieldpath: metadata.namespace -- name: SERVICE_NAME + version: v1 +- fieldref: {} + name: SERVICE_NAME objref: kind: Service - version: v1 name: webhook-service + version: v1 resources: -- clowder_config.yaml \ No newline at end of file +- clowder_config.yaml +- ../crd +- ../rbac +- ../manager +- ../webhook +- ../certmanager +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +patches: +- path: manager_webhook_patch.yaml +- path: webhookcainjection_patch.yaml