Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to attach or mount volumes: #77

Open
leyi-bc opened this issue Jul 15, 2022 · 2 comments
Open

Unable to attach or mount volumes: #77

leyi-bc opened this issue Jul 15, 2022 · 2 comments

Comments

@leyi-bc
Copy link

leyi-bc commented Jul 15, 2022

hi,can you help me solve this problem?
Unable to attach or mount volumes: unmounted volumes=[webroot], unattached volumes=[istio-token istio-podinfo kube-api-access-g9wh7 webroot istiod-ca-cert istio-data istio-envoy]: timed out waiting for the condition

I think there is no problem with my PVC

Name: csi-s3-existing-bucket
Namespace: default
StorageClass: csi-s3-existing-bucket
Status: Bound
Volume: pvc-68bdbede-e355-48ce-9ce7-7d47a9219da8
Labels:
Annotations: pv.kubernetes.io/bind-completed: yes
pv.kubernetes.io/bound-by-controller: yes
volume.beta.kubernetes.io/storage-provisioner: ch.ctrox.csi.s3-driver
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 1Gi
Access Modes: RWO
VolumeMode: Filesystem
Used By: csi-s3-test-nginx
Events:

`apiVersion: v1
kind: Pod
metadata:
name: csi-s3-test-nginx
namespace: default
spec:
containers:

  • name: csi-s3-test-nginx
    image: nginx
    volumeMounts:
    • mountPath: /var/lib/www/html
      name: webroot
      volumes:
  • name: webroot
    persistentVolumeClaim:
    claimName: csi-s3-existing-bucket
    readOnly: false
    `
@leyi-bc
Copy link
Author

leyi-bc commented Jul 15, 2022

image
image

@leyi-bc leyi-bc changed the title Unable to Mount volume at Pod Unable to attach or mount volumes: Jul 15, 2022
@fallmo
Copy link

fallmo commented Sep 16, 2022

I had the same problem, I looked at the logs of the csi-attacher-s3 pod, first i saw Failed to list *v1beta1.VolumeAttachment: the server could not find the requested resource. I figured it was a k8s version issue, so I updated the container image of the csi-attacher stateful set, from v2.2.1 to canary (the latest).

kubectl -n kube-system set image statefulset/csi-attacher-s3 csi-attacher=quay.io/k8scsi/csi-attacher:canary

Next I got a permission error: `v1.VolumeAttachment: failed to list *v1.VolumeAttachment: volumeattachments.storage.k8s.io is forbidden: User "system:serviceaccount:kube-system:csi-attacher-sa" cannot list resource "volumeattachments" in API group "storage.k8s.io" at the cluster scope.

I tried to modify the role bindings but I couldn't find the right combinations so I ended up giving the csi-attacher-sa service account cluster-admin privileges as shown below:

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: csi-attacher-all
subjects:
  - kind: ServiceAccount
    name: csi-attacher-sa
    namespace: kube-system
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants