apiVersion: apps/v1
kind: Deployment
metadata:
  name: trips-deployment
  labels:
    app: trips
spec:
  replicas: 1
  selector:
    matchLabels:
      app: trips
  template:
    metadata:
      labels:
        app: trips
    spec:
      nodeSelector:
        "kubernetes.io/os": linux
      containers:
      - name: trips
        image: registrywxo9975.azurecr.io/tripinsights/trips:latest
        env:
        - 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
        - name: SQL_SERVER
          valueFrom:
            secretKeyRef:
              name: db-user-pass-kv
              key: SQL_SERVER
        volumeMounts:
        - name: secrets-store-inline
          mountPath: "/mnt/secrets-store"
          readOnly: true  
        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"