user3565923
user3565923

Reputation: 340

Minikube's kubectl path. Where is kubectl?

Kubectl is included with minicube. I use it. I need path to minikube's kubectl to use VS Code's Kubernetes extension. I don't want to install kubectl separetely

Chat GPT suggested me:

echo "$(minikube kubectl -- get pods | grep -o '/.*kubectl')"

But there is no output.

It also pointed me to

<Minikube Installation Directory>/k8s/bin/kubectl

But there is no bin directory in k8s directory.

Manual search returned:

/proc/2103/task/2103/cwd/cache/linux/amd64/v1.27.4/kubectl

/proc/2103/cwd/cache/linux/amd64/v1.27.4/kubectl

But those paths are weird and I don't know if safe to use.

Upvotes: 0

Views: 367

Answers (1)

Dumisani Kunene
Dumisani Kunene

Reputation: 739

You can set a kubectl alias for minikube kubectl executable in your as suggested here Use kubectl inside minikube.

alias kubectl="minikube kubectl --"

In my case, I set this in ~/.bashrc, and then source $HOME/.bashrc. So that it becomes available in my terminal.

Upvotes: 0

Related Questions