-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
294 additions
and
280 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,76 @@ | ||
{{- if .Values.externalSecret.create -}} | ||
{{- $labels := include "common.labels" . -}} | ||
|
||
{{- if eq .Values.externalSecret.backendType "azureKeyVaults" }} | ||
apiVersion: secrets-store.csi.x-k8s.io/v1 | ||
kind: SecretProviderClass | ||
metadata: | ||
name: {{ include "common.externalSecretName" . }} | ||
labels: | ||
{{- include "common.labels" . | nindent 4 }} | ||
{{- with .Values.externalSecret.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
provider: azure | ||
parameters: | ||
usePodIdentity: "false" | ||
useVMManagedIdentity: "true" # Set to true for using managed identity | ||
userAssignedIdentityID: {{ .Values.externalSecret.userAssignedIdentityID }} | ||
keyvaultName: {{ .Values.externalSecret.keyvaultName }} # Set to the name of your key vault | ||
cloudName: "" # [OPTIONAL for Azure] if not provided, the Azure environment defaults to AzurePublicCloud | ||
objects: | | ||
array: | ||
{{- range $key, $value := .Values.externalSecret.data }} | ||
- | | ||
objectName: {{ $value.objectName }} | ||
objectType: secret # object types: secret, key, or cert | ||
objectVersion: "" # [OPTIONAL] object versions, default to latest if empty | ||
{{- end}} | ||
tenantId: {{ .Values.externalSecret.tenantId }} # The tenant ID of the key vault | ||
secretObjects: # [OPTIONAL] SecretObjects defines the desired state of synced Kubernetes secret objects | ||
- data: | ||
{{- range $key, $value := .Values.externalSecret.data }} | ||
- key: {{ $value.key }} # data field to populate | ||
objectName: {{ $value.objectName }} # name of the mounted content to sync; this could be the object name or the object alias | ||
{{- end}} | ||
secretName: {{ .Values.externalSecret.name }} # name of the Kubernetes secret object | ||
type: Opaque | ||
|
||
{{- end }} | ||
{{- range $key, $value := .Values.workloads }} | ||
|
||
{{- if eq .Values.externalSecret.backendType "secretsManager" }} | ||
{{- if $value.externalSecret.create -}} | ||
|
||
{{- if eq $value.externalSecret.backendType "secretsManager" }} | ||
apiVersion: "kubernetes-client.io/v1" | ||
kind: ExternalSecret | ||
metadata: | ||
name: {{ include "common.externalSecretName" . }} | ||
name: {{ $value.externalSecret.name }} | ||
labels: | ||
{{- include "common.labels" . | nindent 4 }} | ||
{{- with .Values.externalSecret.annotations }} | ||
{{- $labels | nindent 4 }} | ||
{{- with $value.externalSecret.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
backendType: {{ .Values.externalSecret.backendType }} | ||
{{- if .Values.externalSecret.roleArn }} | ||
roleArn: {{ .Values.externalSecret.roleArn }} | ||
backendType: {{ $value.externalSecret.backendType }} | ||
{{- if $value.externalSecret.roleArn }} | ||
roleArn: {{ $value.externalSecret.roleArn }} | ||
{{- end }} | ||
{{- if .Values.externalSecret.controllerId }} | ||
controllerId: {{ .Values.externalSecret.controllerId }} | ||
{{- if $value.externalSecret.controllerId }} | ||
controllerId: {{ $value.externalSecret.controllerId }} | ||
{{- end }} | ||
{{- if .Values.externalSecret.region }} | ||
region: {{ .Values.externalSecret.region }} | ||
{{- if $value.externalSecret.region }} | ||
region: {{ $value.externalSecret.region }} | ||
{{- end }} | ||
{{- with .Values.externalSecret.data }} | ||
{{- with $value.externalSecret.data }} | ||
data: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.externalSecret.dataFrom }} | ||
{{- with $value.externalSecret.dataFrom }} | ||
dataFrom: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with .Values.externalSecret.template }} | ||
{{- with $value.externalSecret.template }} | ||
template: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{- if eq .Values.externalSecret.backendType "vaults" }} | ||
{{- if eq $value.externalSecret.backendType "vaults" }} | ||
apiVersion: external-secrets.io/v1beta1 | ||
kind: ExternalSecret | ||
metadata: | ||
name: {{ include "common.externalSecretName" . }} | ||
name: {{ $value.externalSecret.name }} | ||
labels: | ||
{{- include "common.labels" . | nindent 4 }} | ||
{{- with .Values.externalSecret.annotations }} | ||
{{- $labels | nindent 4 }} | ||
{{- with $value.externalSecret.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
spec: | ||
refreshInterval: 15s | ||
secretStoreRef: | ||
name: vault-secret-manager | ||
kind: ClusterSecretStore | ||
name: {{ $value.externalSecret.secretStoreRefName }} | ||
kind: {{ $value.externalSecret.secretStoreRefKind }} | ||
target: | ||
name: {{ .Values.externalSecret.name }} | ||
name: {{ $value.externalSecret.name }} | ||
creationPolicy: Owner | ||
{{- with $value.externalSecret.data }} | ||
data: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $value.externalSecret.dataFrom }} | ||
dataFrom: | ||
- extract: | ||
key: {{ .Values.externalSecret.dataFrom }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
|
||
{{- end }} | ||
|
||
{{- end }} | ||
|
||
--- | ||
{{- end }} |
Oops, something went wrong.