140 lines
4.8 KiB
YAML
140 lines
4.8 KiB
YAML
apiVersion: helm.toolkit.fluxcd.io/v2
|
|
kind: HelmRelease
|
|
metadata:
|
|
name: iam-backend
|
|
namespace: iam
|
|
spec:
|
|
values:
|
|
services:
|
|
backend:
|
|
image:
|
|
name:
|
|
_default: cr.yandex/crp3ccidau046kdj8g9q/iams:contour_d5c05e7e
|
|
deployment:
|
|
args:
|
|
_default:
|
|
- 'set -a
|
|
|
|
[ -f /vault/secrets/iam-db ] && . /vault/secrets/iam-db
|
|
|
|
[ -f /vault/secrets/iam-zitadel ] && . /vault/secrets/iam-zitadel
|
|
|
|
[ -f /vault/secrets/iam-kafka ] && . /vault/secrets/iam-kafka
|
|
|
|
[ -f /vault/secrets/iam-s3 ] && . /vault/secrets/iam-s3
|
|
|
|
[ -f /vault/secrets/iam-spicedb ] && . /vault/secrets/iam-spicedb
|
|
|
|
set +a
|
|
|
|
exec ./server
|
|
|
|
'
|
|
strategy:
|
|
type: RollingUpdate
|
|
rollingUpdate:
|
|
maxUnavailable: 0
|
|
maxSurge: 1
|
|
probes:
|
|
readiness:
|
|
enabled: true
|
|
httpGet:
|
|
path:
|
|
_default: /api/health
|
|
port:
|
|
_default: 8080
|
|
periodSeconds:
|
|
_default: 5
|
|
timeoutSeconds:
|
|
_default: 3
|
|
envs:
|
|
- name: ENVIRONMENT
|
|
value:
|
|
_default: prod
|
|
- name: LOG_LEVEL
|
|
value:
|
|
_default: debug
|
|
- name: AUTH_ENABLED
|
|
value:
|
|
_default: 'true'
|
|
- name: HTTP_PORT
|
|
value:
|
|
_default: '8080'
|
|
- name: HTTP_READ_BUFFER_SIZE
|
|
value:
|
|
_default: '131072'
|
|
- name: DB_MIGRATIONS_PATH
|
|
value:
|
|
_default: migrations
|
|
- name: ZITADEL_ENABLED
|
|
value:
|
|
_default: 'true'
|
|
- name: ZITADEL_HOST
|
|
value:
|
|
_default: https://${HOST_LOGIN}
|
|
- name: ZITADEL_ORG_RULES_FILE
|
|
value:
|
|
_default: config/zitadel/org-rules-prod.json
|
|
- name: S3_ENABLED
|
|
value:
|
|
_default: 'true'
|
|
- name: S3_ENDPOINT_URL
|
|
value:
|
|
_default: http://${MINIO_ENDPOINT}
|
|
- name: S3_BUCKET_NAME
|
|
value:
|
|
_default: django
|
|
- name: S3_REGION
|
|
value:
|
|
_default: ru-central1
|
|
- name: S3_PRESIGN_EXPIRES
|
|
value:
|
|
_default: 1h
|
|
- name: KAFKA_ENABLED
|
|
value:
|
|
_default: 'false'
|
|
- name: KAFKA_SSL_CAFILE
|
|
value:
|
|
_default: /etc/ca-certificates/Yandex/ca-cert
|
|
- name: KAFKA_TOPIC_LEGACY_AMS_SYNC
|
|
value:
|
|
_default: ams-sync
|
|
- name: SPICEDB_ENDPOINT
|
|
value:
|
|
_default: spicedb.spicedb.svc.cluster.local:50051
|
|
- name: SPICEDB_INSECURE
|
|
value:
|
|
_default: 'true'
|
|
podAnnotations:
|
|
_default:
|
|
vault.hashicorp.com/agent-inject-secret-iam-spicedb: secrets/data/apps/spicedb/auth
|
|
vault.hashicorp.com/agent-inject-template-iam-spicedb: '{{- with secret
|
|
"secrets/data/apps/spicedb/auth" -}}
|
|
|
|
SPICEDB_TOKEN=''{{ index .Data.data "preshared_key" }}''
|
|
|
|
{{- end -}}'
|
|
traffic.sidecar.istio.io/excludeOutboundPorts: 4317,4318,9411,8200,8443,50051
|
|
postRenderers:
|
|
- kustomize:
|
|
patches:
|
|
- target:
|
|
kind: Deployment
|
|
name: iam-backend
|
|
patch: "apiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: iam-backend\n\
|
|
spec:\n template:\n metadata:\n annotations:\n checksum/spicedb-schema:\
|
|
\ 72606779239bef9fe18170545d8fb3d70581581048aeea55a390d414197f1ce6\n \
|
|
\ spec:\n initContainers:\n - name: spicedb-schema\n image:\
|
|
\ cr.yandex/crp3ccidau046kdj8g9q/vault/vault:1.21.2\n command:\n\
|
|
\ - /bin/sh\n - -ec\n args:\n - \". /vault/secrets/iam-spicedb\\\
|
|
nfor attempt in $(seq 1 60); do\\n if wget\\\n \\ -qO /tmp/schema-result.json\
|
|
\ --header=\\\"Authorization: Bearer $SPICEDB_TOKEN\\\"\\\n \\\
|
|
\ --header=\\\"Content-Type: application/json\\\" --post-file=/schema/schema.json\\\
|
|
\n \\ http://spicedb.spicedb.svc.cluster.local:8443/v1/schema/write;\
|
|
\ then\\n\\\n \\ echo \\\"SpiceDB schema loaded\\\"\\n exit\
|
|
\ 0\\n fi\\n sleep 2\\ndone\\n\\\n exit 1\\n\"\n resources:\n\
|
|
\ requests:\n cpu: 25m\n memory: 32Mi\n \
|
|
\ volumeMounts:\n - name: spicedb-schema\n mountPath:\
|
|
\ /schema\n readOnly: true\n volumes:\n - name: spicedb-schema\n\
|
|
\ configMap:\n name: iam-spicedb-schema\n"
|