apiVersion: apps/v1
kind: Deployment
metadata:
  name: k8s-deployment
  labels:
    app: k8s
  namespace: production
spec:
  replicas: 5
  selector:
    matchLabels:
      app: k8s
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 2
  template:
    metadata:
      labels:
        app: k8s
    spec:
      containers:
      - name: k8s
        image: ozgurozturknet/k8s:v1
        ports:
        - containerPort: 80
        livenessProbe:
          httpGet:
            path: /healthcheck
            port: 80
          initialDelaySeconds: 5
          periodSeconds: 5
        readinessProbe:
          httpGet:
            path: /ready
            port: 80
          initialDelaySeconds: 20
          periodSeconds: 3
      nodeSelector:
        tier: production
      tolerations:
      - key: "tier"
        operator: "Equal"
        value: "production"
        effect: "NoSchedule"