apiVersion: apps/v1
kind: Deployment
metadata:
  name: user-profile
  labels:
    app: user-profile
spec:
  replicas: 1
  selector:
    matchLabels:
      app: user-profile
  template:
    metadata:
      labels:
        app: user-profile
    spec:
      containers:
      - name: user-profile
        image: registryacs2871.azurecr.io/tripinsights/userprofile:1.0
        ports:
        - containerPort: 80
          name: user-profile
        resources:
          requests:
            cpu: 250m
            memory: 64Mi
          limits:
            cpu: 500m
            memory: 256Mi
        volumeMounts:
        - name: secrets-store-inline
          mountPath: "/secrets"
          readOnly: true
        env:
          - name: SQL_USER
            valueFrom:
              secretKeyRef:
                name: tripinisghtskv
                key: SQLUSER
          - name: SQL_PASSWORD
            valueFrom:
              secretKeyRef:
                name: tripinisghtskv
                key: SQLPASSWORD
          - name: SQL_SERVER
            valueFrom:
              secretKeyRef:
                name: tripinisghtskv
                key: SQLSERVER
          - name: SQL_DBNAME
            valueFrom:
              secretKeyRef:
                name: tripinisghtskv
                key: SQLDBNAME
      volumes:
        - name: secrets-store-inline
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: tripinisghtskv
