apiVersion: apps/v1
kind: Deployment
metadata:
  name: secret-deployment

spec:
  replicas: 3
  selector:
    matchLabels:
      app: photo-view

  template:
    metadata:
      labels:
        app: photo-view
    spec:
      containers:
      - image: sampleguitarrapcacr.azurecr.io/photo-view:v1.0
        name: photoview-container 
        imagePullPolicy: Always  

        ports:
        - containerPort: 80

        env:
        - name: SECRET_ID
          valueFrom:
            secretKeyRef:
              name: api-key
              key: id
        - name: SECRET_KEY
          valueFrom:
            secretKeyRef:
              name: api-key
              key: key

        volumeMounts:
          - name: secrets-volume
            mountPath: /etc/secrets
            readOnly: true

      volumes:
        - name: secrets-volume
          secret:
            secretName: apl-auth
    