secrets.yaml 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}}
  2. apiVersion: v1
  3. kind: Secret
  4. metadata:
  5. name: {{ template "common.names.fullname" . }}
  6. namespace: {{ template "zookeeper.namespace" . }}
  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. type: Opaque
  15. data:
  16. client-password: {{ include "zookeeper.clientPassword" . | b64enc | quote }}
  17. server-password: {{ include "zookeeper.serverPasswords" . | b64enc | quote }}
  18. ---
  19. {{- end }}
  20. {{- if and .Values.tls.client.enabled (not .Values.tls.client.existingSecret) (or .Values.tls.client.keystorePassword .Values.tls.client.truststorePassword .Values.tls.client.autoGenerated) -}}
  21. apiVersion: v1
  22. kind: Secret
  23. metadata:
  24. name: {{ template "common.names.fullname" . }}-client-tls-pass
  25. namespace: {{ template "zookeeper.namespace" . }}
  26. labels: {{- include "common.labels.standard" . | nindent 4 }}
  27. {{- if .Values.commonLabels }}
  28. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  29. {{- end }}
  30. {{- if .Values.commonAnnotations }}
  31. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  32. {{- end }}
  33. type: Opaque
  34. data:
  35. {{- if or .Values.tls.client.keystorePassword .Values.tls.client.autoGenerated }}
  36. keystore-password: {{ (.Values.tls.client.keystorePassword | default (randAlphaNum 10)) | b64enc | quote }}
  37. {{- end }}
  38. {{- if or .Values.tls.client.truststorePassword .Values.tls.client.autoGenerated }}
  39. truststore-password: {{ (.Values.tls.client.truststorePassword | default (randAlphaNum 10))| b64enc | quote }}
  40. {{- end }}
  41. ---
  42. {{- end }}
  43. {{- if and .Values.tls.quorum.enabled (not .Values.tls.quorum.existingSecret) (or .Values.tls.quorum.keystorePassword .Values.tls.quorum.truststorePassword .Values.tls.quorum.autoGenerated) -}}
  44. apiVersion: v1
  45. kind: Secret
  46. metadata:
  47. name: {{ template "common.names.fullname" . }}-quorum-tls-pass
  48. namespace: {{ template "zookeeper.namespace" . }}
  49. labels: {{- include "common.labels.standard" . | nindent 4 }}
  50. {{- if .Values.commonLabels }}
  51. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  52. {{- end }}
  53. {{- if .Values.commonAnnotations }}
  54. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  55. {{- end }}
  56. type: Opaque
  57. data:
  58. {{- if or .Values.tls.quorum.keystorePassword .Values.tls.quorum.autoGenerated }}
  59. keystore-password: {{ (.Values.tls.quorum.keystorePassword | default (randAlphaNum 10)) | b64enc | quote }}
  60. {{- end }}
  61. {{- if or .Values.tls.quorum.truststorePassword .Values.tls.quorum.autoGenerated }}
  62. truststore-password: {{ (.Values.tls.quorum.truststorePassword | default (randAlphaNum 10))| b64enc | quote }}
  63. {{- end }}
  64. ---
  65. {{- end }}