{{- if eq .Values.datastore "etcd" -}}
# The following contains k8s Secrets for use with a TLS enabled etcd cluster.
# For information on populating Secrets, see http://kubernetes.io/docs/user-guide/secrets/
apiVersion: v1
kind: Secret
type: Opaque
metadata:
  name: calico-etcd-secrets
  namespace: kube-system
data:
{{- if include "calico.etcd.tls" . }}
  etcd-key: {{ .Values.etcd.tls.key | b64enc }}
  etcd-ca: {{ .Values.etcd.tls.ca | b64enc }}
  etcd-cert: {{ .Values.etcd.tls.crt | b64enc }}
{{- else }}
  # Populate the following with etcd TLS configuration if desired, but leave blank if
  # not using TLS for etcd.
  # The keys below should be uncommented and the values populated with the base64
  # encoded contents of each file that would be associated with the TLS data.
  # Example command for encoding a file contents: cat <file> | base64 -w 0
  # etcd-key: null
  # etcd-cert: null
  # etcd-ca: null
{{- end -}}
{{- end -}}
