#我的新年Flag#hostPath存储

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了#我的新年Flag#hostPath存储相关的知识,希望对你有一定的参考价值。

hostPath Volume
hostPath Volume 是指Pod挂载主机上的目录文件。
hostPath Volume 使得容器可以使用宿主机的文件系统进行存储
参考文件
https://kubernetes.io/docs/concepts/storage/volumes#hostpath
实例Yaml
[root@k8smaster4 dir]# cat hostpath.yaml 
apiVersion: v1
kind: Pod
metadata:
name: test
spec:
containers:
- name: test-nginx
image: docker.io/xianchao/nginx:v1
imagePullPolicy: IfNotPresent
volumeMounts:
- name: test-hostpath
mountPath: /usr/local/nginx/html/
- name: test-tomcat
image: docker.io/xianchao/tomcat-8.5-jre8:v1
imagePullPolicy: IfNotPresent
volumeMounts:
- name: test-hostpath
mountPath: /usr/local/tomcat/webapps/
volumes:
- name: test-hostpath
hostPath:
path: /data1
type: DirectoryOrCreate


以上是关于#我的新年Flag#hostPath存储的主要内容,如果未能解决你的问题,请参考以下文章

#我的新年Flag#storageClass

#我的新年Flag#OSI

#我的新年Flag#NFS配置简介

#我的新年Flag#Pod生命周期

2022虎年的期望和新年Flag

2022虎年的期望和新年Flag