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

Deleting cluster states that kubeconfig isn't auto-generated #236

Closed
jpds opened this issue Oct 4, 2018 · 7 comments
Closed

Deleting cluster states that kubeconfig isn't auto-generated #236

jpds opened this issue Oct 4, 2018 · 7 comments

Comments

@jpds
Copy link

jpds commented Oct 4, 2018

What happened?

I ran the following with no kubeconfig at all present in my home directory:

$ mv .kube .kube-old
$ eksctl create cluster -r eu-west-1
$ eksctl delete cluster --region eu-west-1 --name exciting-rainbow-1538647578
2018-10-04T12:14:00+01:00 [ℹ]  deleting EKS cluster "exciting-rainbow-1538647578"
2018-10-04T12:14:00+01:00 [ℹ]  will delete stack "eksctl-exciting-rainbow-1538647578-nodegroup-0"
2018-10-04T12:14:00+01:00 [ℹ]  waiting for stack "eksctl-exciting-rainbow-1538647578-nodegroup-0" to get deleted
2018-10-04T12:15:47+01:00 [ℹ]  will delete stack "eksctl-exciting-rainbow-1538647578-cluster"
2018-10-04T12:15:48+01:00 [!]  as you are not using the auto-generated kubeconfig file you will need to remove the details of cluster exciting-rainbow-1538647578 manually
2018-10-04T12:15:48+01:00 [✔]  the following EKS cluster resource(s) for "exciting-rainbow-1538647578" will be deleted: node group, cluster. If in doubt, check CloudFormation console

Versions
Please paste in the output of these commands:

$ eksctl version
2018-10-04T14:01:18+01:00 [ℹ]  versionInfo = map[string]string{"builtAt":"2018-09-28T08:29:56Z", "gitCommit":"13286de1b06717200a5fbe692878be4937a1b05f", "gitTag":"0.1.4"}
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-07T23:17:28Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
@richardcase
Copy link
Contributor

richardcase commented Oct 4, 2018

@jpds - what would you expect to occur in this scenario?

In my head, if there is no default kubeconfig file and there isn't an autogenerated generated kubeconfig file then we should write a log file saying that we can't find a kubeconfig file and so no cleanup will be done.

@jpds
Copy link
Author

jpds commented Oct 4, 2018

@richardcase That if eksctl had generated the kubeconfig, that it would remove the entry for the EKS cluster on deletion.

@richardcase
Copy link
Contributor

@jpds - the autogenerated kube config file is stored in a subdirectory of the kube folder (normally ~/.kube). For example, ~/.kube/eksctl/clusters/test-cluster. In your scenario above you are deleting the .kube folder and so there is no kube config for it to delete.

An autogenerated kubeconfig is deleted if it exists. Recently @kschumy added deletion of the cluster details from a shared kubeconfig file (see #226) as well.

@jpds
Copy link
Author

jpds commented Oct 4, 2018

@richardcase With versionInfo = map[string]string{"builtAt":"2018-09-28T08:29:56Z", "gitCommit":"13286de1b06717200a5fbe692878be4937a1b05f", "gitTag":"0.1.4"} - I do not have a subdirectory in ~/.kube/ - I can see my EKS cluster is directly in config.

Sorry if it wasn't clear, but I moved my working kubeconfig out of the way, before creating my EKS cluster, I then removed that EKS cluster without changing the config and eksctl told me that it couldn't remove the config as it wasn't autogenerated which it was.

@jpds
Copy link
Author

jpds commented Oct 4, 2018

Ah, the linked pull request appears to have been merged just after 0.1.4 was released. :)

@richardcase
Copy link
Contributor

@jpds - ah yes, i misread the order, sorry. When 0.1.5 is out then this should handle this scenario.

@errordeveloper
Copy link
Contributor

This was indeed fixed in 0.1.5.

torredil pushed a commit to torredil/eksctl that referenced this issue May 20, 2022
Update image for runtime deployment
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

3 participants