Table of contents
Task-01:
Install Minikube on Your Local
A Simple Installation Guide
minikube start
Step 1
To install the latest minikube stable release on x86-64 Linux using binary download:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Step 2
Start your cluster
From a terminal with administrator access (but not logged in as root), run:
minikube start
Interact with your cluster
If you already have kubectl installed (see documentation), you can now use it to access your shiny new cluster:
kubectl get po -A
Alternatively, minikube can download the appropriate version of kubectl and you should be able to use it like this:
minikube kubectl -- get po -A
You can also make your life easier by adding the following to your shell config
alias kubectl="minikube kubectl --"
What is minikube?
Minikube is an open-source tool that facilitates running Kubernetes clusters locally on a single machine. Kubernetes is a powerful container orchestration platform used for automating the deployment, scaling, and management of containerized applications. Minikube allows developers to set up a lightweight, single-node Kubernetes cluster on their local development machines for testing and experimentation.
Key features of Minikube include:
Local Kubernetes Cluster: Minikube provides a simplified way to run a local Kubernetes cluster on your laptop or workstation.
Isolation: It isolates the Kubernetes environment from the rest of the system, ensuring that the local cluster doesn't interfere with other installed software.
Easy Setup: Minikube aims to make it easy to set up and use Kubernetes locally. It can be particularly useful for developers who want to test their applications in a Kubernetes environment without the need for a full-scale, production-like cluster.
Support for Hypervisors and Containers: Minikube supports various hypervisors, such as VirtualBox, Hyper-V, and KVM, allowing users to choose the virtualization technology that best fits their environment. It also supports container runtimes like Docker and containerd.
Integration with kubectl: Minikube seamlessly integrates with kubectl, the command-line tool for interacting with Kubernetes clusters. This allows developers to use familiar commands to manage the local cluster.
Addon Support: Minikube supports various add-ons that extend the functionality of the local Kubernetes cluster, such as the Kubernetes Dashboard, Heapster, and more.
Using Minikube, developers can develop, test, and debug their applications in a Kubernetes environment without the need for a dedicated cloud or on-premises Kubernetes cluster. It's a valuable tool for those who want to get hands-on experience with Kubernetes or for teams looking to streamline their development workflows.
Features of minikube
Ans :- Features of minikube:
(a) Supports the latest Kubernetes release (+6 previous minor versions)
(b) Cross-platform (Linux, macOS, Windows)
(c) Deploy as a VM, a container, or on bare-metal
(d) Multiple container runtimes (CRI-O, containerd, docker)
(e) Direct API endpoint for blazing fast image load and build
(f) Advanced features such as LoadBalancer, filesystem mounts, FeatureGates, and network policy
(g) Addons for easily installed Kubernetes applications
(h) Supports common CI environments
Task-02:
Create your first pod on Kubernetes through minikube.
Let's create a folder for the pod.
mkdir Minikube_Project
Let's Deploy Nginx!
Let's create a namespace for the Nginx pod.
kubectl create namespace nginx
kubectl get namespaces
Now, Create YAML Configuration: Define a simple YAML file describing your Nginx pod. Create a pod.yml
vi pod.yml
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
spec:
containers:
- name: nginx-container
image: nginx:latest
ports:
- containerPort: 80
Apply Configuration:
Use the kubectl apply command to create the pod.
kubectl apply -f pod.yml
Check Pod Status:
Confirm the pod's creation and its running status.
kubectl get pods
That's it! You've just completed the task. 🎉 Thank you so much for taking the time to read till the end! Hope you found this blog informative and helpful.