apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization # Project-specific values use the __GCP_PROJECT__ placeholder: run `make gcp-configure PROJECT=` # once and commit. Image tags are then bumped by .github/workflows/deploy.yml after each green CI. # Generated ConfigMaps must share the Deployments' namespace, or their hashed names are not # propagated to envFrom references. namespace: rarelens resources: [../../base, ../../../argo-workflows] configurations: [kustomizeconfig.yaml] images: - { name: rarelens/api, newName: europe-west2-docker.pkg.dev/__GCP_PROJECT__/rarelens/api, newTag: latest } - { name: rarelens/web, newName: europe-west2-docker.pkg.dev/__GCP_PROJECT__/rarelens/web, newTag: latest } - { name: rarelens/pipeline, newName: europe-west2-docker.pkg.dev/__GCP_PROJECT__/rarelens/pipeline, newTag: latest } - { name: rarelens/loader, newName: europe-west2-docker.pkg.dev/__GCP_PROJECT__/rarelens/loader, newTag: latest } configMapGenerator: - name: api-config literals: [PUBSUB_TOPIC=vcf-uploaded, GCP_PROJECT=__GCP_PROJECT__] - name: pipeline-config # Referenced by name from the Argo WorkflowTemplate, which kustomize does not rewrite. options: { disableNameSuffixHash: true } literals: [GCP_PROJECT=__GCP_PROJECT__, GCP_REGION=europe-west2, GCS_BUCKET=__GCP_PROJECT__-rarelens-data] # api-secrets and pipeline-secrets come from Secret Manager: `make gcp-secrets PROJECT=`. patches: - target: { kind: ServiceAccount, name: rarelens-api } patch: | - op: add path: /metadata/annotations value: { iam.gke.io/gcp-service-account: rarelens-api@__GCP_PROJECT__.iam.gserviceaccount.com } - target: { kind: ServiceAccount, name: rarelens-pipeline } patch: | - op: add path: /metadata/annotations value: { iam.gke.io/gcp-service-account: rarelens-pipeline@__GCP_PROJECT__.iam.gserviceaccount.com } - target: { kind: Deployment, name: api } patch: | - op: add path: /spec/template/spec/initContainers/0 value: name: cloud-sql-proxy image: gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.13.0 # Native sidecar: starts (and passes its startup probe) before the migrate init # container, then keeps running alongside the API. restartPolicy: Always args: - --structured-logs - --private-ip - --port=5432 - --health-check - --http-address=0.0.0.0 - __GCP_PROJECT__:europe-west2:rarelens-pg startupProbe: { httpGet: { path: /startup, port: 9090 }, periodSeconds: 1, failureThreshold: 60 } securityContext: { runAsNonRoot: true, allowPrivilegeEscalation: false } resources: { requests: { cpu: 100m, memory: 128Mi }, limits: { cpu: 500m, memory: 256Mi } }