Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[grafana] adds extraObjects as strings support #3602

Merged
merged 5 commits into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: grafana
version: 8.10.3
version: 8.10.4
appVersion: 11.5.2
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
Expand Down
6 changes: 5 additions & 1 deletion charts/grafana/templates/extra-manifests.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{ range .Values.extraObjects }}
---
{{ tpl (toYaml .) $ }}
{{- if typeIs "string" . }}
{{ tpl . $ }}
{{ else }}
{{ tpl (. | toYaml) $ }}
{{- end }}
{{ end }}
35 changes: 25 additions & 10 deletions charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1534,17 +1534,32 @@ networkPolicy:
# Enable backward compatibility of kubernetes where version below 1.13 doesn't have the enableServiceLinks option
enableKubeBackwardCompatibility: false
useStatefulSet: false
# Create a dynamic manifests via values:

# extraObjects could be utilized to add dynamic manifests via values
extraObjects: []
# - apiVersion: "kubernetes-client.io/v1"
# kind: ExternalSecret
# metadata:
# name: grafana-secrets
# spec:
# backendType: gcpSecretsManager
# data:
# - key: grafana-admin-password
# name: adminPassword
# Examples:
# extraObjects:
# - apiVersion: kubernetes-client.io/v1
# kind: ExternalSecret
# metadata:
# name: grafana-secrets-{{ .Release.Name }}
# spec:
# backendType: gcpSecretsManager
# data:
# - key: grafana-admin-password
# name: adminPassword
# Alternatively, you can use strings, which lets you use additional templating features:
# extraObjects:
# - |
# apiVersion: kubernetes-client.io/v1
# kind: ExternalSecret
# metadata:
# name: grafana-secrets-{{ .Release.Name }}
# spec:
# backendType: gcpSecretsManager
# data:
# - key: grafana-admin-password
# name: {{ include "some-other-template" }}

# assertNoLeakedSecrets is a helper function defined in _helpers.tpl that checks if secret
# values are not exposed in the rendered grafana.ini configmap. It is enabled by default.
Expand Down
Loading