tls-secrets.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. {{- if .Values.ingress.enabled }}
  2. {{- if .Values.ingress.secrets }}
  3. {{- range .Values.ingress.secrets }}
  4. apiVersion: v1
  5. kind: Secret
  6. metadata:
  7. name: {{ .name }}
  8. namespace: {{ $.Release.Namespace | quote }}
  9. labels: {{- include "common.labels.standard" $ | nindent 4 }}
  10. {{- if $.Values.commonLabels }}
  11. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  12. {{- end }}
  13. {{- if $.Values.commonAnnotations }}
  14. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  15. {{- end }}
  16. type: kubernetes.io/tls
  17. data:
  18. tls.crt: {{ .certificate | b64enc }}
  19. tls.key: {{ .key | b64enc }}
  20. ---
  21. {{- end }}
  22. {{- end }}
  23. {{- if and .Values.ingress.tls .Values.ingress.selfSigned }}
  24. {{- $ca := genCA "halo-ca" 365 }}
  25. {{- $cert := genSignedCert .Values.ingress.hostname nil (list .Values.ingress.hostname) 365 $ca }}
  26. apiVersion: v1
  27. kind: Secret
  28. metadata:
  29. name: {{ printf "%s-tls" .Values.ingress.hostname }}
  30. namespace: {{ .Release.Namespace | quote }}
  31. labels: {{- include "common.labels.standard" . | nindent 4 }}
  32. {{- if .Values.commonLabels }}
  33. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  34. {{- end }}
  35. {{- if .Values.commonAnnotations }}
  36. annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  37. {{- end }}
  38. type: kubernetes.io/tls
  39. data:
  40. tls.crt: {{ $cert.Cert | b64enc | quote }}
  41. tls.key: {{ $cert.Key | b64enc | quote }}
  42. ca.crt: {{ $ca.Cert | b64enc | quote }}
  43. {{- end }}
  44. {{- end }}