apiVersion: v1
kind: Pod
metadata:
  name: web
  labels:
    app: web
spec:
  volumes:
  - name: app
    emptyDir: {}
  initContainers:
  - name: init-web
    image: busybox:latest
    command: ['sh', '-c', 'wget -O- https://tinyurl.com/otus-k8s-intro | sh']
    volumeMounts:
    - name: app
      mountPath: /app
  containers:
  - name: web
    image: sergetol/nginx:1.20.2-alpine
    ports:
    - containerPort: 8000
    livenessProbe:
      initialDelaySeconds: 10
      periodSeconds: 5
      timeoutSeconds: 5
      successThreshold: 1
      failureThreshold: 3
      tcpSocket:
        port: 8000
    readinessProbe:
      initialDelaySeconds: 1
      periodSeconds: 5
      timeoutSeconds: 5
      successThreshold: 1
      failureThreshold: 3
      httpGet:
        port: 8000
        path: /index.html
    volumeMounts:
    - name: app
      mountPath: /app
