Kubernetes 将K8s PVC装入隐藏的容器目录

Kubernetes 将K8s PVC装入隐藏的容器目录,kubernetes,storage,guacamole,kubernetes-pvc,Kubernetes,Storage,Guacamole,Kubernetes Pvc,我正在努力在我的豆荚中安装一个PVC到/root/.guacamole。挂载到/root/extensions可以工作,但是.guacamole不允许pod启动。基本上,我希望将文件guacamole-auth-totp-1.1.0.jar包含到现有容器位置/root/.guacamole/extensions中(不要替换;尽管kubernetes不太支持这个): 有效 volumeMounts: - mountPath: "/root/extensions

我正在努力在我的豆荚中安装一个PVC到/root/.guacamole。挂载到/root/extensions可以工作,但是.guacamole不允许pod启动。基本上,我希望将文件guacamole-auth-totp-1.1.0.jar包含到现有容器位置/root/.guacamole/extensions中(不要替换;尽管kubernetes不太支持这个):

有效

        volumeMounts:
      - mountPath: "/root/extensions"
        name: vol-guacamole
        subPath: guacamole-auth-totp-1.1.0.jar
  volumes:
    - name: vol-guacamole
      persistentVolumeClaim: 
        claimName: guacamole-app-pvc
        volumeMounts:
      - mountPath: "/root/.guacamole/extensions"
        name: vol-guacamole
        subPath: guacamole-auth-totp-1.1.0.jar
  volumes:
    - name: vol-guacamole
      persistentVolumeClaim: 
        claimName: guacamole-app-pvc
失败

        volumeMounts:
      - mountPath: "/root/extensions"
        name: vol-guacamole
        subPath: guacamole-auth-totp-1.1.0.jar
  volumes:
    - name: vol-guacamole
      persistentVolumeClaim: 
        claimName: guacamole-app-pvc
        volumeMounts:
      - mountPath: "/root/.guacamole/extensions"
        name: vol-guacamole
        subPath: guacamole-auth-totp-1.1.0.jar
  volumes:
    - name: vol-guacamole
      persistentVolumeClaim: 
        claimName: guacamole-app-pvc

Kubernetes版本

kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
PV和PVC(无文件安装)

PV和PVC(带文件安装)


你的k8s版本是什么?你能发布你正在使用的PV和PVC吗?我更新了问题。谢谢你的支持!我将尝试另一种方法,在部署之前更新docker映像以进行更改。这样我就不必面对docker和kubernetes之间的不兼容了。现在有点迷路了。这里出现了什么问题?Pod无法启动,出现错误:kubectl日志Pod rm:无法删除“/root/.guacamole/extensions”:设备或资源繁忙您的k8s版本是什么?你能发布你正在使用的PV和PVC吗?我更新了问题。谢谢你的支持!我将尝试另一种方法,在部署之前更新docker映像以进行更改。这样我就不必面对docker和kubernetes之间的不兼容了。现在有点迷路了。这里出现了什么问题?Pod无法启动,出现错误:kubectl日志Pod rm:无法删除“/root/.guacamole/extensions”:设备或资源繁忙
kubectl get pv,pvc -n guacamole
NAME                                             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                                      STORAGECLASS   REASON   AGE
[...]
persistentvolume/guacamole-app-pv                10Gi       RWO            Retain           Bound    guacamole/guacamole-app-pvc                manual                  39s
[...]

NAME                                      STATUS   VOLUME             CAPACITY   ACCESS MODES   STORAGECLASS   AGE
persistentvolumeclaim/guacamole-app-pvc   Bound    guacamole-app-pv   10Gi       RWO            manual         39s