标签:service 参数 googl val bin 默认 proxy 服务发现 组成
readinessProbe主要探测服务是否就绪,如果你的应用的readinessProbe运行失败,那么就会从组成service的端点中删除,这样就不会有流量通过Kubernetes服务发现机制来发送给它
livenessProbe探测服务是否可,不可用时重启pod
参数
官方文档: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
spec: containers: - name: liveness args: - /server image: gcr.io/google_containers/liveness readinessProbe: httpGet: path: /healthz port: 8080 httpHeaders: - name: X-Custom-Header value: Awesome initialDelaySeconds: 20 periodSeconds: 10 timeouteSeconds: 1 livenessProbe: httpGet: path: /healthz port: 8080 httpHeaders: - name: X-Custom-Header value: Awesome initialDelaySeconds: 20 periodSeconds: 10 timeouteSeconds: 1
tcp 端口
spec: containers: - name: goproxy image: gcr.io/google_containers/goproxy:0.1 ports: - containerPort: 8080 readinessProbe: tcpSocket: port: 8080 initialDelaySeconds: 20 periodSeconds: 10 timeoutSeconds: 1 livenessProbe: tcpSocket: port: 8080 initialDelaySeconds: 20 periodSeconds: 10 timeoutSeconds: 1
spec: containers: - name: liveness args: - /bin/sh - -c - touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600 image: gcr.io/google_containers/busybox livenessProbe: exec: command: - cat - /tmp/healthy initialDelaySeconds: 5 periodSeconds: 5
标签:service 参数 googl val bin 默认 proxy 服务发现 组成
原文地址:https://www.cnblogs.com/mabiao008/p/12247113.html