其他分享
首页 > 其他分享> > k8s 数据卷hostPath卷

k8s 数据卷hostPath卷

作者:互联网

k8s-数据卷hostPath卷

1. 数据卷hostPath卷

2. 案例

2.1 编写配置文件

2.2 启动服务

[root@k8s-master hostPath]# kubectl apply -f hostpath.yaml 
pod/my-hostpath created

2.3 查看服务是否启动

[root@k8s-master hostPath]# kubectl get pods -o wide
NAME                 READY   STATUS    RESTARTS   AGE     IP               NODE        NOMINATED NODE   READINESS GATES
configmap-demo-pod   1/1     Running   0          2d      10.244.107.209   k8s-node3   <none>           <none>
my-hostpath          1/1     Running   0          4m28s   10.244.107.211   k8s-node3   <none>           <none>
secret-demo-pod      1/1     Running   0          41h     10.244.107.210   k8s-node3   <none>           <none>

2.4 验证数据

我们可以看到节点在node3上面,我们去node3节点/tmp/目录下载创建一个文件做测试”test.txt“

标签:tmp,name,数据,hostPath,node3,k8s,root
来源: https://www.cnblogs.com/scajy/p/15661556.html