【问题标题】:NFS volume mount times out on Kubernetes with incorrect IP?NFS 卷挂载在 IP 不正确的 Kubernetes 上超时?
【发布时间】:2019-10-29 01:25:41
【问题描述】:

97 挂载命令:systemd-run 98 挂载参数: --description=Kubernetes 临时挂载 /var/lib/kubelet/pods/06b9ae42-8e99-11e9-b888-a44c24184b19/volumes/kubernetes.io~nfs/nfs-data --scope -- mount -t nfs 10.100.155.82:/exports/www /var/lib/kubelet/pods/06b9ae42-8e99-11e9-b888-a44c24184b19/volumes/kubernetes.io~nfs/nfs-data 99 输出:运行范围为单位: 运行-r26f9da6c287846589bec8d059c33441d.scope 100 mount.nfs:连接 超时

101 挂载失败警告 2019-06-14T11:48:46Z 102 typo3-app-67b58d7657-cvqdg Pod 无法为 pod 挂载卷 “typo3-app-67b58d7657-cvqdg_default(1fb4c719-8e9a-11e9-b888-a44c24184b19)”: 超时已过期,等待卷附加或挂载 pod “默认”/“typo3-app-67b58d7657-cvqdg”。卸载列表 卷=[nfs 数据 nfs 数据 src]。未附加卷列表=[nfs-data nfs-数据-src default-token-lmtl4] FailedMount 警告 2019-06-14T11:49:04Z

奇怪的是,我不知道10.100.155.82 是从哪里来的?这是ClusterIP之前的IP(与nfs服务有关)...

apiVersion: apps/v1
kind: Deployment
metadata:
  name: typo3-app
  labels:
    app: typo3
spec:
  replicas: 1
  selector:
    matchLabels:
      app: typo3
  template:
    metadata:
      labels:
        app: typo3
    spec:
      containers:
      - name: app
        image: us.gcr.io/objit-chris/chrisjitit-typo3:v11
        ports:
        - containerPort: 80
        volumeMounts:
          - mountPath: /var/www/html-chrisjitit
            name: nfs-data
          - mountPath: /var/www/typo3_src-6.2.6
            name: nfs-data-src
      volumes:
        - name: nfs-data
          nfs: 
            # https://github.com/kubernetes/minikube/issues/3417
            # server is not resolved using kube dns (so can't resolve to a service name - hence we need the IP)
            #server: 10.11.250.37
            server: 10.97.78.206 
            path: /exports/www
        - name: nfs-data-src
          nfs: 
            # https://github.com/kubernetes/minikube/issues/3417
            # server is not resolved using kube dns (so can't resolve to a service name - hence we need the IP)
            #server: 10.11.250.37
            server: 10.97.78.206 
            path: /exports/www/typo3_src

此超时/使用错误 IP 的原因可能是什么?


我尝试删除部署,更改似乎仍然不起作用的名称,但几分钟后它起作用了......真的很奇怪的行为吗?


再次遇到这个问题...:

 kubectl get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM              STORAGECLASS   REASON   AGE
nfs-data                                   10Gi       RWO            Retain           Available                                              67m
pvc-f1353542-a8b1-11e9-bdf7-38ffa66115bc   10Gi       RWO            Delete           Bound       default/nfs-data   standard                67m

kubectl get pvc
NAME       STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
nfs-data   Bound    pvc-f1353542-a8b1-11e9-bdf7-38ffa66115bc   10Gi       RWO            standard       67m

【问题讨论】:

  • 你能提供kubectl get pvckubectl get pv的输出吗?

标签: kubernetes nfs


【解决方案1】:

它不断获取旧的 NFS IP。这是一个错误...:

Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/9470ac17-a8b9-11e9-bdf7-38ffa66115bc/volumes/kubernetes.io~nfs/nfs-data-src --scope -- mount -t nfs 10.11.250.37:/exports/www/typo3_src /var/lib/kubelet/pods/9470ac17-a8b9-11e9-bdf7-38ffa66115bc/volumes/kubernetes.io~nfs/nfs-data-src
Output: Running scope as unit: run-ref2095cb52c94d0c87de5458c3b16733.scope
mount.nfs: Connection timed out

【讨论】:

  • 你找到解决办法了吗?
  • 我从来没有深究过这个问题。 :( 这可能是一个错误。
  • 我遇到了同样的问题。似乎最快的解决方法是找到这个陈旧 IP 的位置并更新它。但我似乎找不到它。
  • 您也可以通过其他方式直接挂载它。甚至可能是一个侧容器负责挂载 NFS 挂载,然后与容器共享一个卷。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-07-27
  • 1970-01-01
  • 2021-12-22
  • 2021-02-10
  • 2016-12-24
  • 2017-10-17
  • 2022-07-21
相关资源
最近更新 更多