apiVersion: apps/v1
kind: Deployment
metadata:
  name: poi-deployment
  namespace: api
  labels:
    app: poi-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      app: poi
  template:
    metadata:
      labels:
        app: poi
    spec:
      containers:
        - name: poi
          image: registrylzk2091.azurecr.io/poi:1.0
          volumeMounts:
            - name: secret-vl
              mountPath: /secrets
              readOnly: true
          ports:
            - containerPort: 8080
          env:
            - name: ASPNETCORE_ENVIRONMENT
              value: Production
            - name: SQL_USER
              value: sqladminlZk2091
            - name: SQL_SERVER
              value: sqlserverlzk2091.database.windows.net
            - name: SQL_DBNAME
              value: mydrivingDB
      volumes:
        - name: secret-vl
          flexVolume:
            driver: "azure/kv"
            secretRef:
              name: kvcreds                             # [OPTIONAL] not required if using Pod Identity
            options:
              keyvaultname: "keyTeam2"              # [REQUIRED] the name of the KeyVault
              keyvaultobjectnames: "SQLPASSWORD"         # [REQUIRED] list of KeyVault object names (semi-colon separated)
              keyvaultobjectaliases: "SQL_PASSWORD"      # [OPTIONAL] list of KeyVault object aliases
              keyvaultobjecttypes: secret               # [REQUIRED] list of KeyVault object types: secret, key, cert (semi-colon separated)
              resourcegroup: "teamResources"        # [REQUIRED for version < v0.0.14] the resource group of the KeyVault
              subscriptionid: "19828a53-9e4d-43c0-921b-3e5b68c750c9"                 # [REQUIRED for version < v0.0.14] the subscription ID of the KeyVault
              tenantid: "1fa33f97-2a96-404d-a24c-d4b60e8629dd"                    # [REQUIRED] the tenant ID of the KeyVault
