rancher-partner-charts/charts/kubecost/cost-analyzer/2.4.0/templates/kubecost-agent-secretprovid...

26 lines
972 B
YAML

{{- if .Values.agent }}
{{- if ((.Values.agentCsi).enabled) }}
{{- if .Capabilities.APIVersions.Has "secrets-store.csi.x-k8s.io/v1" }}
apiVersion: secrets-store.csi.x-k8s.io/v1
{{- else }}
apiVersion: secrets-store.csi.x-k8s.io/v1alpha1
{{- end }}
kind: SecretProviderClass
metadata:
name: {{ .Values.agentCsi.secretProvider.name }}
namespace: {{ .Release.Namespace }}
labels: {{ unset (include "cost-analyzer.commonLabels" . | fromYaml) "app" | toYaml | nindent 4 }}
app: {{ template "kubecost.kubeMetricsName" . }}
spec:
provider: {{ required "Specify a valid provider." .Values.agentCsi.secretProvider.provider }}
{{- if .Values.agentCsi.secretProvider.parameters }}
parameters:
{{- .Values.agentCsi.secretProvider.parameters | toYaml | nindent 4 }}
{{- end }}
{{- if .Values.agentCsi.secretProvider.secretObjects }}
secretObjects:
{{- .Values.agentCsi.secretProvider.secretObjects | toYaml | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}