apiVersion: apps/v1
kind: Deployment
metadata:
    name: alpaca-prod
    labels:
        app: alpaca
        version: 1.0.0
        env: prod
spec:
    replicas: 3
    revisionHistoryLimit: 14
    strategy:
        type: RollingUpdate
        rollingUpdate:
            maxSurge: 25% # max number or percentage of extra resources (pods) during rollout
            maxUnavailable: 25% # max number or percentage of unavailable resources (pods) during rollout
    minReadySeconds: 30 # number of seconds to wait until a pod can be evaluated as ready or not
    progressDeadlineSeconds: 600 # timeout (in seconds) of rollout process
    selector:
        matchLabels:
            app: alpaca
    template:
        metadata:
            labels:
                app: alpaca
            annotations:
                kubernetes.io/change-cause: "Change revisionHistoryLimit"
        spec:
            containers:
                - image: gcr.io/kuar-demo/kuard-amd64:blue
                  imagePullPolicy: Always
                  name: alpaca-prod
                  ports:
                      - containerPort: 8080
                        name: http
                        protocol: TCP
                  readinessProbe:
                      httpGet:
                          path: /ready
                          port: 8080
                      periodSeconds: 2
                      initialDelaySeconds: 0
                      failureThreshold: 3
                      successThreshold: 1
