初始情况
apiVersion: v1
kind: Service
metadata:
name: nginx
spec:
ports:
- port: 80
selector:
app: nginx
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: nginx
spec:
podManagementPolicy: Parallel
serviceName: nginx
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.9.1
创建ClusterIP类型的service和StatefulSet之后,Pod域名可以直接解析。
10.16.0.17是coredns IP。
场景一:只增加readinessProbe
readinessProbe:
httpGet:
scheme: HTTP
port: 80
initialDelaySeconds: 300
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
在readinessProbe检查成功之前,endpoint一直没有且Pod域名解析失败。
场景二:只增加livenessProbe
livenessProbe:
httpGet:
scheme: HTTP
port: 80
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
在livenessProbe检查成功之前,endpoint一直有且Pod域名解析成功。
场景三:只增加startupProbe
startupProbe:
httpGet:
scheme: HTTP
port: 80
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
在startupProbe检查成功之前,endpoint一直没有且Pod域名解析失败。
标签:livenessProbe,80,域名解析,nginx,Pod,sts,pod,port From: https://www.cnblogs.com/WJQ2017/p/17809296.html