apiVersion: apps/v1
kind: Deployment
metadata: 
  name: web
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 20%
      maxSurge: 100%
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: web # Название контейнера
        image: israodin/otus_kube:v0.0.1-intro # Образ из которого создается контейнер
        #--------BEGIN-------
        livenessProbe:
          tcpSocket: 
            port: 8000
        readinessProbe:
          httpGet:
            path: /index.html
            port: 8000
        # ------- END -----
        volumeMounts:
        - name: app
          mountPath: /app    
      initContainers:
      - name: init-web
        image: busybox:1.31.1
        command: ['sh', '-c', 'wget -O- https://tinyurl.com/otus-k8s-intro | sh']
        volumeMounts:
        - name: app
          mountPath: /app  
      volumes:
      - name: app
        emptyDir: {}