无法在GKE

时间:2020-05-29 14:22:32

标签: kubernetes google-kubernetes-engine glusterfs

我已经在GCE,三个节点,一个卷和一个砖上部署了一个GlusterFS集群。我需要将其安装在GKE上部署的Pod上。我已经成功创建了端点和PV,但是无法创建PVC,如果我引入了引用我的PV的volumeName,则会出现以下错误:

2s Warning VolumeMismatch persistentvolumeclaim/my-glusterfs-pvc Cannot bind to requested volume "my-glusterfs-pv": storageClassName does not match

如果不引入volumeName选择器,则会出现以下错误:

3s Warning ProvisioningFailed persistentvolumeclaim/my-glusterfs-pvc Failed to provision volume with StorageClass "standard": invalid AccessModes [ReadWriteMany]: only AccessModes [ReadWriteOnce ReadOnlyMany] are supported

虽然我说glusterfs在GKE上有本机支持,但是我在GCP网站上找不到:

https://cloud.google.com/kubernetes-engine/docs/concepts/node-images#storage_driver_support

这与我在部署PVC时遇到的错误有关吗?我该怎么解决?

谢谢!

我还没有定义任何storageClass。我只能在Kubernetes文档中找到Heketi配置的GlusterFS storageClass。我的YAML:

kind: PersistentVolume
metadata:
  name: my-glusterfs-pv
spec:
  capacity:
    storage: 100Gi
  accessModes:
    - ReadWriteMany
  glusterfs:
    path: mypath
    endpoints: my-glusterfs-cluster
    readOnly: false
  persistentVolumeReclaimPolicy: Retain
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-glusterfs-pvc
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 100Gi
  volumeName: my-glusterfs-pv

我已经在我的glusterfs集群上部署了Heketi,它可以正常工作。但是我无法在GKE上部署pvc。 Glusterfs-client运行正常,heketi机密可用,创建了gluster storageclass,没有错误,但是PVC仍在Pending中,我发现了此事件:

17m         Warning   ProvisioningFailed       persistentvolumeclaim/liferay-glusterfs-pvc   Failed to provision volume with StorageClass "gluster-heketi-external": failed to create volume: failed to create volume: see kube-controller-manager.log for details

存储类:

kind: StorageClass
#apiVersion: storage.k8s.io/v1beta1
apiVersion: storage.k8s.io/v1
metadata:
  name: gluster-heketi-external
provisioner: kubernetes.io/glusterfs
parameters:
  restauthenabled: "true"
  resturl: "http://my-heketi-node-ip:8080"
  clusterid: "idididididididididid"
  restuser: "myadminuser"
  secretName: "heketi-secret"
  secretNamespace: "my-app"
  volumetype: "replicate:3"

PVC:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    volume.beta.kubernetes.io/storage-class: gluster-heketi-external
 # finalizers:
 # - kubernetes.io/pvc-protection
  name: my-app-pvc
  namespace: my-app
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: 100Gi

我还创建了Heketi所需的防火墙规则,以便GKE节点可以访问Heketi resturl和端口。我检查了Heketi节点上的流量时,已启动telnet到8080端口,可以正常工作。一切似乎都正常,我可以看到答案和数据包。但是,部署pvc时看不到任何数据包。 syslog上没有任何内容。在本地启动heketi命令时,我可以创建卷。

我尝试从gluster-client pod中卷曲Heketi节点,它正常工作:

kubectl exec -it gluster-client-6fqmb -- curl http://[myheketinodeip]:8080/hello
Hello from Heketi

0 个答案:

没有答案