Monday, February 12, 2024

What is MiniKube ?

Kubernetes can be used in various environments to suit different use cases.


1) Minikube:

    Use Case: Minikube is designed for local development and testing purposes.

    Scenario: Developers often use Minikube to set up a small, single-node Kubernetes cluster on their local machines. It provides a lightweight and convenient         way to experiment with Kubernetes features and deploy applications in a local environment.


2) One Worker and Multiple Nodes:

    Use Case: This setup is suitable for small-scale or resource-constrained environments where you have one physical or virtual machine acting as the worker     node and multiple nodes within that machine.

    Scenario: It can be useful for scenarios where you want to experiment with multi-node configurations but have limitations on the number of physical or         virtual machines available.
    
3) Multiple Workers and Multiple Nodes:

    Use Case: This is a common deployment scenario for production environments and larger-scale applications.
    
    Scenario: In a multi-worker, multi-node setup, you have multiple physical or virtual machines (workers) each running one or more nodes. This distributed         architecture allows for better resource utilization, scalability, and high availability. It's well-suited for handling larger workloads and ensuring         redundancy in case of node failures.



What is Minikube ?

Minikube is a tool that allows you to run a small, single-node Kubernetes cluster on your own computer. It's designed for local development and testing purpose.


Install Minikube On Ubuntu

System Prerequisites:

    2 CPUs or more
    2GB of free memory
    20GB of free disk space


curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb


Step 2: Start Minikube Cluster

minikube start
minikube status

To verify the minikube version, run

$ minikube version

Verify the kubectl version, run

$  kubectl version -o yaml

Start Minikube Cluster

$ minikube start --driver=docker
$ minikube status

Creating TestPod by using yml file.

$ vim pod1.yml

kind: Pod
apiVersion: v1
metadata:
  name: testpod
spec:
  containers:
    - name: c00
      image: ubuntu
      command: ["/bin/bash", "-c", "while true; do echo Hello-Bhupinder; sleep 5 ; done"]
  restartPolicy: Never         # Defaults to Always

kubectl apply -f pod1.yml

$ kubectl get pods
$ kubectl get pods -o wide
$ kubectl describe pod testpod

$ kubectl logs -f pod-name
$ kubectl logs -f pod-name -c container-name
 

No comments:

Post a Comment

testing