apiVersion: apps/v1
kind: Deployment
metadata:
  name: userprofile-api
  namespace: api
spec:
  selector:
    matchLabels:
      app: userprofile-api
  template:
    metadata:
      labels:
        app: userprofile-api # the label for the pods and the deployments
    spec:
      containers:
      - name: userprofile-api
        image: registryudo2566.azurecr.io/tripinsights/userprofile:1.0 # IMPORTANT: update with your own repository
        imagePullPolicy: Always
        ports:
        - containerPort: 80 # the application listens to this port
        resources:
          requests: # minimum resources required
            cpu: 250m
            memory: 64Mi
          limits: # maximum resources allocated
            cpu: 1000m #1000m is one full core
            memory: 256Mi
        volumeMounts:
        - name: secrets-store01-inline
          mountPath: "/secrets"
          readOnly: true
      volumes:
        - name: secrets-store01-inline
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: "azure-kvname-user-msi"                      
        # readinessProbe: # is the container ready to receive traffic?
        #   httpGet:
        #     port: 80
        #     path: /api/user/healthcheck
        # livenessProbe: # is the container healthy?
        #   httpGet:
        #     port: 80
        #     path: /api/user/healthcheck