apiVersion: apps/v1
kind: Deployment
metadata:
  name: poi-deployment
spec:
  selector:
    matchLabels:
      app: poi
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app: poi
    spec:
      containers:
      - name: poi
        image: registrykna5332.azurecr.io/tripinsights/poi-az:v1.0
        imagePullPolicy: Always
        volumeMounts:
          - name: secrets-kv
            mountPath: "/secrets"
            readOnly: true
        ports:
        - containerPort: 80
        env:
          - name: WEB_PORT
            valueFrom:
              configMapKeyRef:
                name: poi-config
                key: WEB_PORT
          - name: WEB_SERVER_BASE_URI
            valueFrom:
              configMapKeyRef:
                key: WEB_SERVER_BASE_URI
                name: poi-config
          - name: ASPNETCORE_ENVIRONMENT
            valueFrom:
              configMapKeyRef:
                key: ASPNETCORE_ENVIRONMENT
                name: poi-config
          - name: CONFIG_FILES_PATH
            valueFrom:
              configMapKeyRef:
                key: CONFIG_FILES_PATH
                name: poi-config
      volumes:
        - name: secrets-kv
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: azure-kvname
            nodePublishSecretRef:
              name: secrets-store-creds
        