[root@k8s-n0 busybox]# cat deploy.yaml 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: busybox
  namespace: dmgeo-lib
spec:
  replicas: 1
  selector:
    matchLabels:
      app: busybox
  template:
    metadata:
      labels:
        app: busybox
    spec:
      containers:
      - name: busybox
        image: busybox        #内置的linux大多数命令,多用于测试
        args:
        - /bin/sh
        - -c
        - sleep 10; touch /tmp/healthy; sleep 30000
        readinessProbe:           #就绪探针
          exec:
            command:
            - cat
            - /tmp/healthy
          initialDelaySeconds: 10         #10s之后开始第一次探测
          periodSeconds: 5                #第一次探测之后每隔5s探测一次
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