2
0

deployment.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {{ if (or (not .Values.persistence.enabled) (eq .Values.persistence.type "pvc")) }}
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: {{ template "grafana.fullname" . }}
  6. namespace: {{ template "grafana.namespace" . }}
  7. labels:
  8. {{- include "grafana.labels" . | nindent 4 }}
  9. {{- if .Values.labels }}
  10. {{ toYaml .Values.labels | indent 4 }}
  11. {{- end }}
  12. {{- with .Values.annotations }}
  13. annotations:
  14. {{ toYaml . | indent 4 }}
  15. {{- end }}
  16. spec:
  17. replicas: {{ .Values.replicas }}
  18. revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
  19. selector:
  20. matchLabels:
  21. {{- include "grafana.selectorLabels" . | nindent 6 }}
  22. {{- with .Values.deploymentStrategy }}
  23. strategy:
  24. {{ toYaml . | trim | indent 4 }}
  25. {{- end }}
  26. template:
  27. metadata:
  28. labels:
  29. {{- include "grafana.selectorLabels" . | nindent 8 }}
  30. {{- with .Values.podLabels }}
  31. {{ toYaml . | indent 8 }}
  32. {{- end }}
  33. annotations:
  34. checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
  35. checksum/dashboards-json-config: {{ include (print $.Template.BasePath "/dashboards-json-configmap.yaml") . | sha256sum }}
  36. checksum/sc-dashboard-provider-config: {{ include (print $.Template.BasePath "/configmap-dashboard-provider.yaml") . | sha256sum }}
  37. {{- if or (and (not .Values.admin.existingSecret) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD__FILE) (not .Values.env.GF_SECURITY_ADMIN_PASSWORD)) (and .Values.ldap.enabled (not .Values.ldap.existingSecret)) }}
  38. checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
  39. {{- end }}
  40. {{- if .Values.envRenderSecret }}
  41. checksum/secret-env: {{ include (print $.Template.BasePath "/secret-env.yaml") . | sha256sum }}
  42. {{- end }}
  43. {{- with .Values.podAnnotations }}
  44. {{ toYaml . | indent 8 }}
  45. {{- end }}
  46. spec:
  47. {{- include "grafana.pod" . | nindent 6 }}
  48. {{- end }}