apiVersion: apps/v1
kind: Deployment
metadata:
  name: tripviewer-deployment
spec:
  selector:
    matchLabels:
      app: tripviewer
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  template:
    metadata:
      labels:
        app: tripviewer
    spec:
      containers:
      - name: tripviewer
        image: registrykna5332.azurecr.io/tripinsights/tripviewer:v1.0
        imagePullPolicy: Always
        ports:
        - containerPort: 80
        env:
          - name: TRIPS_API_ENDPOINT
            valueFrom:
              configMapKeyRef:
                name: tripviewer-config
                key: TRIPS_API_ENDPOINT
          - name: USERPROFILE_API_ENDPOINT
            valueFrom:
              configMapKeyRef:
                name: tripviewer-config
                key: USERPROFILE_API_ENDPOINT