summaryrefslogtreecommitdiff
path: root/astroshop-platform/argocd-helmchart/templates/redis-secret-init
diff options
context:
space:
mode:
Diffstat (limited to 'astroshop-platform/argocd-helmchart/templates/redis-secret-init')
-rw-r--r--astroshop-platform/argocd-helmchart/templates/redis-secret-init/job.yaml70
-rw-r--r--astroshop-platform/argocd-helmchart/templates/redis-secret-init/role.yaml27
-rw-r--r--astroshop-platform/argocd-helmchart/templates/redis-secret-init/rolebinding.yaml19
-rw-r--r--astroshop-platform/argocd-helmchart/templates/redis-secret-init/serviceaccount.yaml16
4 files changed, 132 insertions, 0 deletions
diff --git a/astroshop-platform/argocd-helmchart/templates/redis-secret-init/job.yaml b/astroshop-platform/argocd-helmchart/templates/redis-secret-init/job.yaml
new file mode 100644
index 0000000..5fd41f6
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/redis-secret-init/job.yaml
@@ -0,0 +1,70 @@
+{{- if and .Values.redisSecretInit.enabled (not .Values.externalRedis.host) }}
+apiVersion: batch/v1
+kind: Job
+metadata:
+ name: {{ include "argo-cd.redisSecretInit.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . | quote }}
+ annotations:
+ "helm.sh/hook": pre-install,pre-upgrade
+ "helm.sh/hook-delete-policy": before-hook-creation
+ {{- range $key, $value := .Values.redisSecretInit.jobAnnotations }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.redisSecretInit.name "name" .Values.redisSecretInit.name) | nindent 4 }}
+spec:
+ ttlSecondsAfterFinished: 60
+ template:
+ metadata:
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.redisSecretInit.name "name" .Values.redisSecretInit.name) | nindent 8 }}
+ {{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.redisSecretInit.podLabels) }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.redisSecretInit.podAnnotations) }}
+ annotations:
+ {{- range $key, $value := . }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ {{- end }}
+ spec:
+ {{- with .Values.redisSecretInit.imagePullSecrets | default .Values.global.imagePullSecrets }}
+ imagePullSecrets:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ containers:
+ - command:
+ - argocd
+ - admin
+ - redis-initial-password
+ image: {{ default .Values.global.image.repository .Values.redisSecretInit.image.repository }}:{{ default (include "argo-cd.defaultTag" .) .Values.redisSecretInit.image.tag }}
+ imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.redisSecretInit.image.imagePullPolicy }}
+ name: secret-init
+ resources:
+ {{- toYaml .Values.redisSecretInit.resources | nindent 10 }}
+ {{- with .Values.redisSecretInit.containerSecurityContext }}
+ securityContext:
+ {{- toYaml . | nindent 10 }}
+ {{- end }}
+ {{- with .Values.redisSecretInit.securityContext }}
+ securityContext:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.redisSecretInit.priorityClassName | default .Values.global.priorityClassName }}
+ priorityClassName: {{ . }}
+ {{- end }}
+ restartPolicy: OnFailure
+ {{- with include "argo-cd.affinity" (dict "context" . "component" .Values.redisSecretInit) }}
+ affinity:
+ {{- trim . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.redisSecretInit.nodeSelector | default .Values.global.nodeSelector }}
+ nodeSelector:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.redisSecretInit.tolerations | default .Values.global.tolerations }}
+ tolerations:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ serviceAccountName: {{ include "argo-cd.redisSecretInit.serviceAccountName" . }}
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/redis-secret-init/role.yaml b/astroshop-platform/argocd-helmchart/templates/redis-secret-init/role.yaml
new file mode 100644
index 0000000..9e8259f
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/redis-secret-init/role.yaml
@@ -0,0 +1,27 @@
+{{- if and .Values.redisSecretInit.enabled (not .Values.externalRedis.host) }}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: Role
+metadata:
+ annotations:
+ "helm.sh/hook": pre-install,pre-upgrade
+ "helm.sh/hook-delete-policy": before-hook-creation
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.redisSecretInit.name "name" .Values.redisSecretInit.name) | nindent 4 }}
+ name: {{ include "argo-cd.redisSecretInit.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . | quote }}
+rules:
+ - apiGroups:
+ - ""
+ resources:
+ - secrets
+ resourceNames:
+ - argocd-redis
+ verbs:
+ - get
+ - apiGroups:
+ - ""
+ resources:
+ - secrets
+ verbs:
+ - create
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/redis-secret-init/rolebinding.yaml b/astroshop-platform/argocd-helmchart/templates/redis-secret-init/rolebinding.yaml
new file mode 100644
index 0000000..a199628
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/redis-secret-init/rolebinding.yaml
@@ -0,0 +1,19 @@
+{{- if and .Values.redisSecretInit.enabled (not .Values.externalRedis.host) }}
+apiVersion: rbac.authorization.k8s.io/v1
+kind: RoleBinding
+metadata:
+ annotations:
+ "helm.sh/hook": pre-install,pre-upgrade
+ "helm.sh/hook-delete-policy": before-hook-creation
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.redisSecretInit.name "name" .Values.redisSecretInit.name) | nindent 4 }}
+ name: {{ include "argo-cd.redisSecretInit.fullname" . }}
+ namespace: {{ include "argo-cd.namespace" . | quote }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: {{ include "argo-cd.redisSecretInit.fullname" . }}
+subjects:
+ - kind: ServiceAccount
+ name: {{ include "argo-cd.redisSecretInit.serviceAccountName" . }}
+{{- end }}
diff --git a/astroshop-platform/argocd-helmchart/templates/redis-secret-init/serviceaccount.yaml b/astroshop-platform/argocd-helmchart/templates/redis-secret-init/serviceaccount.yaml
new file mode 100644
index 0000000..85540d2
--- /dev/null
+++ b/astroshop-platform/argocd-helmchart/templates/redis-secret-init/serviceaccount.yaml
@@ -0,0 +1,16 @@
+{{- if and .Values.redisSecretInit.enabled .Values.redisSecretInit.serviceAccount.create (not .Values.externalRedis.host) }}
+apiVersion: v1
+kind: ServiceAccount
+automountServiceAccountToken: {{ .Values.redisSecretInit.serviceAccount.automountServiceAccountToken }}
+metadata:
+ name: {{ include "argo-cd.redisSecretInit.serviceAccountName" . }}
+ namespace: {{ include "argo-cd.namespace" . | quote }}
+ annotations:
+ "helm.sh/hook": pre-install,pre-upgrade
+ "helm.sh/hook-delete-policy": before-hook-creation
+ {{- range $key, $value := .Values.redisSecretInit.serviceAccount.annotations }}
+ {{ $key }}: {{ $value | quote }}
+ {{- end }}
+ labels:
+ {{- include "argo-cd.labels" (dict "context" . "component" .Values.redisSecretInit.name "name" .Values.redisSecretInit.name) | nindent 4 }}
+{{- end }}