ERROR: The Pod "app" is invalid: spec.containers[0].livenessProbe.successThreshold: Invalid value: 3: must be 1
apiVersion: v1
kind: Pod
metadata:
name: 'app'
labels:
name: 'zs'
age: '18'
spec:
containers:
- name: 'probe-po'
image: nginx:1.14.2
livenessProbe:
httpGet:
path: /index.html
port: 80
initialDelaySeconds: 5
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 3
successThreshold: 1
这时 如果将 index.html 改成 index1.html
livenessProbe 采用 tcpSocket
apiVersion: v1
kind: Pod
metadata:
name: 'app'
labels:
name: 'zs'
age: '18'
spec:
containers:
- name: 'probe-po'
image: nginx:1.14.2
livenessProbe:
# httpGet:
# path: /index1.html
# port: 80
# initialDelaySeconds: 5
# periodSeconds: 5
# timeoutSeconds: 5
# failureThreshold: 3
# successThreshold: 1
tcpSocket:
port: 80
periodSeconds: 5
successThreshold: 1
failureThreshold: 3
livenessProbe 采用 exec
apiVersion: v1
kind: Pod
metadata:
name: 'app'
labels:
name: 'zs'
age: '18'
spec:
containers:
- name: 'probe-po'
image: nginx:1.14.2
livenessProbe:
# httpGet:
# path: /index1.html
# port: 80
# initialDelaySeconds: 5
# periodSeconds: 5
# timeoutSeconds: 5
# failureThreshold: 3
# successThreshold: 1
# tcpSocket:
# port: 89
# periodSeconds: 5
# successThreshold: 1
# failureThreshold: 3
exec:
command: ['cat', '/usr/share/nginx/html/index.html']
# - cat
# - /usr/share/nginx/html/index.html
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 3
periodSeconds: 3
改成 index1.html
配置 livenessProbe readinessProbe startupProbe
apiVersion: v1
kind: Pod
metadata:
name: 'app'
labels:
name: 'zs'
age: '18'
spec:
containers:
- name: 'probe-po'
image: nginx:1.14.2
livenessProbe:
# httpGet:
# path: /index1.html
# port: 80
# initialDelaySeconds: 5
# periodSeconds: 5
# timeoutSeconds: 5
# failureThreshold: 3
# successThreshold: 1
# tcpSocket:
# port: 89
# periodSeconds: 5
# successThreshold: 1
# failureThreshold: 3
exec:
command: ['cat', '/usr/share/nginx/html/index1.html']
# - cat
# - /usr/share/nginx/html/index.html
successThreshold: 1
failureThreshold: 3
timeoutSeconds: 3
periodSeconds: 3
readinessProbe:
httpGet:
path: /index.html
port: 80
failureThreshold: 3
successThreshold: 1
timeoutSeconds: 3
periodSeconds: 3
startupProbe:
httpGet:
path: /index.html
port: 80
failureThreshold: 3
successThreshold: 1
timeoutSeconds: 3
periodSeconds: 3