4. Observability (18%)
Defining a Pod’s Readiness and Liveness Probe
$ kubectl run hello --image=bonomat/nodejs-hello-world --restart=Never --port=3000 -o yaml --dry-run > pod.yamlapiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: hello
name: hello
spec:
containers:
- image: bonomat/nodejs-hello-world
name: hello
ports:
- name: nodejs-port
containerPort: 3000
readinessProbe:
httpGet:
path: /
port: nodejs-port
initialDelaySeconds: 2
livenessProbe:
httpGet:
path: /
port: nodejs-port
initialDelaySeconds: 5
periodSeconds: 8
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Never
status: {}Fixing a Misconfigured Pod
最后更新于