apiVersion: apps/v1
kind: Deployment
metadata:
  name: voting-app-2-0
spec:
  replicas: 3
  selector:
    matchLabels:
      app: voting-app
      version: "2.0"
  template:
    metadata:
      labels:
        app: voting-app
        version: "2.0"
    spec:
      containers:
      - name: voting-app
        image: mcr.microsoft.com/aks/samples/voting/app:2.0
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
          name: http
        env:
        - name: SHOWDETAILS
          value: "true"
        - name: FEATUREFLAG
          value: "true"
        - name: MYSQL_HOST
          value: "voting-storage"
        - name: MYSQL_USER
          valueFrom:
            secretKeyRef:
              name: voting-storage-secret
              key: MYSQL_USER
        - name: MYSQL_PASSWORD
          valueFrom:
            secretKeyRef:
              name: voting-storage-secret
              key: MYSQL_PASSWORD
        - name: MYSQL_DATABASE
          valueFrom:
            secretKeyRef:
              name: voting-storage-secret
              key: MYSQL_DATABASE
        - name: ANALYTICS_HOST
          value: "voting-analytics"