base: шаблоны MinIO в Vault читают и старый формат (access_key, client.endpoint, buckets), и v2 (access_key_id, endpoint, bucket); для старого формата вывод не меняется

This commit is contained in:
ivan 2026-11-12 15:38:09 +05:00
parent 2b707e9816
commit fabdce640c
6 changed files with 15 additions and 16 deletions

View File

@ -113,8 +113,8 @@ spec:
vault.hashicorp.com/agent-inject-template-attachments-s3: |-
{{- with secret "secrets/data/minio/apps/attachments" -}}
YANDEX_S3_ENDPOINT_URL=minio.minio:9000
YANDEX_S3_ACCESS_KEY_ID={{ index .Data.data "access_key" }}
YANDEX_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_key" }}
YANDEX_S3_ACCESS_KEY_ID={{ or (index .Data.data "access_key") (index .Data.data "access_key_id") }}
YANDEX_S3_SECRET_ACCESS_KEY={{ or (index .Data.data "secret_key") (index .Data.data "secret_access_key") }}
YANDEX_S3_USE_SSL=true
YANDEX_S3_REGION=ru-central
YANDEX_S3_VERIFY=false

View File

@ -159,10 +159,10 @@ spec:
vault.hashicorp.com/agent-inject-secret-eav-s3: secrets/data/minio/apps/eav
vault.hashicorp.com/agent-inject-template-eav-s3: |-
{{- with secret "secrets/data/minio/apps/eav" -}}
YC_S3_ENDPOINT_URL={{ index .Data.data.client "endpoint" }}
YC_S3_ENDPOINT_URL={{ with index .Data.data "client" }}{{ index . "endpoint" }}{{ else }}{{ index .Data.data "endpoint" }}{{ end }}
YC_S3_BUCKET_NAME=eav
YC_S3_ACCESS_KEY_ID={{ index .Data.data "access_key" }}
YC_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_key" }}
YC_S3_ACCESS_KEY_ID={{ or (index .Data.data "access_key") (index .Data.data "access_key_id") }}
YC_S3_SECRET_ACCESS_KEY={{ or (index .Data.data "secret_key") (index .Data.data "secret_access_key") }}
{{- end -}}
vault.hashicorp.com/agent-inject-secret-eav-jwt-private: secrets/data/vault/common/rsa_keys
vault.hashicorp.com/agent-inject-template-eav-jwt-private: |-

View File

@ -121,7 +121,7 @@ spec:
vault.hashicorp.com/agent-inject-secret-measurements-s3: secrets/data/minio/apps/measurements
vault.hashicorp.com/agent-inject-template-measurements-s3: |-
{{- with secret "secrets/data/minio/apps/measurements" -}}
S3_JSON_SETTINGS='{"host":"{{ index .Data.data.client "endpoint" }}","login":"{{ index .Data.data "access_key" }}","password":"{{ index .Data.data "secret_key" }}","verify":false,"buckets":["measurements"]}'
S3_JSON_SETTINGS='{"host":"{{ with index .Data.data "client" }}{{ index . "endpoint" }}{{ else }}{{ index .Data.data "endpoint" }}{{ end }}","login":"{{ or (index .Data.data "access_key") (index .Data.data "access_key_id") }}","password":"{{ or (index .Data.data "secret_key") (index .Data.data "secret_access_key") }}","verify":false,"buckets":["measurements"]}'
{{- end -}}
commitSha: ""

View File

@ -242,11 +242,10 @@ spec:
vault.hashicorp.com/agent-inject-secret-pm-s3: secrets/data/minio/apps/pm
vault.hashicorp.com/agent-inject-template-pm-s3: |-
{{- with secret "secrets/data/minio/apps/pm" -}}
S3_HOST={{ index .Data.data.client "endpoint" }}
S3_LOGIN={{ index .Data.data "access_key" }}
S3_PASSWORD={{ index .Data.data "secret_key" }}
{{- $buckets := index .Data.data "buckets" }}
S3_BUCKET={{- if gt (len $buckets) 0 -}}{{ index (index $buckets 0) "name" }}{{- else -}}sarex-media-storage{{- end -}}
S3_HOST={{ with index .Data.data "client" }}{{ index . "endpoint" }}{{ else }}{{ index .Data.data "endpoint" }}{{ end }}
S3_LOGIN={{ or (index .Data.data "access_key") (index .Data.data "access_key_id") }}
S3_PASSWORD={{ or (index .Data.data "secret_key") (index .Data.data "secret_access_key") }}
S3_BUCKET={{- with index .Data.data "buckets" -}}{{ index (index . 0) "name" }}{{- else -}}{{ or (index .Data.data "bucket") "sarex-media-storage" }}{{- end -}}
S3_VERIFY=False
{{- end -}}

View File

@ -33,10 +33,10 @@ spec:
vault.hashicorp.com/agent-inject-secret-resources-s3: secrets/data/minio/apps/resources
vault.hashicorp.com/agent-inject-template-resources-s3: |-
{{- with secret "secrets/data/minio/apps/resources" -}}
YC_S3_ENDPOINT_URL={{ index .Data.data.client "endpoint" }}
YC_S3_ENDPOINT_URL={{ with index .Data.data "client" }}{{ index . "endpoint" }}{{ else }}{{ index .Data.data "endpoint" }}{{ end }}
YC_S3_BUCKET_NAME=resources
YC_S3_ACCESS_KEY_ID={{ index .Data.data "access_key" }}
YC_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_key" }}
YC_S3_ACCESS_KEY_ID={{ or (index .Data.data "access_key") (index .Data.data "access_key_id") }}
YC_S3_SECRET_ACCESS_KEY={{ or (index .Data.data "secret_key") (index .Data.data "secret_access_key") }}
{{- end -}}
spec:
serviceAccountName: resources-vault

View File

@ -34,8 +34,8 @@ spec:
vault.hashicorp.com/agent-inject-secret-subscriptions-minio: secrets/data/minio/apps/subscriptions
vault.hashicorp.com/agent-inject-template-subscriptions-minio: |-
{{- with secret "secrets/data/minio/apps/subscriptions" -}}
YC_S3_ACCESS_KEY_ID={{ index .Data.data "access_key" }}
YC_S3_SECRET_ACCESS_KEY={{ index .Data.data "secret_key" }}
YC_S3_ACCESS_KEY_ID={{ or (index .Data.data "access_key") (index .Data.data "access_key_id") }}
YC_S3_SECRET_ACCESS_KEY={{ or (index .Data.data "secret_key") (index .Data.data "secret_access_key") }}
YC_S3_BUCKET_NAME=subscriptions
YC_S3_ENDPOINT_URL=https://minio.contour.infra.sarex.tech
{{- end -}}