Skip to content

Commit

Permalink
fix: update kustomization.yaml to avoid usage of deprecated patches/c…
Browse files Browse the repository at this point in the history
…onfigs (#2004)

Signed-off-by: Griffin <prakritimandal611@gmail.com>
Signed-off-by: Prakriti Mandal <98270250+prakrit55@users.noreply.github.com>
  • Loading branch information
prakrit55 committed Sep 18, 2023
1 parent b9019cd commit 8d70fac
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 60 deletions.
8 changes: 5 additions & 3 deletions klt-cert-manager/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ namespace: keptn-lifecycle-toolkit-system
# namePrefix: certificate-

# Labels to add to all resources and selectors.
# commonLabels:
# labels:
# someName: someValue

bases:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../rbac
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
Expand All @@ -22,7 +24,7 @@ bases:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
# - ../prometheus

# patchesStrategicMerge:
# patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your cert-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
Expand Down
48 changes: 23 additions & 25 deletions lifecycle-operator/config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,30 @@ resources:
- bases/options.keptn.sh_keptnconfigs.yaml
- bases/lifecycle.keptn.sh_keptnappcreationrequests.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
# [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_lifecycle_keptntaskdefinitions.yaml
# - patches/webhook_in_lifecycle_keptntasks.yaml
- patches/webhook_in_lifecycle_keptnapps.yaml
# - patches/webhook_in_lifecycle_keptnworkloads.yaml
- patches/webhook_in_lifecycle_keptnworkloadinstances.yaml
- patches/webhook_in_lifecycle_keptnappversions.yaml
# - patches/webhook_in_lifecycle_keptnevaluationdefinitions.yaml
- patches/webhook_in_lifecycle_keptnevaluationproviders.yaml
# - patches/webhook_in_lifecycle_keptnevaluations.yaml
# - patches/webhook_in_options_keptnconfigs.yaml
# - patches/webhook_in_lifecycle_keptnapps.yaml
# - patches/webhook_in_lifecycle_keptnappversions.yaml
# - patches/webhook_in_lifecycle_keptnworkloadinstances.yaml
# - patches/webhook_in_lifecycle_keptnevaluationproviders.yaml
# - patches/webhook_in_keptnappcreationrequests.yaml
# +kubebuilder:scaffold:crdkustomizewebhookpatch

# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml

commonLabels:
crdGroup: lifecycle.keptn.sh
app.kubernetes.io/part-of: keptn-lifecycle-toolkit
keptn.sh/inject-cert: "true"
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: true
pairs:
app.kubernetes.io/part-of: keptn-lifecycle-toolkit
crdGroup: lifecycle.keptn.sh
keptn.sh/inject-cert: "true"
patches:
- path: patches/webhook_in_lifecycle_keptnapps.yaml
- path: patches/webhook_in_lifecycle_keptnworkloadinstances.yaml
- path: patches/webhook_in_lifecycle_keptnappversions.yaml
- path: patches/webhook_in_lifecycle_keptnevaluationproviders.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
# - path: patches/webhook_in_lifecycle_keptntaskdefinitions.yaml
# - path: patches/webhook_in_lifecycle_keptntasks.yaml
# - path: patches/webhook_in_lifecycle_keptnworkloads.yaml
# - path: patches/webhook_in_lifecycle_keptnevaluationdefinitions.yaml
# - path: patches/webhook_in_lifecycle_keptnevaluations.yaml
# - path: patches/webhook_in_options_keptnconfigs.yaml
# - path: patches/webhook_in_keptnappcreationrequests.yaml
# +kubebuilder:scaffold:crdkustomizewebhookpatch
9 changes: 5 additions & 4 deletions lifecycle-operator/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Adds namespace to all resources.
namespace: keptn-lifecycle-toolkit-system

bases:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../crd
- ../rbac
- ../manager
- ../webhook

patchesStrategicMerge:
- webhooknamespaces_patch.yaml
patches:
- path: webhooknamespaces_patch.yaml
48 changes: 25 additions & 23 deletions metrics-operator/config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,32 @@ resources:
- bases/metrics.keptn.sh_analysisvaluetemplates.yaml
# +kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
# [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_keptnmetricsproviders.yaml
- patches/webhook_in_keptnmetrics.yaml
# - patches/webhook_in_analyses.yaml
# - patches/webhook_in_analysisdefinitions.yaml
# - patches/webhook_in_analysisvaluetemplates.yaml
# +kubebuilder:scaffold:crdkustomizewebhookpatch

# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
# - patches/cainjection_in_keptnmetricsproviders.yaml
# - patches/cainjection_in_keptnmetrics.yaml
# - patches/cainjection_in_analyses.yaml
# - patches/cainjection_in_analysisdefinitions.yaml
# - patches/cainjection_in_analysisvaluetemplates.yaml
# +kubebuilder:scaffold:crdkustomizecainjectionpatch

# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml

commonLabels:
crdGroup: metrics.keptn.sh
app.kubernetes.io/part-of: keptn-lifecycle-toolkit
keptn.sh/inject-cert: "true"
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
labels:
- includeSelectors: true
Pairs:
app.kubernetes.io/part-of: keptn-lifecycle-toolkit
crdGroup: metrics.keptn.sh
keptn.sh/inject-cert: "true"
patches:
- path: patches/webhook_in_keptnmetrics.yaml
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
# - path: patches/webhook_in_keptnmetricsproviders.yaml
# - path: patches/webhook_in_analyses.yaml
# - path: patches/webhook_in_analysisdefinitions.yaml
# - path: patches/webhook_in_analysisvaluetemplates.yaml
# +kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
# - path: patches/cainjection_in_keptnmetricsproviders.yaml
# - path: patches/cainjection_in_keptnmetrics.yaml
# - path: patches/cainjection_in_analyses.yaml
# - path: patches/cainjection_in_analysisdefinitions.yaml
# - path: patches/cainjection_in_analysisvaluetemplates.yaml
# +kubebuilder:scaffold:crdkustomizecainjectionpatch
12 changes: 7 additions & 5 deletions metrics-operator/config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,22 @@ namespace: keptn-lifecycle-toolkit-system
# commonLabels:
# someName: someValue

bases:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../crd
- ../rbac
- ../manager
- ../metrics
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
- ../webhook
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
# [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:
patches:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
Expand All @@ -44,7 +46,7 @@ patchesStrategicMerge:
# - webhookcainjection_patch.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
replacements:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
# - name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
Expand Down

0 comments on commit 8d70fac

Please sign in to comment.