apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-app
  namespace: demo
spec:
  selector:
    matchLabels:
      app: demo-app
  replicas: 3
  template:
    metadata:
      labels:
        app: demo-app
      annotations:
        vault.security.banzaicloud.io/vault-addr: "http://vault.vault-infra:8200"
        vault.security.banzaicloud.io/vault-role: "demo"
    spec:
      serviceAccountName: app
      containers:
        - name: demo-app
          image: ghcr.io/anakaiti/dynamic-db-credentials-demo
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 3000
          env:
            - name: DB_CONN
              value: "vault:database/creds/app#host=postgres-db.demo.svc.cluster.local port=5432 user=${.username} dbname=postgres password=${.password} sslmode=disable"
            - name: PORT
              value: "3000"
          resources:
            limits:
              cpu: 100m
              memory: 128Mi
