#
# Frontend deployment.
#

kind: Deployment
apiVersion: apps/v1
metadata:
  name: frontend
  labels:
    app: frontend
spec:
  replicas: 2
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      imagePullSecrets:
      - name: acr-auth

      containers:
      - name: frontend-pods

        image: spylkkanen.azurecr.io/microservice-example-1/frontend:latest
        imagePullPolicy: Always
      
        ports:
        - containerPort: 3000

        env:       
        - name: SERVICE_API1_ENDPOINT
          value: /api
        - name: PORT
          value: "3000"

        livenessProbe:
          httpGet:
            path: /
            port: 3000
          initialDelaySeconds: 3
          periodSeconds: 1800

        # resources:
        #   requests:
        #     memory: "64M"
        #     cpu: 0.125