apiVersion: apps/v1
kind: Deployment
metadata:
  name: trips
  namespace: api
spec:
  selector:
    matchLabels:
      run: trips
  replicas: 1
  template:
    metadata:
      labels:
        run: trips
    spec:
      containers:
      - name: trips
        image: registryrdz2161.azurecr.io/trips:1.0
        ports:
        - containerPort: 80
        env:
        - name: SQL_SERVER
          value: sqlserverrdz2161.database.windows.net
        - name: SQL_DBNAME
          value: mydrivingDB
        - name: OPENAPI_DOCS_URI
          value: http://changeme
        volumeMounts:
        - name: secrets-store-inline
          mountPath: "/secrets"
          readOnly: true
      volumes:
        - name: secrets-store-inline
          csi:
            driver: secrets-store.csi.k8s.io
            readOnly: true
            volumeAttributes:
              secretProviderClass: "sql-creds"
            nodePublishSecretRef:                       # Only required when using service principal mode
              name: secrets-store-creds                 # Only required when using service principal mode
