Skip to content

Commit

Permalink
chore: Move dashboard config maps from Kyma-system namespace (#2028)
Browse files Browse the repository at this point in the history
Remove dashboards cm namespace transformers, and add the grafana_dashboard as a standard path
  • Loading branch information
nesmabadr authored Nov 15, 2024
1 parent 973bc67 commit 566bd9e
Showing 1 changed file with 12 additions and 43 deletions.
55 changes: 12 additions & 43 deletions config/control-plane/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ patches:
value: --is-kyma-managed
target:
kind: Deployment
- patch: |-
- op: add
path: /metadata/labels
value: {}
- op: add
path: /metadata/labels/grafana_dashboard
value: "1"
target:
kind: ConfigMap
name: dashboard-(overview|status|watcher|mandatory-modules)
version: v1
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK]
- path: patches/unique_manager_webhook_patch.yaml
- path: patches/adjust_resources_in_deployment.yaml
Expand All @@ -77,9 +88,7 @@ patches:
# kubebuilder operators.
- path: patches/unique_certificate_name.yaml

# We patch the Metrics ConfigMaps here, as we expect KCP to be watching for grafana dashboards in the 'kyma-system' namespace.
# Note1: Now as the 'patchesJson6902' is deprecated, the direct use of the 'PatchTransformer' is the only way to change a resource namespace to something different from the value configured by the global namespace transformer.
# Note2: the 'grafana_dashboard' label could be applied using a standard JSON patch, but a namespace must be patched here and it's better to have all related customizations in a single place.
# Note: Now as the 'patchesJson6902' is deprecated, the direct use of the 'PatchTransformer' is the only way to change a resource namespace to something different from the value configured by the global namespace transformer.
transformers:
- |-
apiVersion: builtin
Expand Down Expand Up @@ -112,46 +121,6 @@ transformers:
path: metadata/annotations
- kind: ValidatingWebhookConfiguration
path: metadata/annotations
- |-
apiVersion: builtin
kind: PatchTransformer
metadata:
name: fix-dashboard-overview-cm
patch: '[{"op": "replace", "path": "/metadata/namespace", "value": "kyma-system"}, {"op": "add", "path": "/metadata/labels/grafana_dashboard", "value": "1"}]'
target:
kind: ConfigMap
name: klm-dashboard-overview
version: v1
- |-
apiVersion: builtin
kind: PatchTransformer
metadata:
name: fix-dashboard-status-cm
patch: '[{"op": "replace", "path": "/metadata/namespace", "value": "kyma-system"}, {"op": "add", "path": "/metadata/labels/grafana_dashboard", "value": "1"}]'
target:
kind: ConfigMap
name: klm-dashboard-status
version: v1
- |-
apiVersion: builtin
kind: PatchTransformer
metadata:
name: fix-dashboard-watcher-cm
patch: '[{"op": "replace", "path": "/metadata/namespace", "value": "kyma-system"}, {"op": "add", "path": "/metadata/labels/grafana_dashboard", "value": "1"}]'
target:
kind: ConfigMap
name: klm-dashboard-watcher
version: v1
- |-
apiVersion: builtin
kind: PatchTransformer
metadata:
name: fix-dashboard-mandatory-modules-cm
patch: '[{"op": "replace", "path": "/metadata/namespace", "value": "kyma-system"}, {"op": "add", "path": "/metadata/labels/grafana_dashboard", "value": "1"}]'
target:
kind: ConfigMap
name: klm-dashboard-mandatory-modules
version: v1
- |-
apiVersion: builtin
kind: PatchTransformer
Expand Down

0 comments on commit 566bd9e

Please sign in to comment.