k8s 挂载本地目录至pod
k8s
·
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx-controller
spec:
replicas: 1
selector:
name: nginx
template:
metadata:
labels:
name: nginx
spec:
containers:
- name: nginx
image: k8s-docker-registry-node:5000/nginx
ports:
- containerPort: 80
volumeMounts:
- mountPath: /opt/ssl
name: data-volume
volumes:
- name: data-volume
hostPath:
path: /opt/ssl
注意是 pod
分配的主机的本地目录!
更多推荐
已为社区贡献65条内容
所有评论(0)