secrets.yaml 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. {{- if (include "zookeeper.client.createSecret" .) }}
  2. apiVersion: v1
  3. kind: Secret
  4. metadata:
  5. name: {{ printf "%s-client-auth" (include "common.names.fullname" .) }}
  6. namespace: {{ template "zookeeper.namespace" . }}
  7. labels: {{- include "common.labels.standard" . | nindent 4 }}
  8. app.kubernetes.io/component: zookeeper
  9. {{- if .Values.commonLabels }}
  10. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  11. {{- end }}
  12. {{- if .Values.commonAnnotations }}
  13. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  14. {{- end }}
  15. type: Opaque
  16. data:
  17. client-password: {{ include "common.secrets.passwords.manage" (dict "secret" (printf "%s-client-auth" (include "common.names.fullname" .)) "key" "client-password" "providedValues" (list "auth.client.clientPassword") "context" $) }}
  18. server-password: {{ include "common.secrets.passwords.manage" (dict "secret" (printf "%s-client-auth" (include "common.names.fullname" .)) "key" "server-password" "providedValues" (list "auth.client.serverPasswords") "context" $) }}
  19. {{- end }}
  20. {{- if (include "zookeeper.quorum.createSecret" .) }}
  21. ---
  22. apiVersion: v1
  23. kind: Secret
  24. metadata:
  25. name: {{ printf "%s-quorum-auth" (include "common.names.fullname" .) }}
  26. namespace: {{ template "zookeeper.namespace" . }}
  27. labels: {{- include "common.labels.standard" . | nindent 4 }}
  28. app.kubernetes.io/component: zookeeper
  29. {{- if .Values.commonLabels }}
  30. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  31. {{- end }}
  32. {{- if .Values.commonAnnotations }}
  33. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  34. {{- end }}
  35. type: Opaque
  36. data:
  37. quorum-learner-password: {{ include "common.secrets.passwords.manage" (dict "secret" (printf "%s-quorum-auth" (include "common.names.fullname" .)) "key" "quorum-learner-password" "providedValues" (list "auth.quorum.learnerPassword") "context" $) }}
  38. quorum-server-password: {{ include "common.secrets.passwords.manage" (dict "secret" (printf "%s-quorum-auth" (include "common.names.fullname" .)) "key" "quorum-server-password" "providedValues" (list "auth.quorum.serverPasswords") "context" $) }}
  39. {{- end }}
  40. {{- if (include "zookeeper.client.createTlsPasswordsSecret" .) }}
  41. ---
  42. apiVersion: v1
  43. kind: Secret
  44. metadata:
  45. name: {{ template "common.names.fullname" . }}-client-tls-pass
  46. namespace: {{ template "zookeeper.namespace" . }}
  47. labels: {{- include "common.labels.standard" . | nindent 4 }}
  48. {{- if .Values.commonLabels }}
  49. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  50. {{- end }}
  51. {{- if .Values.commonAnnotations }}
  52. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  53. {{- end }}
  54. type: Opaque
  55. data:
  56. keystore-password: {{ default (randAlphaNum 10) .Values.tls.client.keystorePassword | b64enc | quote }}
  57. truststore-password: {{ default (randAlphaNum 10) .Values.tls.client.truststorePassword | b64enc | quote }}
  58. {{- end }}
  59. {{- if (include "zookeeper.quorum.createTlsPasswordsSecret" .) }}
  60. ---
  61. apiVersion: v1
  62. kind: Secret
  63. metadata:
  64. name: {{ template "common.names.fullname" . }}-quorum-tls-pass
  65. namespace: {{ template "zookeeper.namespace" . }}
  66. labels: {{- include "common.labels.standard" . | nindent 4 }}
  67. {{- if .Values.commonLabels }}
  68. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  69. {{- end }}
  70. {{- if .Values.commonAnnotations }}
  71. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  72. {{- end }}
  73. type: Opaque
  74. data:
  75. keystore-password: {{ default (randAlphaNum 10) .Values.tls.quorum.keystorePassword | b64enc | quote }}
  76. truststore-password: {{ default (randAlphaNum 10) .Values.tls.quorum.truststorePassword | b64enc | quote }}
  77. {{- end }}