From fe428bd3934d73e98e36758c2e308d6f58736078 Mon Sep 17 00:00:00 2001 From: gitbluf Date: Mon, 8 Jul 2024 21:29:14 +0200 Subject: [PATCH 1/3] feat: enable deployment of extra k8s objects --- deploy/helm/grafana-operator/templates/extraobjects.yaml | 4 ++++ deploy/helm/grafana-operator/values.yaml | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 deploy/helm/grafana-operator/templates/extraobjects.yaml diff --git a/deploy/helm/grafana-operator/templates/extraobjects.yaml b/deploy/helm/grafana-operator/templates/extraobjects.yaml new file mode 100644 index 000000000..a9bb3b6ba --- /dev/null +++ b/deploy/helm/grafana-operator/templates/extraobjects.yaml @@ -0,0 +1,4 @@ +{{ range .Values.extraObjects }} +--- +{{ tpl (toYaml .) $ }} +{{ end }} diff --git a/deploy/helm/grafana-operator/values.yaml b/deploy/helm/grafana-operator/values.yaml index 3462e712b..c482e5319 100644 --- a/deploy/helm/grafana-operator/values.yaml +++ b/deploy/helm/grafana-operator/values.yaml @@ -111,3 +111,7 @@ serviceMonitor: metricRelabelings: [] # -- Set relabel_configs as per https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config relabelings: [] + +# -- Array of extra K8s objects to deploy +extraObjects: [] + From 3c7bfdc93e7c8c457a850c068e28eb47d189c224 Mon Sep 17 00:00:00 2001 From: gitbluf Date: Mon, 8 Jul 2024 22:08:54 +0200 Subject: [PATCH 2/3] feat: add example of extra object --- deploy/helm/grafana-operator/values.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deploy/helm/grafana-operator/values.yaml b/deploy/helm/grafana-operator/values.yaml index c482e5319..3fb2e1305 100644 --- a/deploy/helm/grafana-operator/values.yaml +++ b/deploy/helm/grafana-operator/values.yaml @@ -114,4 +114,20 @@ serviceMonitor: # -- Array of extra K8s objects to deploy extraObjects: [] +# - apiVersion: external-secrets.io/v1beta1 +# kind: ExternalSecret +# metadata: +# name: grafana-operator-apikey +# spec: +# refreshInterval: 1h +# secretStoreRef: +# kind: SecretStore +# name: my-secret-store +# target: +# template: +# data: +# GRAFANA_CLOUD_INSTANCE_TOKEN: "{{`{{ .Token }}`}}" +# dataFrom: +# - extract: +# key: my-secret-store-secret From e00822ff5d0f27de3708b756d2ea8ffae5e6cab7 Mon Sep 17 00:00:00 2001 From: gitbluf Date: Tue, 9 Jul 2024 10:36:34 +0200 Subject: [PATCH 3/3] chore: run helm make/docs and update CONTRIBUTION README --- CONTRIBUTING.md | 2 +- deploy/helm/grafana-operator/README.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 93c407ce4..3218b7dc0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,7 +93,7 @@ But if you generate new RBAC rules or create new deployment options for the oper Chart.yaml `appVersion` follows the grafana-operator version but the helm chart is versioned separately. -If you add update the chart don't forget to run `make helm-docs`, which will update the helm specific README file. +If you add update the chart don't forget to run `make helm/docs`, which will update the helm specific README file. ### Kustomize diff --git a/deploy/helm/grafana-operator/README.md b/deploy/helm/grafana-operator/README.md index bb582386d..b5259493d 100644 --- a/deploy/helm/grafana-operator/README.md +++ b/deploy/helm/grafana-operator/README.md @@ -65,6 +65,7 @@ It's easier to just manage this configuration outside of the operator. | additionalLabels | object | `{}` | additional labels to add to all resources | | affinity | object | `{}` | pod affinity | | env | list | `[]` | Additional environment variables | +| extraObjects | list | `[]` | Array of extra K8s objects to deploy | | fullnameOverride | string | `""` | Overrides the fully qualified app name. | | image.pullPolicy | string | `"IfNotPresent"` | The image pull policy to use in grafana operator container | | image.repository | string | `"ghcr.io/grafana/grafana-operator"` | grafana operator image repository |