【发布时间】:2019-11-04 00:50:19
【问题描述】:
我已经从 kubespray - ansible 脚本设置和 Kubernetes 集群。 现在我已经创建了一个部署,其中卷要挂载为 spec.template.spec.volumes 中的 hostPath。我已经通过 nfs 文件系统在我的所有节点上安装了卷。 现在我在 k8s 文档中阅读它不是一个好的做法,但需要了解 hostPath 的危害。 以下是示例 yaml 文件。
spec:
containers:
- image: test:latest
imagePullPolicy: Always
name: test1
ports:
- containerPort: 4006
protocol: TCP
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- name : test-data
mountPath : /RIC/
- name : test-config
mountPath : /xyz/abc.config
subPath : abc.config
volumes:
- name : test-data
hostPath :
path : /nfs-mount/RIC/
- name : test-config
configMap :
name : test-config
【问题讨论】:
标签: kubernetes