1、镜像拉取
[ root@master ~]
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: nginx
image: nginx:1.14
imagePullPolicy: Always
2、资源限制
[ root@master example]
apiVersion: v1
kind: Pod
metadata:
name: frontend
spec:
containers:
- name: db
image: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: "password"
resources:
requests:
memory: "64Mi"
cpu: "250m"
limit:
memory: "128Mi"
cpu: "500m"
spec.containers[ ] .resources.request.cpu或memory等
spec.containers[ ] .resources.limit.cpu或memory等
3、重启机制
[ root@master example]
apiVersion: v1
kind: Pod
metadata:
name: dns-test
spec:
containers:
- name: busybox
image: busybox:1.28.4
args:
- /bin/sh
- -c
- sleep 36000
restartPolicy: Nerver