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

CrossNamespaceVolumeDataSource does not work #1682

Closed
s2504s opened this issue Jul 13, 2023 · 2 comments
Closed

CrossNamespaceVolumeDataSource does not work #1682

s2504s opened this issue Jul 13, 2023 · 2 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@s2504s
Copy link

s2504s commented Jul 13, 2023

/kind bug

What happened?
A PVC is configured for using the dataSourceRef in order to be able to use VolumeSnapshot from the different namespace

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data-dev-nginx
  namespace: dev
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: ebs-sc
  resources:
    requests:
      storage: 8Gi
  dataSourceRef:
    name: snapshot-staging-nginx
    kind: VolumeSnapshot
    apiGroup: snapshot.storage.k8s.io
    namespace: staging

But this functionality does not work - PVC was created but the source field is absent and the PV that is created from this PVC is empty

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data-dev-nginx
  namespace: dev
status:
  phase: Pending
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 8Gi
  storageClassName: ebs-sc
  volumeMode: Filesystem

All requirements from this manual https://kubernetes.io/blog/2023/01/02/cross-namespace-data-sources-alpha/ are met:

  • gateway.networking.k8s.io is added to the Kubernetes API
  • kind: ReferenceGrant is created
apiVersion: gateway.networking.k8s.io/v1beta1
kind: ReferenceGrant
metadata:
  name: allow-staging-pvc
  namespace: staging
spec:
  from:
  - group: ""
    kind: PersistentVolumeClaim
    namespace: dev
  to:
  - group: snapshot.storage.k8s.io
    kind: VolumeSnapshot
    name: snapshot-staging-nginx
  • Enable the CrossNamespaceVolumeDataSource feature gate for the CSI Provisioner
  • Grant ReferenceGrants read permission to the CSI Provisioner - I granted cluster-admin role fro SA CSI-provisioner

What you expected to happen?
The created PVC should contain the dataSourceRef field and the PV should contain data form SnapshotVolume

How to reproduce it (as minimally and precisely as possible)?
Apply the manifest above

Anything else we need to know?:
If I use the same namespace for PVC and SnapshotVolume - everything works as expected - PVC contains right source and PV contains the data from that SnapshotVolume

Environment

  • Kubernetes version (use kubectl version): 1.27
  • Driver version: 1.19.0
@AndrewSirenko
Copy link
Contributor

Hi @s2504s, thank you for reaching out. #1746 shows that the CrossNamespaceVolumeDataSource feature can be used with the aws-ebs-csi-driver if the relevant kube-apiserver and kube-controller-manager feature gates are turned on and the relevant cluster role rule is added. However, EKS will not enable the feature gates before the community enables them by default.

/close

@k8s-ci-robot
Copy link
Contributor

@AndrewSirenko: Closing this issue.

In response to this:

Hi @s2504s, thank you for reaching out. #1746 shows that the CrossNamespaceVolumeDataSource feature can be used with the aws-ebs-csi-driver if the relevant kube-apiserver and kube-controller-manager feature gates are turned on and the relevant cluster role rule is added. However, EKS will not enable the feature gates before the community enables them by default.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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

3 participants