How to Install Minikube in Amazon Linux
Kubernetes is a container management tool. It is Donated by Google to the Opensource community. It has now become the defacto container management tool of choice.
In Kubernetes setup we have one master node and multiple worker nodes. The worker-nodes are then managed from the master node, thus ensuring that the cluster is managed from a central point.
You can also deploy a single-node Kubernetes cluster. You can use Minikube, which is a tool that runs a single-node Kubernetes cluster in a virtual machine on your node.
minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes.
All you need is Docker (or similarly compatible) container or a Virtual Machine environment, and Kubernetes is a single command away: minikube start
What you’ll need
- 2 CPUs or more
- 2GB of free memory
- 20GB of free disk space
- Internet connection
- Container or virtual machine manager, such as: Docker, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMWare
Docker Installation
Minkube Installation
Binary download
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
OR
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube-linux-amd64
mv minikube-linux-amd64 /usr/local/bin/minikube
minikube version
install minikube_amazon_linux |
Start your cluster
From a terminal with administrator access (but not logged in as root), run:
minikube start --vm-driver=none
minikube_install_amazon_linux2 |
If you already have kubectl installed, you can now use it to access your shiny new cluster:
kubectl get po -A
How to Install kubectl on Linux
Alternatively, minikube can download the appropriate version of kubectl, if you don’t mind the double-dashes in the command-line:
minikube kubectl -- get po -A
Deploy applications
Create a sample deployment and expose it on port 8080:
kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment hello-minikube --type=NodePort --port=8080
It may take a moment, but your deployment will soon show up when you run:
kubectl get services hello-minikube
The easiest way to access this service is to let minikube launch a web browser for you:
minikube service hello-minikube
Alternatively, use kubectl to forward the port:
kubectl port-forward service/hello-minikube 7080:8080
Tada! Your application is now available at http://localhost:7080/
Manage your cluster
Pause Kubernetes without impacting deployed applications:
minikube pause
Halt the cluster:
minikube stop
Delete all of the minikube clusters:
minikube delete --all
No comments