fluvio icon indicating copy to clipboard operation
fluvio copied to clipboard

Remove dependency on `kubectl` binary

Open tjtelan opened this issue 3 years ago • 2 comments

Cluster start and cluster checks use the locally installed kubectl.

This is about our usage of kubectl in the Rust code. Not in shell scripts or CI


Calls we need to convert to using k8-api

  • kubectl create secret
  • kubectl delete secret
  • kubectl create service
  • kubectl delete service
  • kubectl auth
  • kubectl logs
  • kubectl get pods
  • kubectl get pvc
  • kubectl get service
  • kubectl get statefulset

And we're using kubectl to collect our CRDs

  • kubectl get spu
  • kubectl get topic
  • kubectl get partition

Instances in the codebase to remove (List maybe not exhaustive. Last updated 12 Oct 2021):

https://github.com/infinyon/fluvio/blob/c9d694a6df687ff24bab1edf20d95c819dc3b987/crates/fluvio-cluster/src/check/mod.rs#L321 https://github.com/infinyon/fluvio/blob/c9d694a6df687ff24bab1edf20d95c819dc3b987/crates/fluvio-cluster/src/check/mod.rs#L819 https://github.com/infinyon/fluvio/blob/c9d694a6df687ff24bab1edf20d95c819dc3b987/crates/fluvio-cluster/src/check/mod.rs#L831 https://github.com/infinyon/fluvio/blob/c9d694a6df687ff24bab1edf20d95c819dc3b987/crates/fluvio-cluster/src/check/mod.rs#L890 https://github.com/infinyon/fluvio/blob/c9d694a6df687ff24bab1edf20d95c819dc3b987/crates/fluvio-cluster/src/start/k8.rs#L1055-L1081

https://github.com/infinyon/fluvio/blob/c9d694a6df687ff24bab1edf20d95c819dc3b987/crates/fluvio-cluster/src/cli/diagnostics.rs#L39-L48 https://github.com/infinyon/fluvio/blob/c9d694a6df687ff24bab1edf20d95c819dc3b987/crates/fluvio-cluster/src/cli/diagnostics.rs#L90-L97 https://github.com/infinyon/fluvio/blob/c9d694a6df687ff24bab1edf20d95c819dc3b987/crates/fluvio-cluster/src/cli/diagnostics.rs#L122

tjtelan avatar May 26 '21 19:05 tjtelan

Stale issue message

github-actions[bot] avatar Dec 12 '21 11:12 github-actions[bot]

I came across this with minikube as the idiomatic way is to pipe alias kubectl via minikube kubectl -- foobar

And then naturally start was complaining about Kubectl not found which I guessed that it wants the executable in some $PATH

I first thought maybe it requires environment variable or maybe the intention was to port to using k8-API -

Too bad there isn't CLI mapping to API so have to translate the CLI calls to programmatic version.

pinkforest avatar Jan 27 '22 23:01 pinkforest