Skip to content
Open
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
30 changes: 29 additions & 1 deletion charts/grafana-cr/templates/grafana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ spec:
wildcardPolicy: None
deployment:
spec:
{{- if .Values.persistentVolume.enabled }}
strategy:
type: Recreate
{{- end }}
template:
spec:
volumes:
Expand All @@ -32,6 +36,11 @@ spec:
- name: {{ include "grafana-cr.fullname" . }}-certs
configMap:
name: {{ include "grafana-cr.fullname" . }}-certs
{{- if .Values.persistentVolume.enabled }}
- name: grafana-data
persistentVolumeClaim:
claimName: {{ include "grafana-cr.fullname" . }}-pvc
{{- end }}
containers:
- image: 'quay.io/openshift/origin-oauth-proxy:4.21'
name: grafana-proxy
Expand Down Expand Up @@ -74,6 +83,10 @@ spec:
- mountPath: /etc/proxy/certs
name: {{ include "grafana-cr.fullname" . }}-certs
readOnly: false
{{- if .Values.persistentVolume.enabled }}
- mountPath: /var/lib/grafana
name: grafana-data
{{- end }}
{{ if .Values.sigv4Proxy.enabled }}
- name: aws-sigv4-proxy
image: public.ecr.aws/aws-observability/aws-sigv4-proxy:1.0
Expand All @@ -87,6 +100,18 @@ spec:
- --port
- :8005
{{ end }}
{{- if .Values.persistentVolume.enabled }}
persistentVolumeClaim:
spec:
accessModes:
{{- toYaml .Values.persistentVolume.accessModes | nindent 8 }}
resources:
requests:
storage: {{ .Values.persistentVolume.size }}
{{- if .Values.persistentVolume.storageClassName }}
storageClassName: {{ .Values.persistentVolume.storageClassName }}
{{- end }}
{{- end }}
config:
auth.anonymous:
enabled: "True"
Expand All @@ -106,6 +131,9 @@ spec:
log:
level: {{ .Values.logLevel }}
mode: console
security:
admin_user: "{{ .Values.basicAuthUsername }}"
admin_password: "{{ .Values.basicAuthPassword }}"
users:
auto_assign_org: "True"
auto_assign_org_role: {{ .Values.oauthProxy.orgRoleAssigned }}
Expand All @@ -130,4 +158,4 @@ spec:
serviceaccounts.openshift.io/oauth-redirectreference.primary: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"{{ include "grafana-cr.fullname" . }}-route"}}'
{{ if .Values.serviceAccountAnnotations }}
{{ .Values.serviceAccountAnnotations | toYaml | nindent 8 }}
{{ end }}
{{ end }}
16 changes: 14 additions & 2 deletions charts/grafana-cr/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ oauthProxy:
# If this is set will use the basic Auth credentials from above
# as a bypass to allow you to manage/modify grafana settings in the GUI
allowHtpasswd: ""
# The Grafa Role to assign to Oauth Users
# Viewier, Editor, Admin
# The Grafana Role to assign to OAuth Users
# Viewer, Editor, Admin
orgRoleAssigned: Viewer
cookieSecret: "ZXhhbXBsZS1jb29raWUtc2VjcmV0enp6"

Expand All @@ -22,3 +22,15 @@ serviceAccountAnnotations: {}
sigv4Proxy:
enabled: false
region: "us-east-2"

# Persistent Volume Configuration
persistentVolume:
# Enable persistent storage for Grafana
enabled: true
# Size of the persistent volume
size: 10Gi
# Access modes for the PVC
accessModes:
- ReadWriteOnce
# Optional: Specify a storage class (leave empty for cluster default)
# storageClassName: "gp2"