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

Changing the way that Civo CLI handles kubeconfig #496

Open
fernando-villalba opened this issue Jan 23, 2025 · 1 comment
Open

Changing the way that Civo CLI handles kubeconfig #496

fernando-villalba opened this issue Jan 23, 2025 · 1 comment

Comments

@fernando-villalba
Copy link
Contributor

Description

Currently if you want to create a cluster with Civo and want it to save the kubeconfig the list of commands is so tedious, you need to do the following:

civo kubernetes create --save --switch --merge --wait

Using just --save has two significant issues:

  1. You get asked to use --wait as well, this should be implicit!
  2. It asks if it's okay to overwrite the entire kubeconfig file. This should never ever be done by our CLI, we should never overwrite the entire user's kubeconfig

In addition, we also don't have a command to update a user's kubeconfig post cluster creation, let's say the user wanted to use --save but forgot, or perhaps created the cluster with the dashboard.

Acceptance Criteria

I propose we change the behaviour like so:

  • Get rid of --switch and --merge and make it the default when a user uses the --save flag

  • Keep the --wait flag but don't make it mandatory to be used with --save, instead make it implicit.

  • Do NOT overwrite the entire user's kubeconfig under any circumstances, always merge and switch

  • When a user does civo kubernetes delete add a flag to it called --kubeconfig-context (or something like that) that deletes the kubeconfig context of that particular cluster if found on the kubeconfig, if not found, go ahead and delete the cluster anyway but output a message that kubeconfig context was not found. Again, NEVER delete the entire user's kubeconfig, just the context of the selected cluster and be careful to remove any ambiguity.

  • Add a civo command like civo kubernetes update-kubeconfig that will fetch the config of the specified cluster, update kubeconfig and switch to that configuration.

@kanha-gupta
Copy link

Hi @fernando-villalba can you assign this to me ?
Thanks

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

2 participants