Kubernetes is one of the best orchestration tools for managing containerized applications.
Features of Kubernetes:
1. Open Source
2. Support for multiple OS (Run anywhere)
3. Production Readiness
In this blog, we are going to set up Kubernetes on our local environment through Minikube.
Minikube supports Kubernetes features such as:
- DNS (Domain Name System)
- NodePorts and LoadBalancer
- Secrets etc.
Minikube does not provide support for cloud provider specific features:
I am using Ubuntu 14.04 for setting Minikube cluster.
- Checking that our system supports VT-x/AMD-v virtualization by running this command:
cat /proc/cpuinfo | grep ‘vmx\|svm’
if this command gives an output then it’s good.
- Currently, Minikube supports:
- Installing recent VirtualBox or VMWare fusion. We will be using VirtualBox.
sudo apt-get install virtualbox
Now let’s get started:
- Downloading binaries:
minikube binaries:kubectl binaries:
For different k8s version, follow the link:
- Starting our Kubernetes cluster:
We can also specify which driver we want to use by “minikube start –vm-driver=xx”
Now as we can see our minikube cluster has been configured. Also, a hidden directory in our home has been created “.minikube” where all the configurations and ssh key, certificates etc. are stored.
- Checking the status of minikube:
- Let’s see how many pods are running:
kubectl get pods –all-namespaces
- Getting nodes:
kubectl get nodes
- Minikube dashboard:
- Now we can deploy all our applications by dashboard or through kubectl commands.
Let’s deploy a Nginx application by kubectl command line interface:
- kubectl run command will create a deployment
[js] kubectl run my-nginx –image=nginx –replicas=1 –port=80 [/js]
- Checking if our pod is up and running
[js]kubectl get pods[/js]
- If we want to go inside our node, just type minikube ssh
Now, we can see that “my-nginx” deployment has been created and can be seen on our dashboard
With the above steps, you can now setup minikube and test out your application locally instead of running on servers or cloud.