8-1 Kubernetes 的卷 Volume:
emptyDir:
Pod因为某些原因被从节点上删除时,emptyDir卷中的数据也会永久删除
[root@master ~]# kubectl create -f empty_dir.yaml
pod/nginx-20210401 created
[root@master ~]# cat empty_dir.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-20210401
spec:
containers:
- name: nginx-20210401
image: registry.cn-beijing.aliyuncs.com/qingfeng666/nginx:latest
command: ["/bin/sh","-c","sleep 3600"]
volumeMounts:
- mountPath: /usr/local/apache-tomcat-8.5.11/webapps
name: app-volume
ports:
- containerPort: 8001
volumes:
- name: app-volume