feat: 外部Secret連携(extraEnvFrom / extraEnv / SMTP existingSecret)を追加
Helm Chart Release / release-chart (push) Successful in 6s
Helm Chart Release / release-chart (push) Successful in 6s
helmchart/secret-manager が各ネームスペースへ配布する cred-* Secret を phpfpm 側から参照できるようにする。 - extraEnvFrom / extraEnv: 既存 Secret/ConfigMap を php-fpm コンテナへ env 注入 - smtp.auth.existingSecret / existingSecretKey: パスワードファイルだけ既存 Secret から取得 - smtp.existingMsmtprcSecret / existingMsmtprcSecretKey: 完成済み msmtprc を そのままマウント(指定時は configmap-smtp を生成せず host/port/auth.* は無視) 既定値は全て空のため既存挙動は不変。手動リリース 8.5.10-a。
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
{{- if .Values.smtp.enabled }}
|
||||
{{- if and .Values.smtp.enabled (not .Values.smtp.existingMsmtprcSecret) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
|
||||
@@ -280,7 +280,7 @@ spec:
|
||||
- name: smtp-config
|
||||
mountPath: /etc/smtp-config
|
||||
readOnly: true
|
||||
{{- if .Values.smtp.auth.enabled }}
|
||||
{{- if and .Values.smtp.auth.enabled (not .Values.smtp.existingMsmtprcSecret) }}
|
||||
- name: smtp-secrets
|
||||
mountPath: /etc/smtp-secrets
|
||||
readOnly: true
|
||||
@@ -306,6 +306,13 @@ spec:
|
||||
- name: {{ $key }}
|
||||
value: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraEnv }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraEnvFrom }}
|
||||
envFrom:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.selenium.enabled }}
|
||||
- name: selenium
|
||||
image: "{{ .Values.image.selenium.registry }}/{{ .Values.image.selenium.repository }}:{{ .Values.image.selenium.tag }}"
|
||||
@@ -340,17 +347,26 @@ spec:
|
||||
{{- end }}
|
||||
{{- if .Values.smtp.enabled }}
|
||||
- name: smtp-config
|
||||
{{- if .Values.smtp.existingMsmtprcSecret }}
|
||||
# 完成済み msmtprc を持つ既存 Secret(secret-manager の cred-* 等)を利用
|
||||
secret:
|
||||
secretName: {{ .Values.smtp.existingMsmtprcSecret }}
|
||||
items:
|
||||
- key: {{ .Values.smtp.existingMsmtprcSecretKey | default "msmtprc" }}
|
||||
path: msmtprc
|
||||
{{- else }}
|
||||
configMap:
|
||||
name: {{ include "phpfpm.fullname" . }}-smtp-config
|
||||
items:
|
||||
- key: msmtprc
|
||||
path: msmtprc
|
||||
{{- if .Values.smtp.auth.enabled }}
|
||||
{{- end }}
|
||||
{{- if and .Values.smtp.auth.enabled (not .Values.smtp.existingMsmtprcSecret) }}
|
||||
- name: smtp-secrets
|
||||
secret:
|
||||
secretName: {{ include "phpfpm.fullname" . }}-smtp
|
||||
secretName: {{ .Values.smtp.auth.existingSecret | default (printf "%s-smtp" (include "phpfpm.fullname" .)) }}
|
||||
items:
|
||||
- key: password
|
||||
- key: {{ .Values.smtp.auth.existingSecretKey | default "password" }}
|
||||
path: password
|
||||
# 0600だとSecretボリュームの所有者はroot、
|
||||
# msmtpはPHP-FPMワーカー(www-data等の非root)から実行されるため読めない
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if .Values.smtp.enabled }}
|
||||
{{- if and .Values.smtp.enabled (not .Values.smtp.existingMsmtprcSecret) (not .Values.smtp.auth.existingSecret) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
|
||||
Reference in New Issue
Block a user