Better informaation for using kubectl inside minikube
Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com> add kubectl install link Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com> add alias tip to the minikube docs Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com> remove debug statements Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>pull/8519/head
parent
bf2d09d10a
commit
30e6660925
|
@ -369,6 +369,8 @@ func showKubectlInfo(kcs *kubeconfig.Settings, k8sVersion string, machineName st
|
||||||
|
|
||||||
path, err := exec.LookPath("kubectl")
|
path, err := exec.LookPath("kubectl")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
out.ErrT(out.Kubectl, "Kubectl not found in your path")
|
||||||
|
out.ErrT(out.Workaround, "You can use kubectl inside minikube. For more information, visit https://minikube.sigs.k8s.io/docs/handbook/kubectl/")
|
||||||
out.ErrT(out.Tip, "For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/")
|
out.ErrT(out.Tip, "For best results, install kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
title: "Kubectl"
|
||||||
|
weight: 2
|
||||||
|
description: >
|
||||||
|
Use kubectl inside minikube
|
||||||
|
aliases:
|
||||||
|
- /docs/kubectl/
|
||||||
|
---
|
||||||
|
|
||||||
|
By default, [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) gets configured to access the kubernetes cluster control plane
|
||||||
|
inside minikube when the `minikube start` command is executed.
|
||||||
|
|
||||||
|
However if `kubectl` is not installed locally, kubectl can be used inside the minikube
|
||||||
|
as well.
|
||||||
|
|
||||||
|
`minikube kubectl -- <kubectl commands>`
|
||||||
|
|
||||||
|
You can also `alias kubectl=minikube kubectl --` for easier usage.
|
||||||
|
|
||||||
|
Get pods
|
||||||
|
|
||||||
|
`minikube kubectl -- get pods`
|
||||||
|
|
||||||
|
Creating a deployment inside kubernetes cluster
|
||||||
|
|
||||||
|
`minikube kubectl -- create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4`
|
||||||
|
|
||||||
|
Exposing the deployment with a NodePort service
|
||||||
|
|
||||||
|
`minikube kubectl -- expose deployment hello-minikube --type=NodePort --port=8080`
|
||||||
|
|
||||||
|
For more help
|
||||||
|
|
||||||
|
`minikube kubectl -- --help`
|
Loading…
Reference in New Issue