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

Use eksctl commands (e.g. update core-dns) on non-eksctl created clusters #2174

Closed
kalbir opened this issue May 12, 2020 · 10 comments
Closed
Labels
kind/feature New feature or request priority/important-longterm Important over the long term, but may not be currently staffed and/or may require multiple releases

Comments

@kalbir
Copy link

kalbir commented May 12, 2020

Why do you want this feature?
eksctl has some commands that make it easy to do things on clusters. So regardless of whether you created the cluster with eksctl or some other method, it could save yout time if you could use one of those commands on your cluster.

Examples that come to mind are:

What feature/behavior/change do you want?

My initial thought is that you could pass some identifier for the cluster to eksctl (e.g. name and region) that will identify a unique cluster. eksctl could then look up that cluster and apply the correct command to it. So on the surface of things, eksctl would not change from a user perspective.

This would mean that eksctl get clusters could also show all the clusters that you have in your account, and indicate whether they were created by eksctl or not.

Then if you tried a command on a non-eksctl cluster that we could not complete, you'd get a message telling you why you couldn't do that (e.g. delete cluster).

@aclevername
Copy link
Contributor

aclevername commented Oct 30, 2020

Thanks for opening the issue @kalbir. You raise some excellent points around the current user experience when using eksctl against clusters that weren't created with eksctl. I've opened two recent PRs to try and improve the current experience #2779 and #2775. However these PRs only adress eksctl get clusters and eksctl create iamserviceaccount. As you point out there are many commands where eksctl doesn't work.

Your suggestion around changing it so that the UX seems reasonable to me. To recap the outcome of running a command against a non-eksctl created cluster would be either:

  1. It works as expected
  2. Where it doesn't work, it provides a good UX, e.g.
$ eksctl delete cluster --name cluster-created-in-console
[ℹ]  eksctl version 0.30.0
[ℹ]  Cannot delete cluster that was not created via eksctl (no associated CloudFormation stacks found)

It might be that over time we try to remove more occurrences of 2. and make eksctl smarter. For example at the moment it all of its interaction with creating clusters is through CloudFormation, meaning commands like eksctl delete cluster don't work as if you created the cluster manually it has no CloudFormation stack to delete. This could be overcome by making eksctl more aware of alternative methods of interacting with clusters.

@aclevername
Copy link
Contributor

aclevername commented Oct 30, 2020

Edit: this list is out of date, see #2174 (comment).

I'm working my way through the commands to see what needs to change (will update this comment as I go along):

Works

  1. eksctl get clusters Get clusters states if a cluster was eksctl created #2779
  2. eksctl create iamserviceaccount Allow creation of iamserviceaccounts on clusters not created through eksctl #2775
  3. eksctl create iamidentitymapping
  4. eksctl delete iamserviceaccount
  5. eksctl delete iamidentitymapping
  6. eksctl enable profile
  7. eksctl enable repo
  8. eksctl get cluster
  9. eksctl utils associate-iam-oidc-provider
  10. eksctl utils describe-stacks (not applicable)
  11. eksctl utils install-vpc-controllers
  12. eksctl utils nodegroup-health
  13. eksctl utils set-public-access-cidrs
  14. eksctl utils update-cluster-endpoints
  15. eksctl utils update-cluster-logging
  16. eksctl utils write-kubeconfig
  17. eksctl utils update-coredns
  18. eksctl utils update-aws-node
  19. eksctl utils update-kube-proxy

Needs adjusting

  1. eksctl create fargateprofile (should be simple)
  2. eksctl create nodegroup (difficult, how do we determine what values to use to create the nodegroup)
  3. eksctl delete nodegroup (created a nodegroup manually through the console to test) (support for managed could be added, unmanaged seems unfeasible)
  4. eksctl delete cluster
  5. eksctl delete fargateprofile (could not create a fargateprofile to delete, needs further investigation) (should be simple)
  6. eksctl drain nodegroup
  7. eksctl get nodegroup
  8. eksctl scale nodegroup
  9. eksctl set labels (should be simple)
  10. eksctl unset labels (should be simple)
  11. eksctl update cluster
  12. eksctl upgrade cluster (high priority)
  13. eksctl upgrade nodegroup (used to work in the past, should be simple)

@aclevername
Copy link
Contributor

