tricorder-observability / Starship

Starship: next-generation Observability platform built with eBPF+WASM
GNU Affero General Public License v3.0
164 stars 24 forks source link

CLI to pick up kubeconfig from kubectl's local config and figure out how to connect with API Server in the cluster #42

Open nascentcore-eng opened 1 year ago

nascentcore-eng commented 1 year ago

Is your feature request related to a problem? Please describe. Right now, users must specify API Server's address in --api-address flag. Typically, this requires using kubectl to get the api-server service, or using kubectl port-forward <api-server-pod> And then copy the address to the command line.

Describe the solution you'd like CLI reads kubectl's kubeconfig, and automatically figure out how to connect with the installed Starship's API Server.

To allow this, we should also change helm-charts to create a fixed namespace tricorder. (It seems not possible https://stackoverflow.com/questions/51783651/how-to-create-a-namespace-if-it-doesnt-exists-from-helm-templates, so we should consider just using yaml templates)

Describe alternatives you've considered There seems no obvious alternatives

Additional context There seems no meaningful additional contexts.

JaredTan95 commented 1 year ago

we can use an easier way, like add an cluster command:

# add our dev cluster
starship-cli cluster add --name starship-dev --api-address http://my-starship-api-server-0.com:8080
# add our test cluster
starship-cli cluster add --name starship-test --api-address http://my-starship-api-server-1.com:8080

# than, wen can switch out cluster using `use` sub-command
starship-cli cluster use starship-dev

# finally, we can delete cluster:
starship-cli cluster delete starship-dev

# also, we need to have `list` 
starship-cli cluster list

In this way, It can reduce our handling of kubeconfig and also reduce some of the workload for us.