---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: "web-canary"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: "web-canary"
  template:
    metadata:
      labels:
        app: "web-canary"
    spec:
      containers:
      - name: "web"
        image: "antik9/k8s-otus-web:0.1"
        readinessProbe:
          httpGet:
            path: /index.html
            port: 8000
        volumeMounts:
        - name: app
          mountPath: /app
      initContainers:
      - name: "init"
        image: "busybox:1.31.0"
        command: ["sh", "-c", "echo '<body>Hello, World!</body>' > /app/index.html"]
        volumeMounts:
        - name: app
          mountPath: /app
      volumes:
      - name: app
        emptyDir: {}