Split into sub-issues:
#2808
#2809
#2810
#2811
#2812

@aclevername
Copy link
Contributor

aclevername commented Jan 15, 2021

Update list as of 03/02/2021

Works

  1. eksctl get clusters Get clusters states if a cluster was eksctl created #2779
  2. eksctl create iamserviceaccount Allow creation of iamserviceaccounts on clusters not created through eksctl #2775
  3. eksctl create iamidentitymapping
  4. eksctl delete iamserviceaccount
  5. eksctl delete iamidentitymapping
  6. eksctl enable profile
  7. eksctl enable repo
  8. eksctl get cluster
  9. eksctl utils associate-iam-oidc-provider
  10. eksctl utils describe-stacks (not applicable)
  11. eksctl utils install-vpc-controllers
  12. eksctl utils nodegroup-health
  13. eksctl utils set-public-access-cidrs
  14. eksctl utils update-cluster-endpoints
  15. eksctl utils update-cluster-logging
  16. eksctl utils write-kubeconfig
  17. eksctl utils update-coredns
  18. eksctl utils update-aws-node
  19. eksctl utils update-kube-proxy
  20. eksctl delete nodegroup eksctl get/delete/drain support for non-eksctl created managed nodegroups #2809
  21. eksctl drain nodegroup eksctl get/delete/drain support for non-eksctl created managed nodegroups #2809
  22. eksctl get nodegroup eksctl get/delete/drain support for non-eksctl created managed nodegroups #2809
  23. eksctl delete cluster Add support for deleting non-eksctl clusters #2969
  24. eksctl upgrade cluster Support upgrading non eksctl clusters #2815
  25. eksctl upgrade nodegroup Add support for upgrading non eksctl created nodegroups #2953
  26. eksctl set labels Set/Unset/Get labels on unowned nodegroups #3168
  27. eksctl unset labels Set/Unset/Get labels on unowned nodegroups #3168
  28. eksctl get labels Set/Unset/Get labels on unowned nodegroups #3168
  29. eksctl create fargateprofile
  30. eksctl delete fargateprofile Add create fargateprofile support for non-eksctl-managed clusters #3080
  31. eksctl scale nodegroup Add support for scaling non-eksctl created nodegroups #3132

Needs adjusting

  1. eksctl create nodegroup eksctl create nodegroup support for non-eksctl clusters #3077

@aclevername aclevername removed their assignment Jan 18, 2021
@jmolero-cortical
Copy link

Hi @aclevername thanks for you effort. At least in my case, the option 'eksctl upgrade nodegroup' is not working:

% eksctl version 0.36.0

`% eksctl upgrade nodegroup --name=NG-test --cluster=testcluster --kubernetes-version 1.18 --launch-template-version 2
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2d8c2b3]

goroutine 1 [running]:
github.com/weaveworks/eksctl/pkg/actions/nodegroup.(*Manager).upgradeAndWait(0xc0006379e0, 0x7ffeefbffb60, 0x13, 0x7ffeefbffba5, 0x4, 0x7ffeefbffbc4, 0x1, 0x0, 0x0, 0x0)
github.com/weaveworks/eksctl/pkg/actions/nodegroup/upgrade.go:60 +0x753
github.com/weaveworks/eksctl/pkg/actions/nodegroup.(*Manager).Upgrade(0xc0006379e0, 0x7ffeefbffb60, 0x13, 0x7ffeefbffba5, 0x4, 0x7ffeefbffbc4, 0x1, 0x0, 0xc0001ca8b0, 0xc000240d90)
github.com/weaveworks/eksctl/pkg/actions/nodegroup/upgrade.go:38 +0x3e6
github.com/weaveworks/eksctl/pkg/ctl/upgrade.upgradeNodeGroup(0xc0006274a0, 0x7ffeefbffb60, 0x13, 0x7ffeefbffba5, 0x4, 0x7ffeefbffbc4, 0x1, 0x0, 0x1179565, 0xc0000d8400)
github.com/weaveworks/eksctl/pkg/ctl/upgrade/nodegroup.go:86 +0x311
github.com/weaveworks/eksctl/pkg/ctl/upgrade.upgradeNodeGroupCmd.func1(0xc0000da000, 0xc00009cc60, 0x0, 0x6, 0x0, 0x0)
github.com/weaveworks/eksctl/pkg/ctl/upgrade/nodegroup.go:27 +0xef
github.com/spf13/cobra.(*Command).execute(0xc0000da000, 0xc00009cc00, 0x6, 0x6, 0xc0000da000, 0xc00009cc00)
github.com/spf13/[email protected]/command.go:850 +0x47c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000844840, 0xc00064db10, 0x1, 0xc0008e9f70)
github.com/spf13/[email protected]/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
github.com/spf13/[email protected]/command.go:895
main.main()
github.com/weaveworks/eksctl/cmd/eksctl/main.go:76 +0x3ec`

