apiVersion: apps/v1
kind: Deployment
metadata:
  name: webserver-k8s
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 25%
  selector:
    matchLabels:
      app: webserver-k8s
  template:
    metadata:
      labels:
        app: webserver-k8s
    spec:
      containers:
      - name: nginx
        image: webserver_k8s:1.0
        ports:
        - containerPort: 80
        readinessProbe:
          httpGet:
            path: /
            port: 80
          initialDelaySeconds: 5
          timeoutSeconds: 1
          periodSeconds: 5
          successThreshold: 1
