secrets.yaml 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {{- /*
  2. Copyright Broadcom, Inc. All Rights Reserved.
  3. SPDX-License-Identifier: APACHE-2.0
  4. */}}
  5. {{- if (include "zookeeper.client.createSecret" .) }}
  6. apiVersion: v1
  7. kind: Secret
  8. metadata:
  9. name: {{ printf "%s-client-auth" (include "common.names.fullname" .) }}
  10. namespace: {{ template "zookeeper.namespace" . }}
  11. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  12. app.kubernetes.io/component: zookeeper
  13. {{- if .Values.commonAnnotations }}
  14. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  15. {{- end }}
  16. type: Opaque
  17. data:
  18. 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" $) }}
  19. 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" $) }}
  20. {{- end }}
  21. {{- if (include "zookeeper.quorum.createSecret" .) }}
  22. ---
  23. apiVersion: v1
  24. kind: Secret
  25. metadata:
  26. name: {{ printf "%s-quorum-auth" (include "common.names.fullname" .) }}
  27. namespace: {{ template "zookeeper.namespace" . }}
  28. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  29. app.kubernetes.io/component: zookeeper
  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. 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" $) }}
  36. 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" $) }}
  37. {{- end }}
  38. {{- if (include "zookeeper.client.createTlsPasswordsSecret" .) }}
  39. ---
  40. apiVersion: v1
  41. kind: Secret
  42. metadata:
  43. name: {{ template "common.names.fullname" . }}-client-tls-pass
  44. namespace: {{ template "zookeeper.namespace" . }}
  45. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  46. {{- if .Values.commonAnnotations }}
  47. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  48. {{- end }}
  49. type: Opaque
  50. data:
  51. keystore-password: {{ default (randAlphaNum 10) .Values.tls.client.keystorePassword | b64enc | quote }}
  52. truststore-password: {{ default (randAlphaNum 10) .Values.tls.client.truststorePassword | b64enc | quote }}
  53. {{- end }}
  54. {{- if (include "zookeeper.quorum.createTlsPasswordsSecret" .) }}
  55. ---
  56. apiVersion: v1
  57. kind: Secret
  58. metadata:
  59. name: {{ template "common.names.fullname" . }}-quorum-tls-pass
  60. namespace: {{ template "zookeeper.namespace" . }}
  61. labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
  62. {{- if .Values.commonAnnotations }}
  63. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  64. {{- end }}
  65. type: Opaque
  66. data:
  67. keystore-password: {{ default (randAlphaNum 10) .Values.tls.quorum.keystorePassword | b64enc | quote }}
  68. truststore-password: {{ default (randAlphaNum 10) .Values.tls.quorum.truststorePassword | b64enc | quote }}
  69. {{- end }}