GKE Autopilot 未连接到 Cloud Filestore
GKE Autopilot Not Connecting to Cloud Filestore
我一直在尝试将由 Cloud Filestore 支持的 PersistentVolume
附加到我在 GKE Autopilot 中的部署。 Filestore 实例与 Autopilot 集群位于同一网络上,但我一直收到以下错误:
"Unable to attach or mount volumes: unmounted volumes=[prd-fileserver-tmp-dir-volume], unattached volumes=[kube-api-access-fk6zj prd-fileserver-tmp-dir-volume localssd]: timed out waiting for the condition"
当我在集群上 运行 kubectl describe pod [POD_NAME]
时,我在输出中看到这个错误:
Output: mount.nfs: access denied by server while mounting 10.209.161.2:/prd-fileserver-tmp-dir-volume
下面是我的 YAML 文件:
Filestore-pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: prd-fileserver
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteMany
nfs:
path: /prd_fs_share
server: [IP_ADDRESS]
Filestore-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prd-fileserver-claim
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
volumeName: prd-fileserver
resources:
requests:
storage: 20Gi
deployment.yaml
# This is how I am mounting the PVC
volumes:
- name: prd-fileserver-tmp-dir-volume
persistentVolumeClaim:
claimName: prd-fileserver-claim
readOnly: false
# Attaching to container
- mountPath: /mnt/disks/fileserver/tmp
name: prd-fileserver-tmp-dir-volume
当我在 GKE 标准环境中 运行 同样配置时,一切正常。我的问题是:您可以在 GKE Autopilot 中使用 Cloud Filestore 吗?我没有看到任何表明你不能的东西。
public 文档中的 Accessing file shares from Google Kubernetes Engine clusters 没有提到您需要 运行 一个 Privileged Pod,但我在网上看到各种文章都提到您必须 运行 GKE 中用于访问 Filestore 的特权 Pod。鉴于您不能 运行 Privileged Pods.
,这将是 GKE Autopilot 的限制
根据 Google 云支持,截至 2021 年 8 月,无法在 GKE Autopilot 中安装 Filestore 实例。以下回复:
GKE autopilot can not run privileged pods as mentioned in this
documentation.
This is the tradeoff of an enforced security policies for the
autopilot mode. As the autopilot exclude the nodes management, this is
not possible to interact with the hosts, why privileged pods are not
allowed. The recommended solution for you is running your workload on
GKE standard for being able to mount filestore as expected.
我想添加一些评论,以防止人们对这个话题产生误解。
GKE autopilot can not run privileged pods
没错。自动驾驶模式不允许特权pods,以防止底层节点被那些pods.
修改
to access file shares from Google Kubernetes Engine clusters, you need to run a Privileged Pod.
如果此处的“文件共享”表示由 Cloud Filestore 或其他一些共享文件系统支持的持久卷,则不正确。对于 PV,实际访问底层共享文件系统(挂载)将由节点完成,而 pod 只是获得一个映射路径。这是抽象的方式,pod 实际上不知道路径是远程的还是本地的。
我猜提到特权 pods 的文档是在谈论从容器级别“手动访问”文件共享。如果你真的需要直接从你的容器挂载一个远程文件系统,而不是将其作为 PV,mount
命令将在容器内执行,并且 pod 应该是特权模式。 (这不是一个常见的用例)
mounting a Filestore instance in GKE Autopilot is not possible, as of August 2021.
不正确。从PV接入的角度来看,标准模式和自动驾驶模式没有区别。
我猜OP的原始问题可能是ACL问题或其他问题。
我一直在尝试将由 Cloud Filestore 支持的 PersistentVolume
附加到我在 GKE Autopilot 中的部署。 Filestore 实例与 Autopilot 集群位于同一网络上,但我一直收到以下错误:
"Unable to attach or mount volumes: unmounted volumes=[prd-fileserver-tmp-dir-volume], unattached volumes=[kube-api-access-fk6zj prd-fileserver-tmp-dir-volume localssd]: timed out waiting for the condition"
当我在集群上 运行 kubectl describe pod [POD_NAME]
时,我在输出中看到这个错误:
Output: mount.nfs: access denied by server while mounting 10.209.161.2:/prd-fileserver-tmp-dir-volume
下面是我的 YAML 文件:
Filestore-pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: prd-fileserver
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteMany
nfs:
path: /prd_fs_share
server: [IP_ADDRESS]
Filestore-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prd-fileserver-claim
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
volumeName: prd-fileserver
resources:
requests:
storage: 20Gi
deployment.yaml
# This is how I am mounting the PVC
volumes:
- name: prd-fileserver-tmp-dir-volume
persistentVolumeClaim:
claimName: prd-fileserver-claim
readOnly: false
# Attaching to container
- mountPath: /mnt/disks/fileserver/tmp
name: prd-fileserver-tmp-dir-volume
当我在 GKE 标准环境中 运行 同样配置时,一切正常。我的问题是:您可以在 GKE Autopilot 中使用 Cloud Filestore 吗?我没有看到任何表明你不能的东西。
public 文档中的Accessing file shares from Google Kubernetes Engine clusters 没有提到您需要 运行 一个 Privileged Pod,但我在网上看到各种文章都提到您必须 运行 GKE 中用于访问 Filestore 的特权 Pod。鉴于您不能 运行 Privileged Pods.
,这将是 GKE Autopilot 的限制根据 Google 云支持,截至 2021 年 8 月,无法在 GKE Autopilot 中安装 Filestore 实例。以下回复:
GKE autopilot can not run privileged pods as mentioned in this documentation. This is the tradeoff of an enforced security policies for the autopilot mode. As the autopilot exclude the nodes management, this is not possible to interact with the hosts, why privileged pods are not allowed. The recommended solution for you is running your workload on GKE standard for being able to mount filestore as expected.
我想添加一些评论,以防止人们对这个话题产生误解。
GKE autopilot can not run privileged pods
没错。自动驾驶模式不允许特权pods,以防止底层节点被那些pods.
修改to access file shares from Google Kubernetes Engine clusters, you need to run a Privileged Pod.
如果此处的“文件共享”表示由 Cloud Filestore 或其他一些共享文件系统支持的持久卷,则不正确。对于 PV,实际访问底层共享文件系统(挂载)将由节点完成,而 pod 只是获得一个映射路径。这是抽象的方式,pod 实际上不知道路径是远程的还是本地的。
我猜提到特权 pods 的文档是在谈论从容器级别“手动访问”文件共享。如果你真的需要直接从你的容器挂载一个远程文件系统,而不是将其作为 PV,mount
命令将在容器内执行,并且 pod 应该是特权模式。 (这不是一个常见的用例)
mounting a Filestore instance in GKE Autopilot is not possible, as of August 2021.
不正确。从PV接入的角度来看,标准模式和自动驾驶模式没有区别。
我猜OP的原始问题可能是ACL问题或其他问题。