gcs-fuse-csi-driver: failed to find the sidecar container in Pod spec

Hi I am trying to use examples/static/pv-pvc-deployment.yaml but when I describe the pod getting below error

MountVolume.SetUp failed for volume "gcs-fuse-csi-pv" : rpc error: code = FailedPrecondition desc = failed to find the sidecar container in Pod spec

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Hi @DattatrayHinge, are you facing the same issue as @guru91197 reported?

Can you double check if the annotations are under spec.template.metadata.annotations in a deployment spec? Note that it is not under the deployment annotations, it’s under the Pod template annotations.

Hi @DattatrayHinge , Yes, please find the solution on the GKE doc:

If you use a Security Context for your Pod or container, or if your container image uses a non-root user or group, you must set the uid and gid mount flags. You also need to use the file-mode and dir-mode mount flags to set the file system permissions. Note that you cannot run chmod, chown, or chgrp commands against a Cloud Storage FUSE file system, so uid, gid, file-mode and dir-mode mount flags are necessary to provide access to a non-root user or group.

Hey I’m having this same issue, and these links are 404’ing now. Do you have updated links or where can I find these?

GKE - https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/cloud-storage-fuse-csi-driver#mounting-flags security-contex -> https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod