Skip to content

This repo contains basic notes about kubernetes like its Architecture, components and how to use kubernetes using kubectl

Notifications You must be signed in to change notification settings

hpatel292-seneca/Learning-Kubernetes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Learning-Kubernetes

What is Kubernetes?

  • Kubernetes is an open source Container Orchestration tool.

What is Container Orchestration??

Container Orchestration is a process of automatically managing and coordinating a large number containers. It manage task like

  • Starting and Stopping containers
  • Placing containers on right machine
  • Scaling containers up and down based on usage
  • Restart containers on failures

Kubernetes helps you manage containerized application in different environment like on-permise, Cloud, Hybrid setup. It ensures you application runs effectively, remain scalable, and are resilient to failures, without you having to manage containers manually.

Why Kubernetes was developed??

Kubernetes was developed by Google and later open-sourced to help manage the complex challenges of deploying and running large-scale containerized applications. Before Kubernetes, Google used its internal system called Borg, which inspired Kubernetes.

Need for Container Orchestration tool:

As Container adoption grew, so did the complexity for managing those containers. Here are few reasons why Kubernetes became essential:

  1. Manual Management is Inefficient: Managing containers manually becomes overwhelming when there are hundreds or thousands of them running across multiple servers.

  2. Scaling: Applications need to handle changing workloads. Orchestration tools automatically scale containers up or down based on demand.

  3. Load Balancing: They distribute traffic evenly across containers to prevent overloading a few while others remain idle.

  4. High Availability: Orchestration tools detect and restart failed containers, ensuring applications are always running.

  5. Resource Optimization: Efficiently utilizes available hardware resources by placing containers on the best-fit servers.

  6. Environment Agnostic: Orchestration tools abstract the underlying infrastructure, allowing you to run the same containerized application in development, testing, and production environments.

  7. Automation: They automate tasks like container deployment, updates, rollbacks, and networking, saving time and reducing errors.

Minikube and kubectl: Overview and Usage

Minikube

Minikube is a tool designed for local Kubernetes testing and development. It allows you to run a single-node Kubernetes cluster on your local machine. Here's a detailed explanation:

  1. Purpose of Minikube:

    • In a production Kubernetes cluster, there are typically multiple master nodes and worker nodes, each running on separate virtual or physical machines.
    • Setting up such a cluster locally for testing can be resource-intensive and impractical.
    • Minikube solves this by running both master processes and worker processes on a single node in a lightweight environment.
  2. How Minikube Works:

    • Minikube creates a virtual machine (VM) using tools like VirtualBox or other hypervisors.
    • Within this VM, Minikube runs a single-node Kubernetes cluster with:
      • Master components (e.g., API Server, Scheduler, Controller Manager, etcd).
      • Worker components (e.g., kubelet, kube-proxy, container runtime).
    • This setup includes a pre-installed Docker container runtime to facilitate running containers inside pods.
  3. Use Case:

    • Ideal for testing and experimenting with Kubernetes locally.
    • Enables quick deployment and configuration of Kubernetes components on a laptop or PC without requiring a full-scale cluster setup.
  4. Key Features:

    • Lightweight and simple to set up.
    • Mimics a Kubernetes cluster for local development and testing.

kubectl

kubectl is the command-line tool used to interact with Kubernetes clusters, including Minikube. Here's how it fits into the setup:

  1. Purpose of kubectl:

    • Enables users to manage Kubernetes clusters by submitting commands to the API Server, one of the master processes in the cluster.
    • Supports creating, configuring, and managing Kubernetes components like pods, services, and deployments.
  2. How kubectl Works:

    • The API Server is the primary entry point into the Kubernetes cluster.
    • Commands issued through kubectl are sent to the API Server, which validates them and passes them to the appropriate master or worker processes for execution.
    • For example:
      • Creating a pod: kubectl sends the request to the API Server, which forwards it to the scheduler, kubelet, or other processes for execution.
      • Deleting a pod or service: kubectl sends the deletion request, which the API Server processes accordingly.
  3. Versatility:

    • While designed for Minikube, kubectl can also be used with other Kubernetes setups, including:
      • Cloud-based clusters (e.g., Google Kubernetes Engine, AWS EKS).
      • Hybrid clusters (a combination of on-premises and cloud-based nodes).
  4. Advantages of kubectl:

    • Comprehensive: Allows full control over Kubernetes clusters.
    • Flexible: Works with Minikube as well as production-grade clusters.
    • Command-line power: Facilitates automation and scripting for Kubernetes management tasks.

Key Points to Remember:

  • Minikube:

    • A single-node Kubernetes cluster for local development.
    • Runs both master and worker processes on the same virtual machine.
    • Provides a convenient way to test Kubernetes without needing multiple nodes or significant resources.
  • kubectl:

    • A command-line tool to interact with Kubernetes clusters.
    • Works by communicating with the API Server.
    • Supports Minikube and all other Kubernetes environments, making it a universal tool for Kubernetes management.

By combining Minikube and kubectl, you can easily set up a local Kubernetes cluster for learning, development, and testing purposes.

About

This repo contains basic notes about kubernetes like its Architecture, components and how to use kubernetes using kubectl

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published