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:
@@ -196,9 +196,29 @@ PHPからPythonスクリプトを呼び出す用途(データ処理・機械
|
||||
| パラメータ | 説明 | デフォルト |
|
||||
|-----------|------|-----------|
|
||||
| `phpEnv` | PHP-FPM コンテナに渡す任意の環境変数(キーと値のマップ) | `{}` |
|
||||
| `extraEnvFrom` | 既存の Secret / ConfigMap をまるごと環境変数として注入(`envFrom` 配列) | `[]` |
|
||||
| `extraEnv` | 個別の環境変数を追加(生の `env` エントリ配列。`valueFrom`/`secretKeyRef` 可) | `[]` |
|
||||
|
||||
PHP 側では `$_ENV['KEY']` または `getenv('KEY')` で取得できます。
|
||||
|
||||
`extraEnvFrom` は、別リポジトリの **secret-manager** チャートが各ネームスペースへ配布する
|
||||
`cred-<名前>` Secret(API キー等)をそのまま読み込む用途を想定しています。認証情報の変更は
|
||||
secret-manager 側を更新するだけで全プロジェクトに反映できます。
|
||||
|
||||
```yaml
|
||||
extraEnvFrom:
|
||||
- secretRef:
|
||||
name: cred-gemini # GEMINI_API_KEY 等が丸ごと環境変数になる
|
||||
- secretRef:
|
||||
name: cred-openai
|
||||
extraEnv:
|
||||
- name: ANTHROPIC_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: cred-claude
|
||||
key: ANTHROPIC_API_KEY
|
||||
```
|
||||
|
||||
### SMTP設定
|
||||
|
||||
| パラメータ | 説明 | デフォルト |
|
||||
@@ -210,10 +230,39 @@ PHP 側では `$_ENV['KEY']` または `getenv('KEY')` で取得できます。
|
||||
| `smtp.auth.enabled` | 認証有効化 | `true` |
|
||||
| `smtp.auth.username` | SMTPユーザー名 | `smtp-user@example.com` |
|
||||
| `smtp.auth.password` | SMTPパスワード | `""` (Secretで指定) |
|
||||
| `smtp.auth.existingSecret` | パスワードを取得する既存 Secret 名(`smtp.auth.password` と自作 Secret の代わり) | `""` |
|
||||
| `smtp.auth.existingSecretKey` | 上記 Secret 内のキー名 | `password` |
|
||||
| `smtp.existingMsmtprcSecret` | 完成済み `msmtprc` を持つ既存 Secret 名。指定時はチャートの msmtprc 生成を行わず host/port/auth.* は無視(`from` のみ使用) | `""` |
|
||||
| `smtp.existingMsmtprcSecretKey` | 上記 Secret 内の `msmtprc` キー名 | `msmtprc` |
|
||||
| `smtp.from` | 送信元メールアドレス(固定) | `noreply@example.com` |
|
||||
| `smtp.tls.verify` | TLS証明書検証 | `true` |
|
||||
| `smtp.tls.allowSelfSigned` | 自己署名証明書を許可 | `false` |
|
||||
|
||||
#### secret-manager チャートとの連携(メール設定の一元管理)
|
||||
|
||||
**secret-manager** が `cred-gmail` などに生成する完成済み `msmtprc` をそのまま使う場合:
|
||||
|
||||
```yaml
|
||||
smtp:
|
||||
enabled: true
|
||||
from: "no-reply@your-domain.com" # PHP の sendmail_from 用に必要
|
||||
existingMsmtprcSecret: "cred-gmail" # このSecretの msmtprc キーをそのまま利用
|
||||
```
|
||||
|
||||
サーバ設定はチャート側 values に残し、パスワードだけ一元管理したい場合:
|
||||
|
||||
```yaml
|
||||
smtp:
|
||||
enabled: true
|
||||
host: "smtp.gmail.com"
|
||||
port: 587
|
||||
auth:
|
||||
enabled: true
|
||||
username: "no-reply@your-domain.com"
|
||||
existingSecret: "cred-gmail"
|
||||
existingSecretKey: "SMTP_PASSWORD"
|
||||
```
|
||||
|
||||
### Ingress設定
|
||||
|
||||
| パラメータ | 説明 | デフォルト |
|
||||
|
||||
Reference in New Issue
Block a user