Running Kubernetes Locally via Minikube
Quickstart
minikube startStarting local Kubernetes cluster...
Running pre-create checks...
Creating machine...
Starting local Kubernetes cluster...kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.10 --port=8080deployment.apps/hello-minikube createdkubectl expose deployment hello-minikube --type=NodePortservice/hello-minikube exposedWe have now launched an echoserver pod but we have to wait until the pod is up before curling/accessing it via the exposed service. To check whether the pod is up and running we can use the following:
kubectl get podNAME READY STATUS RESTARTS AGE
hello-minikube-3383150820-vctvh 0/1 ContainerCreating 0 3sWe can see that the pod is still being created from the ContainerCreating status kubectl get pod
NAME READY STATUS RESTARTS AGE
hello-minikube-3383150820-vctvh 1/1 Running 0 13sWe can see that the pod is now Running and we will now be able to curl it:
curl $(minikube service hello-minikube --url)
Hostname: hello-minikube-7c77b68cff-8wdzq
Pod Information:
-no pod information available-
Server values:
server_version=nginx: 1.13.3 - lua: 10008
Request Information:
client_address=172.17.0.1
method=GET
real path=/
query=
request_version=1.1
request_scheme=http
request_uri=http://192.168.99.100:8080/
Request Headers:
accept=*/*
host=192.168.99.100:30674
user-agent=curl/7.47.0
Request Body:
-no body in request-kubectl delete services hello-minikubeservice "hello-minikube" deletedkubectl delete deployment hello-minikubedeployment.extensions "hello-minikube" deletedminikube stopStopping local Kubernetes cluster...
Stopping "minikube"...Last updated
Was this helpful?