问题描述
根据 Linode Volume 部分的教程,我应用了这样的 PVC 对象:
apiVersion: v1
kind: PersistentVolumeClaim
Metadata:
name: pvc-example
namespace: website
spec:
accessModes:
- ReadWriteOnce
resources:
selector:
matchLabels: my-Nginx
requests:
storage: 10Gi
storageClassName: linode-block-storage-retain
这个yaml在Linode上创建了一个Volume并登录到K8S并执行了这些命令
之后我更改了 Nginx 的部署对象:
apiVersion: apps/v1
kind: Deployment
Metadata:
name: my-Nginx
namespace: mainsite
spec:
replicas: 1
selector:
matchLabels:
run: my-Nginx
template:
Metadata:
labels:
run: my-Nginx
spec:
volumes:
- name: pvc-example
containers:
-
image: Nginx
name: my-Nginx
ports:
-
containerPort: 443
-
containerPort: 80
volumeMounts:
- mountPath: "/usr/share/Nginx/html"
name: pvc-example
现在我手动登录到ngix pod并执行时无法使用Linode的PV:
mount /dev/disk/by-id/scsi-0Linode_Volume_ahsdjksdhadsh /mnt/BlockStorage1
mount: /mnt/BlockStorage1: special device /dev/disk/by-id/scsi-0Linode_Volume_ashdasuidhashdasd does not exist.
在这里我应该怎么做才能指向我的 Nginx 使用 PV html 路径而不是 pod html 路径?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)