在kubernetes中,我可以使用
PersistentVolumeClaim来创建一些存储空间,稍后我可以将其存储在某个容器中.
解决方法
首先,找出您的进程正在运行的UID号.
然后你可以通过添加.spec.securityContext.fsGroup
告诉Kubernetes chown(排序)你的pod的卷的挂载点:
spec: ... securityContext: fsGroup: 2000
fsGroup
: integer: A special supplemental group that applies to all containers in a pod. Some volume types allow the Kubelet to change the ownership of that volume to be owned by the pod: 1. The owning GID will be the FSGroup 2. The setgid bit is set (new files created in the volume will be owned by FSGroup) 3. The permission bits are OR’d with rw-rw—- If unset,the Kubelet will not modify the ownership and permissions of any volume.