【问题标题】:Accidentally deleted the glusterfs-dynamic Service for my PVC; how do I recreate it?不小心删除了我 PVC 的 glusterfs-dynamic 服务;我该如何重新创建它?
【发布时间】:2019-05-06 14:34:12
【问题描述】:

尝试从新的 openshift 重新创建我的所有资产(除了我的 PVC),我删除了所有内容($ oc delete all --all; oc delete configmap --all; oc delete secret -l namespace=visor)。我这样做是为了确保我的“oc 流程 -f 模板”完成了一项完整的工作。

这删除了我没有意识到挂载 PVC(持久卷声明)所需的 glusterfs-dynamic 服务。

解决方案 1:重新创建服务

  • 我重新创建了这些服务,使它们看起来就像类似的 glusterfs 动态服务,但这还不够;即使 IP 地址匹配,PVC 仍然无法挂载('endpoints "glusterfs-dynamic-xxx" not found')

解决方案 2:将数据从旧 PVC 复制到新 PVC

  • 要复制,我需要能够从 pod 访问 PVC——我无法挂载 PVC...

我尝试重新创建服务:

      - apiVersion: v1
        kind: Service
        metadata:
          labels:
            gluster.kubernetes.io/provisioned-for-pvc: prom-a-pvc
            namespace: visor
          name: glusterfs-dynamic-615a9bfa-57d9-11e9-b511-001a4a195f6a
          namespace: visor
        spec:
          ports:
            - port: 1
              protocol: TCP
              targetPort: 1
          sessionAffinity: None
          type: ClusterIP

我希望能够挂载我的 PVC。

但是我得到了这个错误: MountVolume.NewMounter initialization failed for volume "pvc-89647bcb-6df4-11e9-bd79-001a4a195f6a" : endpoints "glusterfs-dynamic-89647bcb-6df4-11e9-bd79-001a4a195f6a" not found

【问题讨论】:

    标签: openshift persistent-volume-claims


    【解决方案1】:

    想通了。呜呜。还有一个“端点”资产被删除,我必须重新创建:

        - apiVersion: v1
          kind: Service
          metadata:
            labels:
              gluster.kubernetes.io/provisioned-for-pvc: prom-a-pvc
              namespace: visor
            name: glusterfs-dynamic-615a9bfa-57d9-11e9-b511-001a4a195f6a
            namespace: visor
          spec:
            ports:
              - port: 1
                protocol: TCP
                targetPort: 1
            sessionAffinity: None
            type: ClusterIP
    
        - apiVersion: v1
          kind: Endpoints
          metadata:
            labels:
              gluster.kubernetes.io/provisioned-for-pvc: prom-a-pvc
            name: glusterfs-dynamic-615a9bfa-57d9-11e9-b511-001a4a195f6a
            namespace: visor
          subsets:
          - addresses:
            - ip: 10.25.6.231
            - ip: 10.25.6.232
            - ip: 10.27.6.241
            - ip: 10.27.6.242
            - ip: 10.5.6.221
            - ip: 10.5.6.222
            ports:
            - port: 1
              protocol: TCP
    

    我使用这些命令来查看我需要在我的 yaml 中包含的内容:

    $ oc 获取端点

    $ oc 编辑端点 glusterfs-dynamic-820de1e7-6df6-11e9-bd79-001a4a195f6a

    链接:

    【讨论】:

      猜你喜欢
      • 2015-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多