# Starting point for the k8s-rollout task. It applies cleanly, but no pod ever becomes ready and the Service sends
# traffic nowhere. Find both faults from what the cluster tells you, fix them, and give the pods a /data directory
# on a PersistentVolumeClaim, so data written there outlives any single pod.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web
  labels:
    app: web
spec:
  replicas: 2
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
        - name: web
          image: nginx:1.27-alpine
          ports:
            - containerPort: 80
          readinessProbe:
            httpGet:
              path: /
              port: 8080
            periodSeconds: 3
---
apiVersion: v1
kind: Service
metadata:
  name: web
spec:
  selector:
    app: website
  ports:
    - port: 80
      targetPort: 80
