apiVersion: apps/v1
kind: Deployment
metadata:
  name: userprofile-deployment
  labels:
    app: userprofile
spec:
  replicas: 1
  selector:
    matchLabels:
      app: userprofile
  template:
    metadata:
      labels:
        app: userprofile
    spec:
      nodeSelector:
        "kubernetes.io/os": linux
      containers:
      - name: userprofile
        image: registrywxo9975.azurecr.io/tripinsights/userprofile:latest
        env:
        - name: SQL_SERVER
          valueFrom:
            secretKeyRef:
              name: db-user-pass-kv
              key: SQL_SERVER
        - name: SQL_USER
          valueFrom:
            secretKeyRef:
              name: db-user-pass-kv
              key: SQL_USER
        - name: SQL_PASSWORD
          valueFrom:
            secretKeyRef:
              name: db-user-pass-kv
              key: SQL_PASSWORD
        volumeMounts:
        - name: secrets-store-inline
          mountPath: "/mnt/secrets-store"
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 250m
            memory: 256Mi
        ports:
        - containerPort: 80
          name: http
      volumes:
        - name: secrets-store-inline
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: "openhackakv"