Skip to content

Commit

Permalink
Fix kustomize for new ver
Browse files Browse the repository at this point in the history
  • Loading branch information
psav committed Nov 29, 2024
1 parent 7df52ca commit 2f70e5b
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 62 deletions.
2 changes: 1 addition & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
52 changes: 28 additions & 24 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
24 changes: 12 additions & 12 deletions config/deployment-template/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
53 changes: 28 additions & 25 deletions config/release-manifest/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
- 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

0 comments on commit 2f70e5b

Please sign in to comment.