apiVersion: apps/v1
kind: Deployment
metadata:
  name: trips-service-deployment
  namespace: api
  labels:
    app: trips-service
spec:
  replicas: 1
  selector:
    matchLabels:
      app: trips-service
  template:
    metadata:
      labels:
        app: trips-service
    spec:
      containers:
      - name: trips-service
        image: registryqjy5952.azurecr.io/trips:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        volumeMounts:
        - name: secrets-store01-inline
          mountPath: "/mnt/secrets-store"
          readOnly: true
        env:
          - name: SQL_USER
            value: sqladminqJy5952
          - name: SQL_PASSWORD
            valueFrom:
              secretKeyRef:
                name: sqlfromazure
                key: SQL_PASSWORD
          - name: SQL_SERVER
            value: sqlserverqjy5952.database.windows.net
          - name: SQL_DBNAME
            value: mydrivingDB
        resources:
          requests:
            cpu: 250m
            memory: 64Mi
          limits:
            cpu: 500m
            memory: 512Mi
      volumes:
      - name: secrets-store01-inline
        csi:
          driver: secrets-store.csi.k8s.io
          readOnly: true
          volumeAttributes:
            secretProviderClass: "azure-kvname-user-msi"