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

Mount using pod impersonation fails with "Volume context property not supported" #774

Closed
razvan-moj opened this issue Sep 28, 2022 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@razvan-moj
Copy link

razvan-moj commented Sep 28, 2022

/kind bug

Driver installation works fine, using the latest 2.2.8 chart (https://github.com/ministryofjustice/cloud-platform-terraform-efs-csi/blob/impersonation/main.tf#L60), driver 1.4.1

FS, PV and PVC are created with no issues, using https://github.com/ministryofjustice/cloud-platform-terraform-efs-pv/tree/frist, called as just

module "efs" {
  source = "github.com/ministryofjustice/cloud-platform-terraform-efs-pv?ref=frist"

  cluster_name           = var.cluster_name
  namespace              = var.namespace
  encrypted = true
}

test pod example:

apiVersion: v1
kind: Pod
metadata:
  name: raz-app-1
  namespace: raz-test-not-one
spec:
  containers:
  - name: raz-app-1
    image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo $(hostname ; date -u) >> /data/out.txt; sleep 5; done"]
    volumeMounts:
    - name: efs-storage
      mountPath: /data
  serviceAccountName: efs-raz-test-not-one
  securityContext:
    runAsUser: 1000
    runAsGroup: 1000
    fsGroup: 1000
  volumes:
  - name: efs-storage
    persistentVolumeClaim:
      claimName: raz-test-raz-test-not-one

pods get stuck in ContainerCreating, no useful logs on the controller, kubectl get events says

25s         Warning   FailedMount   pod/raz-app-1   MountVolume.SetUp failed for volume "raz-test-raz-test-not-one-efs" : rpc error: code = InvalidArgument desc = Volume context property csi.storage.k8s.io/pod.uid not supported
23s         Warning   FailedMount   pod/raz-app-1   MountVolume.SetUp failed for volume "raz-test-raz-test-not-one-efs" : rpc error: code = InvalidArgument desc = Volume context property podIAMAuthorization not supported
9s          Warning   FailedMount   pod/raz-app-1   MountVolume.SetUp failed for volume "raz-test-raz-test-not-one-efs" : rpc error: code = InvalidArgument desc = Volume context property csi.storage.k8s.io/serviceAccount.tokens not supported

Environment

  • Kubernetes version (use kubectl version): EKS 1.21
  • Driver version: 1.4.1

Note everything works, creation, PV, mount, use in multiple pods, as long as we do not use IAM.

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 28, 2022
@tjdett
Copy link

tjdett commented Oct 12, 2022

Is #777 related to this?

@Ashley-wenyizha
Copy link
Contributor

we have reverted this feature unfortunately due to a security concern from EKS side. We will add this feature through efs-utils side but we do not have a clear timeline at the moment

@andrecastro
Copy link

@Ashley-wenyizha Why this was reverted? What were the concerns?
In a shared cluster, this feature improves security by allowing better access control. With the secrets-store-csi-driver, I can create secrets in AWS Secrets Manager and restrict access to specific pods using resource policies. It would be great if we could do something similar with EFS, so we can limit access to only the pods we specify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

5 participants