apiVersion: apps/v1
kind: Deployment
metadata:
  name: todoapp
spec:
  replicas: 3
  selector:
    matchLabels:
      app: todoapp
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 1
  progressDeadlineSeconds: 30
  template:
    metadata:
      labels:
        app: todoapp
        version: stable
    spec:
      containers:
      - name: todoapp
        image: polarsquad/todoapp-demo
        imagePullPolicy: IfNotPresent
        env:
        - name: REDIS_ADDRESS
          value: "redis:6379"
        - name: NOT_OK
          value: yup
        resources:
          requests:
            cpu: 100m
        ports:
        - containerPort: 8080
          name: todoapp
        livenessProbe:
          httpGet:
            path: /health
            port: todoapp
          initialDelaySeconds: 10
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /health
            port: todoapp
          initialDelaySeconds: 1
          periodSeconds: 10
