K8s Lab 把当前仓库文档整理成一个可阅读的网页站点

Repository Reading Site

11-probe-good-deployment.yaml

manifests/10-reliability/11-probe-good-deployment.yaml

Text Assetmanifests/10-reliability/11-probe-good-deployment.yaml1.3 KB2026年4月10日 03:15查看原始内容
apiVersion: apps/v1
kind: Deployment
metadata:
  name: probe-good
  namespace: reliability-lab
  labels:
    lesson: reliability
    app: probe-good
spec:
  replicas: 1
  selector:
    matchLabels:
      lesson: reliability
      app: probe-good
  template:
    metadata:
      labels:
        lesson: reliability
        app: probe-good
    spec:
      containers:
      - name: app
        image: busybox:1.36
        imagePullPolicy: IfNotPresent
        command:
        - sh
        - -c
        - |
          mkdir -p /www
          printf 'booting with startupProbe\n' > /www/index.html
          sleep 25
          printf 'ok\n' > /www/startup
          printf 'ok\n' > /www/ready
          printf 'ok\n' > /www/live
          exec httpd -f -p 8080 -h /www
        ports:
        - name: http
          containerPort: 8080
        startupProbe:
          httpGet:
            path: /startup
            port: http
          periodSeconds: 5
          failureThreshold: 8
        livenessProbe:
          httpGet:
            path: /live
            port: http
          periodSeconds: 5
          failureThreshold: 2
        readinessProbe:
          httpGet:
            path: /ready
            port: http
          periodSeconds: 5
          failureThreshold: 1
        resources:
          requests:
            cpu: 10m
            memory: 32Mi