DevOps(Day-31) : Launching your First Kubernetes Cluster

DevOps(Day-31) : Launching your First Kubernetes Cluster

TABLE OF CONTENTS

Minikube

It is considered a local Kubernetes which makes it easy to use all K8s applications on your VMs. Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing only one node. Minikube is available for Linux, macOS, and Windows systems. The Minikube CLI provides basic bootstrapping operations for working with your cluster, including start, stop, status, and delete.

Features of Minikube

  1. Supports the latest Kubernetes release (+6 previous minor versions)

  2. Cross-platform (Linux, macOS, Windows)

  3. Deploy as a VM, a container, or on bare-metal

  4. Multiple container runtimes (CRI-O, containers, docker)

  5. Direct API endpoint for blazing-fast image load and build.

  6. Advanced features such as LoadBalancer, filesystem mounts, FeatureGates, and network policy.

  7. Addons for easily installed Kubernetes applications.

  8. Supports common CI environments**.**

Task-01: Install Minikube on your local

  1. Create an EC2 instance with t2.medium configuration as the minimum CPU required for Kubernetes to run is 2.

  2. Login to the server and then install Docker.

  3. Navigate to the Minikube installation page and select the required settings for installing on a Linux machine.

  4. Use the below command to install minikube.

    COPY

       curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube
    

  5. Now start the minikube and make sure to set the driver as Docker.

  6. Now install kubectl in your system and check the configuration.

POD

POD is the smallest deployable unit that you can create and manage in Kubernetes. A POD is a collection of one or more containers that share the same network, storage configuration and specification. A Pod is similar to a set of containers with shared namespaces and shared filesystem volumes.

Pods also provide environmental dependencies, including storage that is permanent and available to all pods in the cluster and configuration data needed to run the containers within the pod.

Benefits of using a POD

  1. POD contains one or more containers, so it becomes easy to communicate and share data among them using their IP addresses.

  2. Pods simplify scalability, enabling replica pods to be created and shut down automatically based on changes in demand.

The syntax for creating a POD

    - containerPort: <port with which container to be mapped>

Task-02: Create your first pod on Kubernetes through Minikube

  1. Let's pull a Reddit-clone image that we had already pushed as a part of my project a few days back. This image is there in my DockerHub repository.

  2. Write the pod.yml file with the proper syntax.

  3. Run the pod.yml file by using the below command.

    COPY

      kubectl apply -f <yaml file name>
    

  4. Check if the POD is running.

Thanks for reading my article. Have a nice day.

WRITTEN BY Biswaraj Sahoo --AWS Community Builder | DevOps Engineer | Docker | Linux | Jenkins | AWS | Git | Terraform | Docker | kubernetes

Empowering communities via open source and education. Connect with me over linktree: linktr.ee/biswaraj333