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

[feat] Make the cluster flag -c <cluster-name> optional #176

Open
csantanapr opened this issue May 29, 2024 · 1 comment
Open

[feat] Make the cluster flag -c <cluster-name> optional #176

csantanapr opened this issue May 29, 2024 · 1 comment

Comments

@csantanapr
Copy link
Member

csantanapr commented May 29, 2024

I would love to avoid to remember to pass the cluster name when I only have one cluster if I run eksdemo get cluster

Running a command like this when I have only 1 cluster Error: required flag(s) "cluster" not set

eksdemo get node
...
Error: required flag(s) "cluster" not set

or

eksdemo install aws-lb-controller --dry-run
...
Error: required flag(s) "cluster" not set

The UX I would like to see to make it easier to run use the CLI when working with a cluster

  1. Create cluster
eksdemo create cluster blue
  1. make sure you have 1 cluster
eksdemo get cluster

+------------+--------+---------+---------+----------+----------+
|    Age     | Status | Cluster | Version | Platform | Endpoint |
+------------+--------+---------+---------+----------+----------+
| 57 minutes | ACTIVE | *blue   |    1.29 | eks.7    | Public   |
+------------+--------+---------+---------+----------+----------+
* Indicates current context in local kubeconfig
  1. Install AWS ALB Controller
eksdemo install aws-lb-controller

Additional context:
We could potentially assume the cluster in context in local kubeconfig could be the cluster to select if the flag -c is not passed, maybe the logic to implement would easier assuming the flag is always optional and it will select what ever cluster is in the context in local kubeconfig.

@csantanapr csantanapr changed the title [feat] Make the cluster flag -c <cluster-name> optional when working with one cluster [feat] Make the cluster flag -c <cluster-name> optional May 29, 2024
@aaroniscode
Copy link
Contributor

Thanks for the feature request @csantanapr . I do like the idea of making eksdemo even easier to use!

Let me noodle on this for a bit on how best to implement. I had thought about this a while ago thinking about making it a setting, that would be saved on disk using and read at runtime using Viper.

While I'm all for making eksdemo easier to use, I do want to implement this with "least surprise" and want to avoid ever installing to a cluster you didn't intend.

I think you could argue this is similar to Helm as it will install in the current Kubeconfig context and if you want to override you use -c cluster just like Helm offers --kube-context.

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