configmap.yaml 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {{- if (include "redis.createConfigmap" .) }}
  2. apiVersion: v1
  3. kind: ConfigMap
  4. metadata:
  5. name: {{ printf "%s-configuration" (include "common.names.fullname" .) }}
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels: {{- include "common.labels.standard" . | nindent 4 }}
  8. {{- if .Values.commonLabels }}
  9. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  10. {{- end }}
  11. {{- if .Values.commonAnnotations }}
  12. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  13. {{- end }}
  14. data:
  15. redis.conf: |-
  16. # User-supplied common configuration:
  17. {{- if .Values.commonConfiguration }}
  18. {{- include "common.tplvalues.render" ( dict "value" .Values.commonConfiguration "context" $ ) | nindent 4 }}
  19. {{- end }}
  20. # End of common configuration
  21. master.conf: |-
  22. dir {{ .Values.master.persistence.path }}
  23. # User-supplied master configuration:
  24. {{- if .Values.master.configuration }}
  25. {{- include "common.tplvalues.render" ( dict "value" .Values.master.configuration "context" $ ) | nindent 4 }}
  26. {{- end }}
  27. {{- if .Values.master.disableCommands }}
  28. {{- range .Values.master.disableCommands }}
  29. rename-command {{ . }} ""
  30. {{- end }}
  31. {{- end }}
  32. # End of master configuration
  33. replica.conf: |-
  34. dir {{ .Values.replica.persistence.path }}
  35. # User-supplied replica configuration:
  36. {{- if .Values.replica.configuration }}
  37. {{- include "common.tplvalues.render" ( dict "value" .Values.replica.configuration "context" $ ) | nindent 4 }}
  38. {{- end }}
  39. {{- if .Values.replica.disableCommands }}
  40. {{- range .Values.replica.disableCommands }}
  41. rename-command {{ . }} ""
  42. {{- end }}
  43. {{- end }}
  44. # End of replica configuration
  45. {{- if .Values.sentinel.enabled }}
  46. sentinel.conf: |-
  47. dir "/tmp"
  48. port {{ .Values.sentinel.containerPorts.sentinel }}
  49. sentinel monitor {{ .Values.sentinel.masterSet }} {{ template "common.names.fullname" . }}-node-0.{{ template "common.names.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }} {{ .Values.sentinel.service.ports.redis }} {{ .Values.sentinel.quorum }}
  50. sentinel down-after-milliseconds {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.downAfterMilliseconds }}
  51. sentinel failover-timeout {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.failoverTimeout }}
  52. sentinel parallel-syncs {{ .Values.sentinel.masterSet }} {{ .Values.sentinel.parallelSyncs }}
  53. # User-supplied sentinel configuration:
  54. {{- if .Values.sentinel.configuration }}
  55. {{- include "common.tplvalues.render" ( dict "value" .Values.sentinel.configuration "context" $ ) | nindent 4 }}
  56. {{- end }}
  57. # End of sentinel configuration
  58. {{- end }}
  59. {{- end }}