refactor(deploy): use envFrom with configMapRef for all deployments
Replace individual configMapKeyRef env vars with envFrom + configMapRef to inject the full ConfigMap, plus minimal env blocks for static values. Also remove resources block from operator deployment (K8s schema validation).
This commit is contained in:
parent
f1388a6ae2
commit
ad2cb7255f
@ -35,91 +35,9 @@ spec:
|
|||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.app.service.port }}
|
containerPort: {{ .Values.app.service.port }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
env:
|
envFrom:
|
||||||
- name: APP_DATABASE_URL
|
- configMapRef:
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
name: {{ include "gitdata.fullname" . }}-config
|
||||||
key: APP_DATABASE_URL
|
|
||||||
optional: true
|
|
||||||
- name: APP_REDIS_URL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_REDIS_URL
|
|
||||||
optional: true
|
|
||||||
- name: NATS_URL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: NATS_URL
|
|
||||||
optional: true
|
|
||||||
- name: HOOK_POOL_REDIS_LIST_PREFIX
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: HOOK_POOL_REDIS_LIST_PREFIX
|
|
||||||
optional: true
|
|
||||||
- name: HOOK_POOL_REDIS_LOG_CHANNEL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: HOOK_POOL_REDIS_LOG_CHANNEL
|
|
||||||
optional: true
|
|
||||||
- name: APP_QDRANT_URL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_QDRANT_URL
|
|
||||||
optional: true
|
|
||||||
- name: APP_QDRANT_API_KEY
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_QDRANT_API_KEY
|
|
||||||
optional: true
|
|
||||||
- name: APP_AVATAR_PATH
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_AVATAR_PATH
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_HOST
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_HOST
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_PORT
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_PORT
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_USERNAME
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_USERNAME
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_PASSWORD
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_FROM
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_FROM
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_TLS
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_TLS
|
|
||||||
optional: true
|
|
||||||
{{- range .Values.app.env }}
|
{{- range .Values.app.env }}
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
value: {{ .value | quote }}
|
value: {{ .value | quote }}
|
||||||
|
|||||||
@ -30,55 +30,9 @@ spec:
|
|||||||
- name: email-worker
|
- name: email-worker
|
||||||
image: "{{ .Values.image.registry }}/{{ .Values.emailWorker.image.repository }}:{{ .Values.emailWorker.image.tag }}"
|
image: "{{ .Values.image.registry }}/{{ .Values.emailWorker.image.repository }}:{{ .Values.emailWorker.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.emailWorker.image.pullPolicy | default .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.emailWorker.image.pullPolicy | default .Values.image.pullPolicy }}
|
||||||
env:
|
envFrom:
|
||||||
- name: APP_DATABASE_URL
|
- configMapRef:
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
name: {{ include "gitdata.fullname" . }}-config
|
||||||
key: APP_DATABASE_URL
|
|
||||||
optional: true
|
|
||||||
- name: APP_REDIS_URL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_REDIS_URL
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_HOST
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_HOST
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_PORT
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_PORT
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_USERNAME
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_USERNAME
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_PASSWORD
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_FROM
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_FROM
|
|
||||||
optional: true
|
|
||||||
- name: APP_SMTP_TLS
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_SMTP_TLS
|
|
||||||
optional: true
|
|
||||||
{{- range .Values.emailWorker.env }}
|
{{- range .Values.emailWorker.env }}
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
value: {{ .value | quote }}
|
value: {{ .value | quote }}
|
||||||
|
|||||||
@ -30,31 +30,9 @@ spec:
|
|||||||
- name: git-hook
|
- name: git-hook
|
||||||
image: "{{ .Values.image.registry }}/{{ .Values.gitHook.image.repository }}:{{ .Values.gitHook.image.tag }}"
|
image: "{{ .Values.image.registry }}/{{ .Values.gitHook.image.repository }}:{{ .Values.gitHook.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.gitHook.image.pullPolicy | default .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.gitHook.image.pullPolicy | default .Values.image.pullPolicy }}
|
||||||
env:
|
envFrom:
|
||||||
- name: APP_DATABASE_URL
|
- configMapRef:
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
name: {{ include "gitdata.fullname" . }}-config
|
||||||
key: APP_DATABASE_URL
|
|
||||||
optional: true
|
|
||||||
- name: APP_REDIS_URL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: APP_REDIS_URL
|
|
||||||
optional: true
|
|
||||||
- name: HOOK_POOL_REDIS_LIST_PREFIX
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: HOOK_POOL_REDIS_LIST_PREFIX
|
|
||||||
optional: true
|
|
||||||
- name: HOOK_POOL_REDIS_LOG_CHANNEL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ include "gitdata.fullname" . }}-config
|
|
||||||
key: HOOK_POOL_REDIS_LOG_CHANNEL
|
|
||||||
optional: true
|
|
||||||
{{- range .Values.gitHook.env }}
|
{{- range .Values.gitHook.env }}
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
value: {{ .value | quote }}
|
value: {{ .value | quote }}
|
||||||
|
|||||||
@ -44,33 +44,12 @@ spec:
|
|||||||
- name: ssh
|
- name: ssh
|
||||||
containerPort: {{ $svc.service.ssh.port }}
|
containerPort: {{ $svc.service.ssh.port }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ $fullName }}-config
|
||||||
env:
|
env:
|
||||||
- name: APP_REPOS_ROOT
|
- name: APP_REPOS_ROOT
|
||||||
value: /data/repos
|
value: /data/repos
|
||||||
- name: APP_DATABASE_URL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ $fullName }}-config
|
|
||||||
key: APP_DATABASE_URL
|
|
||||||
optional: true
|
|
||||||
- name: APP_REDIS_URL
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ $fullName }}-config
|
|
||||||
key: APP_REDIS_URL
|
|
||||||
optional: true
|
|
||||||
- name: APP_SSH_DOMAIN
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ $fullName }}-config
|
|
||||||
key: APP_SSH_DOMAIN
|
|
||||||
optional: true
|
|
||||||
- name: APP_SSH_PORT
|
|
||||||
valueFrom:
|
|
||||||
configMapKeyRef:
|
|
||||||
name: {{ $fullName }}-config
|
|
||||||
key: APP_SSH_PORT
|
|
||||||
optional: true
|
|
||||||
{{- range $svc.env }}
|
{{- range $svc.env }}
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
value: {{ .value | quote }}
|
value: {{ .value | quote }}
|
||||||
|
|||||||
@ -29,6 +29,9 @@ spec:
|
|||||||
- name: operator
|
- name: operator
|
||||||
image: "{{ .Values.image.registry }}/{{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag }}"
|
image: "{{ .Values.image.registry }}/{{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag }}"
|
||||||
imagePullPolicy: {{ .Values.operator.image.pullPolicy | default .Values.image.pullPolicy }}
|
imagePullPolicy: {{ .Values.operator.image.pullPolicy | default .Values.image.pullPolicy }}
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ include "gitdata.fullname" . }}-config
|
||||||
env:
|
env:
|
||||||
- name: OPERATOR_IMAGE_PREFIX
|
- name: OPERATOR_IMAGE_PREFIX
|
||||||
value: {{ .Values.operator.imagePrefix | default (printf "%s/" (include "gitdata.fullname" .)) | quote }}
|
value: {{ .Values.operator.imagePrefix | default (printf "%s/" (include "gitdata.fullname" .)) | quote }}
|
||||||
@ -38,8 +41,6 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
fieldRef:
|
fieldRef:
|
||||||
fieldPath: metadata.namespace
|
fieldPath: metadata.namespace
|
||||||
resources:
|
|
||||||
{{- toYaml .Values.operator.resources | nindent 10 }}
|
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: tmp
|
- name: tmp
|
||||||
mountPath: /tmp
|
mountPath: /tmp
|
||||||
|
|||||||
@ -40,6 +40,9 @@ spec:
|
|||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ $svc.service.port }}
|
containerPort: {{ $svc.service.port }}
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: {{ $fullName }}-config
|
||||||
env:
|
env:
|
||||||
- name: STATIC_ROOT
|
- name: STATIC_ROOT
|
||||||
value: /data
|
value: /data
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user