apiVersion: v1
kind: Pod
metadata:
  name: web
  labels:
    run: otus-k8s-web
spec:
  containers:
    - name: otus-k8s-web
      image: sergeykudelin/otus-k8s-web:alpine
      readinessProbe:
        httpGet:
          path: /index.html
          port: 80
      livenessProbe:
        tcpSocket:
          port: 8000
      ports:
        - containerPort: 8000
      volumeMounts:
        - name: otus-k8s-web-volume
          mountPath: /app
      resources:
        limits:
          cpu: "1"
          memory: "250Mi"
  initContainers:
    - name: init
      image: busybox:1.32.0
      command: ['sh', '-c', 'wget -O- https://tinyurl.com/otus-k8s-intro | sh']
      volumeMounts:
        - name: otus-k8s-web-volume
          mountPath: /app
  volumes:
    - name: otus-k8s-web-volume
      emptyDir: {}