apiVersion: apps/v1
kind: Deployment
metadata:
  name: tripviewer-deployment
  labels:
    app: tripviewer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tripviewer
  template:
    metadata:
      labels:
        app: tripviewer
    spec:
      nodeSelector:
        "kubernetes.io/os": linux
      containers:
      - name: userprofile
        image: registrywxo9975.azurecr.io/tripinsights/tripviewer:latest
        env:
        - name: SQL_SERVER
          valueFrom:
            secretKeyRef:
              name: db-user-pass
              key: SQL_SERVER
        - name: SQL_USER
          valueFrom:
            secretKeyRef:
              name: db-user-pass
              key: SQL_USER
        - name: SQL_PASSWORD
          valueFrom:
            secretKeyRef:
              name: db-user-pass
              key: SQL_PASSWORD
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 250m
            memory: 256Mi
        ports:
        - containerPort: 80
          name: http