Skip to content

Commit

Permalink
Merge pull request #2835 from weikinhuang/grafana-dns-policy
Browse files Browse the repository at this point in the history
[grafana] Allow setting dns config for pod template
  • Loading branch information
zanhsieh authored Dec 12, 2023
2 parents 8fa5532 + 357f763 commit 005e04c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
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: 7.0.14
version: 7.0.15
appVersion: 10.2.2
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
Expand Down
11 changes: 9 additions & 2 deletions charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ securityContext:
hostAliases:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- if .Values.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
Expand Down Expand Up @@ -169,7 +176,7 @@ initContainers:
mountPath: "/etc/grafana/provisioning/alerting"
{{- with .Values.sidecar.alerts.extraMounts }}
{{- toYaml . | trim | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.sidecar.datasources.enabled .Values.sidecar.datasources.initDatasources }}
- name: {{ include "grafana.name" . }}-init-sc-datasources
Expand Down Expand Up @@ -411,7 +418,7 @@ containers:
mountPath: "/etc/grafana/provisioning/alerting"
{{- with .Values.sidecar.alerts.extraMounts }}
{{- toYaml . | trim | nindent 6 }}
{{- end }}
{{- end }}
{{- end}}
{{- if .Values.sidecar.dashboards.enabled }}
- name: {{ include "grafana.name" . }}-sc-dashboard
Expand Down
10 changes: 10 additions & 0 deletions charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ testFramework:
imagePullPolicy: IfNotPresent
securityContext: {}

# dns configuration for pod
dnsPolicy: ~
dnsConfig: {}
# nameservers:
# - 8.8.8.8
# options:
# - name: ndots
# value: "2"
# - name: edns0

securityContext:
runAsNonRoot: true
runAsUser: 472
Expand Down

0 comments on commit 005e04c

Please sign in to comment.