欢迎光临散文网 会员登陆 & 注册

老男孩教育linux81期-15k金牌企业级班级

2022-11-06 10:59 作者:抽抽一生恋  | 我要投稿

如下配置文件,使用 exec 的方式使用 cat /tmp/healthy 检查容器的存活性。

apiVersion: v1kind: Podmetadata:  name: exec-healthyspec:  containers:    - name: nginx      image: 172.16.156.128:5000/nginx:1.13      ports:        - containerPort: 80      args: # 执行命令,先创建文件,隔 30s 后删除文件。        - /bin/bash        - -c        - touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 60      livenessProbe:        exec:          command:            - cat            - /tmp/healthy        initialDelaySeconds: 5 # 健康检查的初始间隔        periodSeconds: 5 # 每 5s 检查一次


老男孩教育linux81期-15k金牌企业级班级的评论 (共 条)

分享到微博请遵守国家法律