# helm_charts_gossip-secret.yaml
{{ if .Values.Gossip.Create }}
apiVersion: v1
kind: Secret
metadata:
  name: {{ template "consul.fullname" . }}-gossip-key
  labels:
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: {{ template "consul.chart" . }}
    component: "{{ .Release.Name }}-{{ .Values.Component }}"
type: Opaque
data:
  {{ if .Values.GossipKey }}
  gossip-key: {{ .Values.GossipKey | b64enc }}
  {{ else }}
  gossip-key: {{ randAlphaNum 24 | b64enc }}
  {{ end }}
{{ end }}