pod yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
spec:
restartPolicy: Always
containers:
- name: nginx-pod
image: nginx
关键字:restartPolicy
策略:
- Always
- pod中容器不论如何停止都将自动重启
- OnFailure
- Pod中容器非正常停止会自动重启,正常停止不会重启
- Never
- Pod中容器不论以任何方式停止,都不会自动重启