@aclevername
Copy link
Contributor

Hi @aclevername thanks for you effort. At least in my case, the option 'eksctl upgrade nodegroup' is not working:

`% eksctl version

0.36.0`

`% eksctl upgrade nodegroup --name=NG-test --cluster=testcluster --kubernetes-version 1.18 --launch-template-version 2

panic: runtime error: invalid memory address or nil pointer dereference

[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x2d8c2b3]

goroutine 1 [running]:

github.com/weaveworks/eksctl/pkg/actions/nodegroup.(*Manager).upgradeAndWait(0xc0006379e0, 0x7ffeefbffb60, 0x13, 0x7ffeefbffba5, 0x4, 0x7ffeefbffbc4, 0x1, 0x0, 0x0, 0x0)

github.com/weaveworks/eksctl/pkg/actions/nodegroup/upgrade.go:60 +0x753

github.com/weaveworks/eksctl/pkg/actions/nodegroup.(*Manager).Upgrade(0xc0006379e0, 0x7ffeefbffb60, 0x13, 0x7ffeefbffba5, 0x4, 0x7ffeefbffbc4, 0x1, 0x0, 0xc0001ca8b0, 0xc000240d90)

github.com/weaveworks/eksctl/pkg/actions/nodegroup/upgrade.go:38 +0x3e6

github.com/weaveworks/eksctl/pkg/ctl/upgrade.upgradeNodeGroup(0xc0006274a0, 0x7ffeefbffb60, 0x13, 0x7ffeefbffba5, 0x4, 0x7ffeefbffbc4, 0x1, 0x0, 0x1179565, 0xc0000d8400)

github.com/weaveworks/eksctl/pkg/ctl/upgrade/nodegroup.go:86 +0x311

github.com/weaveworks/eksctl/pkg/ctl/upgrade.upgradeNodeGroupCmd.func1(0xc0000da000, 0xc00009cc60, 0x0, 0x6, 0x0, 0x0)

github.com/weaveworks/eksctl/pkg/ctl/upgrade/nodegroup.go:27 +0xef

github.com/spf13/cobra.(*Command).execute(0xc0000da000, 0xc00009cc00, 0x6, 0x6, 0xc0000da000, 0xc00009cc00)

github.com/spf13/[email protected]/command.go:850 +0x47c

github.com/spf13/cobra.(*Command).ExecuteC(0xc000844840, 0xc00064db10, 0x1, 0xc0008e9f70)

github.com/spf13/[email protected]/command.go:958 +0x375

github.com/spf13/cobra.(*Command).Execute(...)

github.com/spf13/[email protected]/command.go:895

main.main()

github.com/weaveworks/eksctl/cmd/eksctl/main.go:76 +0x3ec`

Thanks for reporting the issue! Can you create a new bug report issue with the config file/cluster details? Thanks

@Callisto13
Copy link
Contributor

Callisto13 commented Mar 1, 2021

From 0.40.0 you should be able to use any eksctl command on any EKS cluster. Docs will be updated by the end of the week.

@kalbir
Copy link
Author

kalbir commented Mar 1, 2021

Nice work! Very pleased this has been shipped ☺️

@yysu
Copy link

yysu commented Mar 25, 2021

Can't wait to see this !

@aclevername
Copy link
Contributor

From 0.40.0 you should be able to use any eksctl command on any EKS cluster. Docs will be updated by the end of the week.

Docs will be out with this weeks release, I'm going to close this issue now as the work is done! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request priority/important-longterm Important over the long term, but may not be currently staffed and/or may require multiple releases
Projects
None yet
Development

No branches or pull requests

7 participants