apiVersion: apps/v1
kind: Deployment
metadata:
  name: m05
  namespace: kv-lab
  labels:
    lab: m05
spec:
  replicas: 2
  selector:
    matchLabels:
      app: m05
  template:
    metadata:
      labels:
        app: m05
        lab: m05
    spec:
      containers:
        - name: web
          image: nginx:1.28.0-alpine
          ports:
            - containerPort: 80
          resources:
            requests:
              cpu: 10m
              memory: 16Mi
            limits:
              cpu: 250m
              memory: 64Mi
          command:
            - sh
            - -c
            - touch /tmp/ready; exec nginx -g "daemon off;"
          readinessProbe:
            exec:
              command:
                - test
                - -f
                - /tmp/ready
            periodSeconds: 2
            failureThreshold: 1
          livenessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
  name: m05
  namespace: kv-lab
  labels:
    lab: m05
spec:
  selector:
    app: m05
  ports:
    - port: 80
      targetPort: 80
