{{- if and (or .Values.externalWorkloads.enabled .Values.clustermesh.useAPIServer) (not .Values.clustermesh.apiserver.tls.auto.enabled) }}
apiVersion: v1
kind: Secret
metadata:
  name: clustermesh-apiserver-ca-cert
  namespace: {{ .Release.Namespace }}
data:
  ca.crt: {{ .Values.clustermesh.apiserver.tls.ca.cert }}
  {{- if .Values.clustermesh.apiserver.tls.ca.key }}
  ca.key: {{ .Values.clustermesh.apiserver.tls.ca.key }}
  {{- end }}
{{- end }}
