apiVersion: apps/v1                            # defines the API version we use
kind: Deployment                               # type of config object
metadata:
  name: userprofile                # use a descriptive name
spec:
  selector:
    matchLabels:
      app: userprofile                   # this deployment will only 'look after' pods with this label
  replicas: 2                                  # tells deployment to run 2 pods matching the template
  template:                                    # create pods using pod definition in this template
    metadata:
      labels:
        app: userprofile                     # selector of deployment must match the label the pod. label are key-value pairs.
    spec:
      containers:                              # definition of the containers in the spec
      - image: registrybnk1575.azurecr.io/tripinsights/userprofile:1.0   # name of docker image you want to use
        name: userprofile
        imagePullPolicy: Always
        volumeMounts:
        - name: secrets-store01-inline
          mountPath: "/mnt/secrets-store"
          readOnly: true
        ports:
        - name: http
          protocol: TCP
          containerPort: 80        
      volumes:
        - name: secrets-store01-inline
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: "aks-cluster-spc"