deployment.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {{ if (and (not .Values.useStatefulSet) (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. {{- if and (not .Values.autoscaling.enabled) (.Values.replicas) }}
  18. replicas: {{ .Values.replicas }}
  19. {{- end }}
  20. revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
  21. selector:
  22. matchLabels:
  23. {{- include "grafana.selectorLabels" . | nindent 6 }}
  24. {{- with .Values.deploymentStrategy }}
  25. strategy:
  26. {{ toYaml . | trim | indent 4 }}
  27. {{- end }}
  28. template:
  29. metadata:
  30. labels:
  31. {{- include "grafana.selectorLabels" . | nindent 8 }}
  32. {{- with .Values.podLabels }}
  33. {{ toYaml . | indent 8 }}
  34. {{- end }}
  35. annotations:
  36. checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
  37. checksum/dashboards-json-config: {{ include (print $.Template.BasePath "/dashboards-json-configmap.yaml") . | sha256sum }}
  38. checksum/sc-dashboard-provider-config: {{ include (print $.Template.BasePath "/configmap-dashboard-provider.yaml") . | sha256sum }}
  39. {{- if and (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))) (not .Values.env.GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION) }}
  40. checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
  41. {{- end }}
  42. {{- if .Values.envRenderSecret }}
  43. checksum/secret-env: {{ include (print $.Template.BasePath "/secret-env.yaml") . | sha256sum }}
  44. {{- end }}
  45. {{- with .Values.podAnnotations }}
  46. {{ toYaml . | indent 8 }}
  47. {{- end }}
  48. spec:
  49. {{- include "grafana.pod" . | indent 6 }}
  50. {{- end }}