Skip to content

Commit

Permalink
grafana: Configurable Security Context for sidecars
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Hernvall <c.hernvall@yubico.com>
  • Loading branch information
splushii committed Nov 29, 2021
1 parent 91c6a60 commit 9f30ebf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ This version requires Helm >= 3.1.0.
| `sidecar.image.sha` | Sidecar image sha (optional) | `""` |
| `sidecar.imagePullPolicy` | Sidecar image pull policy | `IfNotPresent` |
| `sidecar.resources` | Sidecar resources | `{}` |
| `sidecar.securityContext` | Sidecar securityContext | `{}` |
| `sidecar.enableUniqueFilenames` | Sets the kiwigrid/k8s-sidecar UNIQUE_FILENAMES environment variable. If set to `true` the sidecar will create unique filenames where duplicate data keys exist between ConfigMaps and/or Secrets within the same or multiple Namespaces. | `false` |
| `sidecar.dashboards.enabled` | Enables the cluster wide search for dashboards and adds/updates/deletes them in grafana | `false` |
| `sidecar.dashboards.SCProvider` | Enables creation of sidecar provider | `true` |
Expand Down
12 changes: 12 additions & 0 deletions charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ initContainers:
{{- end }}
resources:
{{ toYaml .Values.sidecar.resources | indent 6 }}
{{- if .Values.sidecar.securityContext }}
securityContext:
{{- toYaml .Values.sidecar.securityContext | nindent 6 }}
{{- end }}
volumeMounts:
- name: sc-datasources-volume
mountPath: "/etc/grafana/provisioning/datasources"
Expand Down Expand Up @@ -147,6 +151,10 @@ initContainers:
{{- end }}
resources:
{{ toYaml .Values.sidecar.resources | indent 6 }}
{{- if .Values.sidecar.securityContext }}
securityContext:
{{- toYaml .Values.sidecar.securityContext | nindent 6 }}
{{- end }}
volumeMounts:
- name: sc-notifiers-volume
mountPath: "/etc/grafana/provisioning/notifiers"
Expand Down Expand Up @@ -205,6 +213,10 @@ containers:
{{- end }}
resources:
{{ toYaml .Values.sidecar.resources | indent 6 }}
{{- if .Values.sidecar.securityContext }}
securityContext:
{{- toYaml .Values.sidecar.securityContext | nindent 6 }}
{{- end }}
volumeMounts:
- name: sc-dashboard-volume
mountPath: {{ .Values.sidecar.dashboards.folder | quote }}
Expand Down
1 change: 1 addition & 0 deletions charts/grafana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,7 @@ sidecar:
# requests:
# cpu: 50m
# memory: 50Mi
securityContext: {}
# skipTlsVerify Set to true to skip tls verification for kube api calls
# skipTlsVerify: true
enableUniqueFilenames: false
Expand Down

0 comments on commit 9f30ebf

Please sign in to comment.