apiVersion: apps/v1
kind: Deployment
metadata:
  name: azure-vote-front
spec:
  replicas: 1
  selector:
    matchLabels:
      app: azure-vote-front
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: azure-vote-front
    spec:
      containers:
      - name: azure-vote-front
        image: akirainaks.azurecr.io/azure-vote-front:latest
        ports:
        - containerPort: 80
        resources:
          requests:
            cpu: 100m
          limits:
            cpu: 500m
        imagePullPolicy: Always
        env:
        - name: MYSQL_USER
          valueFrom:
            secretKeyRef:
              name: azure-vote
              key: MYSQL_USER
        - name: MYSQL_PASSWORD
          valueFrom:
            secretKeyRef:
              name: azure-vote
              key: MYSQL_PASSWORD
        - name: MYSQL_DATABASE
          valueFrom:
            secretKeyRef:
              name: azure-vote
              key: MYSQL_DATABASE
        - name: MYSQL_HOST
          valueFrom:
            secretKeyRef:
              name: azure-vote
              key: MYSQL_HOST
