Table of contents
No headings in the article.
Minikube is an open-source tool that enables you to run a single-node Kubernetes cluster locally on your computer. It is designed to simplify the process of setting up and testing Kubernetes applications in a development or testing environment.
Why we need minikube?
Here are some reasons why you might use Minikube:
Local Development: Minikube allows developers to run and test Kubernetes applications on their local machines without the need for a full-scale production cluster. It provides an isolated environment where you can experiment with different configurations, deploy and test your applications, and iterate quickly.
Learning and Training: If you're new to Kubernetes or want to learn more about how it works, Minikube provides a convenient way to set up a small-scale cluster on your local machine. You can experiment with different Kubernetes features, try out different deployment scenarios, and gain hands-on experience without the complexity of a full-scale production environment.
Testing and Debugging: Minikube makes it easier to test and debug your applications before deploying them to a production Kubernetes cluster. You can simulate a multi-node cluster environment on a single machine, test how your application behaves under different conditions, and identify and fix issues early in the development cycle.
Continuous Integration/Continuous Deployment (CI/CD): Minikube can be integrated into your CI/CD pipelines to automate the testing and deployment of your Kubernetes applications. You can set up Minikube as part of your testing infrastructure to ensure that your applications work correctly before deploying them to a production cluster.
Compatibility and Portability: Minikube provides a consistent environment across different operating systems, making it easier to develop and share Kubernetes applications across teams. It helps ensure that your applications work correctly regardless of the underlying infrastructure or operating system.
Overall, Minikube is a valuable tool for developers and teams working with Kubernetes, offering a lightweight and portable way to run and test applications locally.
Installation and configuration steps for AWS EC2 and Minikube:-
Step1: Login to the AWS console and create one EC2 instance using the below configurations:
Select Ubuntu server 22.04 LTS AMI image and Instance type t2.medium because we need 2 vCPU and a minimum of 4 GiB memory then create a new key pair and security group for this instance.
Step2: Install Docker using the below commands:
sudo apt update && apt -y install docker.io
docker –version
When you install Docker, you may need to add the Docker binary directory to your system's PATH environment variable
export PATH=$PATH:/path/to/docker/directory
You need to enter the below command to reload or apply changes made to the ~/.bashrc file in the Bash shell.
source ~/.bashrc
Step3: Download the latest Kubernetes release with the command:
curl -Lo kubectl [storage.googleapis.com/kubernetes-release/r.. -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl/bin/linux/amd64/kubectl)
Now Make the kubectl binary executable
chmod +x kubectl
Step4: Install minikube:
Download the Minikube binary
curl -LO storage.googleapis.com/minikube/releases/la..
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Check minikube status:
Step5:
minikube status
Start the minikube using the below command
minikube start - -force
This means your minikube is started.
You can also check kubernetes cluster info using “kubectl cluster-info” command
if it is giving error then enter below command. (if minikube start --vm-driver=none or docker)
sudo sysctl fs.protected_regular=0
Test to ensure the version you installed is up-to-date:
kubectl cluster-info
kubectl version
You can create a pod using the below.
Thank you..!