k8s学习笔记-存活检测-httpget方式

こ雲淡風輕ζ 提交于 2020-03-17 01:15:27
apiVersion: v1
kind: Pod
metadata:
  name: liveness-httpget
  namespace: default

spec:
  containers:
  - name: liveness-httpget-container
    image: httpd
    imagePullPolicy: IfNotPresent
    ports:
    - name: http
      containerPort: 80

    livenessProbe:
      httpGet:
        port: http
        path: /index.html
      initialDelaySeconds: 1
      periodSeconds: 3
      timeoutSeconds: 10

检测是否存在/index.html文件,有则正常,没有则重启pod

k8s学习笔记-存活检测-httpget方式

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!