DEV Community

Pierangelo
Pierangelo

Posted on

Install Minikube and Kubernetes on ubuntu 18

Minikube is a tool that allow you to run Kubernetes locally, running a single-node Kubernetes cluster inside a VM on your local machine.It's the ideal tool for move the firsts step into the wide world of Kubernetes.

Install Minikube:

Before to install minikube you need to install an Hypervisor, in my case i will install Virtualbox.

download and install with curl:

curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.30.0/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube
Enter fullscreen mode Exit fullscreen mode

Install kubectl

kubectl is the Kubernetes command-line tool to deploy and manage applications on Kubernetes.

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
Enter fullscreen mode Exit fullscreen mode

Make the kubectl binary executable.

chmod +x ./kubectl
Enter fullscreen mode Exit fullscreen mode

Move into the path:

sudo mv ./kubectl /usr/local/bin/kubectl
Enter fullscreen mode Exit fullscreen mode

Test minikube and Kubectl:

start minikube:

minikube start
Enter fullscreen mode Exit fullscreen mode

check if minikube running:

minikube status
Enter fullscreen mode Exit fullscreen mode

create a pods on minikube with kubectl:

kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080
Enter fullscreen mode Exit fullscreen mode

expose the pods:

kubectl expose deployment hello-minikube --type=NodePort
Enter fullscreen mode Exit fullscreen mode

get the url:

minikube service hello-minikube --url
Enter fullscreen mode Exit fullscreen mode

stop minikube:

minikube stop
Enter fullscreen mode Exit fullscreen mode

Oldest comments (0)