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

[Bug] Deleting EFS Addon Removes CSIDriver Resource #7518

Open
CrisNevares opened this issue Jan 30, 2024 · 3 comments
Open

[Bug] Deleting EFS Addon Removes CSIDriver Resource #7518

CrisNevares opened this issue Jan 30, 2024 · 3 comments
Labels
kind/docs User documentation kind/help Request for help

Comments

@CrisNevares
Copy link

What were you trying to accomplish?

Add, then remove the aws-efs-csi-driver addon in a Fargate-only cluster.

Because the efs.csi.aws.com CSIDriver resource existed prior to the creation of the aws-efs-csi-driver addon, I would expect that CSIDriver resource to persist in the cluster if the aws-efs-csi-driver is added and subsequently removed.

What happened?

The efs.csi.aws.com CSIDriver resource was deleted

How to reproduce it?

Create a Fargate-only cluster.
Check that the efs.csi.aws.com CSIDriver already exists.
Create the aws-efs-csi-driver addon.
Delete the aws-efs-csi-driver addon.
Notice the efs.csi.aws.com CSIDriver has been deleted.

Logs

Create an eks-test1 cluster, in order to check default csi drivers:


$ cat eks-test1.yml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: eks-test1
  region: us-east-1
  version: "1.27"
  tags:
    environment: dev

kubernetesNetworkConfig:
  ipFamily: IPv4

fargateProfiles:
  - name: fp-default
    selectors:
      - namespace: default
  - name: fp-kube
    selectors:
      - namespace: kube-system


$ eksctl create cluster -f eks-test1.yml

Check csidriver:


$ kubectl get csidriver
NAME              ATTACHREQUIRED   PODINFOONMOUNT   STORAGECAPACITY   TOKENREQUESTS   REQUIRESREPUBLISH   MODES        AGE
efs.csi.aws.com   false            false            false             <unset>         false               Persistent   34m

$ kubectl get csidriver -o yaml
apiVersion: v1
items:
- apiVersion: storage.k8s.io/v1
  kind: CSIDriver
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"storage.k8s.io/v1","kind":"CSIDriver","metadata":{"annotations":{},"name":"efs.csi.aws.com"},"spec":{"attachRequired":false}}
    creationTimestamp: "2024-01-27T09:30:56Z"
    name: efs.csi.aws.com
    resourceVersion: "272"
    uid: 534abd7e-55c2-45d6-94e9-40b80f5b26df
  spec:
    attachRequired: false
    fsGroupPolicy: ReadWriteOnceWithFSType
    podInfoOnMount: false
    requiresRepublish: false
    storageCapacity: false
    volumeLifecycleModes:
    - Persistent
kind: List
metadata:
  resourceVersion: ""

Install aws-efs-csi-driver addon adding this to eks-test1.yml:


addons:
  - name: aws-efs-csi-driver
    resolveConflicts: overwrite
$ eksctl create addon -f eks-test1.yml

I now have efs-csi-controller pods stuck in pending, due to node requirement. But also note the efs csi driver remains intact:


$ kubectl get csidriver
NAME              ATTACHREQUIRED   PODINFOONMOUNT   STORAGECAPACITY   TOKENREQUESTS   REQUIRESREPUBLISH   MODES        AGE
efs.csi.aws.com   false            false            false             <unset>         false               Persistent   38m

$ kubectl get csidriver -o yaml
apiVersion: v1
items:
- apiVersion: storage.k8s.io/v1
  kind: CSIDriver
  metadata:
    annotations:
      kubectl.kubernetes.io/last-applied-configuration: |
        {"apiVersion":"storage.k8s.io/v1","kind":"CSIDriver","metadata":{"annotations":{},"name":"efs.csi.aws.com"},"spec":{"attachRequired":false}}
    creationTimestamp: "2024-01-27T09:30:56Z"
    name: efs.csi.aws.com
    resourceVersion: "6373"
    uid: 534abd7e-55c2-45d6-94e9-40b80f5b26df
  spec:
    attachRequired: false
    fsGroupPolicy: ReadWriteOnceWithFSType
    podInfoOnMount: false
    requiresRepublish: false
    storageCapacity: false
    volumeLifecycleModes:
    - Persistent
kind: List
metadata:
  resourceVersion: ""

I now remove the addon:


$ eksctl delete addon --name aws-efs-csi-driver --cluster eks-test1

Removes the csidriver, not unexpectedly in retrospect:


$ kubectl get csidriver
No resources found

Anything else we need to know?

Versions

$ eksctl info
eksctl version: 0.167.0
kubectl version: v1.28.2
OS: linux
Copy link
Contributor

github-actions bot commented Mar 1, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Mar 1, 2024
@CrisNevares
Copy link
Author

Bump. This is still an issue.

@TiberiuGC
Copy link
Collaborator

Hi @CrisNevares , you just need to use the --preserve flag for the delete command, this way you'll delete the addon, but preserve the underlying K8s resources.

$ eksctl delete addon --name aws-efs-csi-driver --cluster eks-test1 --preserve

I'll make a small amendment to the docs so this functionality is explained there as-well.

@TiberiuGC TiberiuGC added kind/help Request for help kind/docs User documentation and removed kind/bug needs-investigation labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/docs User documentation kind/help Request for help
Projects
None yet
Development

No branches or pull requests

3 participants