-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathregistry-external-secret.yaml
More file actions
38 lines (38 loc) · 1.81 KB
/
Copy pathregistry-external-secret.yaml
File metadata and controls
38 lines (38 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{{- $regAuth := or .Values.app.images.main.registry.auth (and .Values.global.registry.enabled .Values.global.registry.vaultPath) }}
{{- $regDomain := .Values.app.images.main.registry.domain | default .Values.global.registry.domain }}
{{- $regUser := .Values.app.images.main.registry.user | default .Values.global.registry.user }}
{{- $regVaultPath := .Values.app.images.main.registry.vaultPath | default .Values.global.registry.vaultPath }}
{{- $regPasswordKey := .Values.app.images.main.registry.passwordVaultKey | default .Values.global.registry.passwordVaultKey }}
{{- if $regAuth }}
---
apiVersion: "external-secrets.io/v1"
kind: ExternalSecret
metadata:
name: {{ .Values.app.images.main.registry.secretName }}
namespace: {{ .Release.Namespace | default .Values.global.namespace }}
annotations:
argocd.argoproj.io/sync-wave: "36"
spec:
refreshInterval: 15s
secretStoreRef:
name: {{ .Values.global.secretStore.name }}
kind: {{ .Values.global.secretStore.kind }}
target:
name: {{ .Values.app.images.main.registry.secretName }}
template:
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: |
{
"auths": {
"{{ tpl (required "registry domain is required (set app.images.main.registry.domain or global.registry.domain)" $regDomain) $ }}": {
"auth": "{{ `{{ printf "%s:%s" "` }}{{ $regUser }}{{ `" .password | b64enc }}` }}"
}
}
}
data:
- secretKey: password
remoteRef:
key: {{ required "registry vaultPath is required (set app.images.main.registry.vaultPath or global.registry.vaultPath)" $regVaultPath }}
property: {{ required "registry passwordVaultKey is required (set app.images.main.registry.passwordVaultKey or global.registry.passwordVaultKey)" $regPasswordKey }}
{{- end }}