【问题标题】:GKE - filestore - not accessibleGKE - 文件存储 - 无法访问
【发布时间】:2022-11-10 23:52:43
【问题描述】:

我的自定义 vpc 中有一个文件存储。

名称:我的填充物

NFS 挂载点:10.165.122.140:/bindata

连接模式:DIRECT_PEERING

我正在尝试从我的 GKE 集群访问它。参考网址:https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/blob/master/docs/kubernetes/pre-provisioned-pv.md

光伏:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: my-pre-pv
  namespace: sylius
  annotations:
    pv.kubernetes.io/provisioned-by: filestore.csi.storage.gke.io
spec:
  storageClassName: csi-filestore
  capacity:
    storage: 1Ti
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  volumeMode: Filesystem
  csi:
    driver: filestore.csi.storage.gke.io
    # "modeInstance/<zone>/<filestore-instance-name>/<filestore-share-name>"
    volumeHandle: "modeInstance/europe-west3-a/my-filler/bindata"
    volumeAttributes:
      ip: 10.165.122.140 
      volume: bindata

但是当我尝试从 pod 访问它时,它不起作用。

例如,一个示例部署:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
spec:
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: myapp
        image: busybox
        volumeMounts:
        - name: config
          mountPath: /etc/vol1
      volumes:
      - name: config
        persistentVolumeClaim:
         claimName: preprov-pvc

pod 状态始终为 ContainerCreating。

当我描述 pod 时,我收到以下消息:

Events:
  Type     Reason       Age                  From               Message
  ----     ------       ----                 ----               -------
  Normal   Scheduled    9m26s                default-scheduler  Successfully assigned sylius/myapp-789dc79fc9-5wcmj to gke-otcp-sylius-dev-private-pool-458796a9-tk6c
  
Warning  FailedMount  39s (x4 over 7m23s)  kubelet            Unable to attach or mount volumes: unmounted volumes=[config], unattached volumes=[config kube-api-access-5wpcd]: timed out waiting for the condition

我还在 GKE 集群中安装了 csi 驱动程序。

看来pv还可以。

kubectl get pv

NAME        CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                STORAGECLASS    REASON   AGE
my-pre-pv   1Ti        RWX            Retain           Bound    sylius/preprov-pvc   csi-filestore            23m

PVC也有约束力。

kubectl get PVC

NAME          STATUS   VOLUME      CAPACITY   ACCESS MODES   STORAGECLASS    AGE
preprov-pvc   Bound    my-pre-pv   1Ti        RWX            csi-filestore   24m

知道为什么不能附加吗?

是不是因为连接模式不是 PRIVATE_SERVICE_ACCESS?如果是,如何进行对等互连,在哪两个网络之间?

【问题讨论】:

  • 你的问题解决了吗?如果是,您能否提供您已遵循的解决步骤并将其作为答案,以提高社区的知名度。
  • 对于我们的业务案例,我选择了 netapp 而不是 gke 文件存储。如果你使用它,你只需要更新导出规则。

标签: google-cloud-platform google-kubernetes-engine google-cloud-filestore


【解决方案1】:

您需要在集群中启用 Filestore CSI 驱动程序。

遵循本指南:https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/filestore-csi-driver

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-04
    • 2016-09-26
    • 2020-09-18
    • 2019-12-25
    • 2021-06-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多