apiVersion: apps/v1
kind: Deployment
metadata:
  name: poi-api
  namespace: api-dev
spec:
  replicas: 1
  selector:
    matchLabels:
      app: poi-api
  template:
    metadata:
      labels:
        app: poi-api
    spec:
      containers:
      - name: poi-api
        image: registryula5418.azurecr.io/tripinsights/poi:1.0
        env:
          - name: ASPNETCORE_ENVIRONMENT
            value: "Development"
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 250m
            memory: 256Mi
        volumeMounts:
        - name: sqlserver
          mountPath: "/secrets"
          readOnly: true
        ports:
        - containerPort: 8080
      volumes:
        - name: sqlserver
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: "azure-kvname"
            nodePublishSecretRef:                       # Only required when using service principal mode
              name: secrets-store-creds                 # Only required when using service principal mode. The name of the Kubernetes secret that contains the service principal credentials to access keyvault.
