Giter Club home page Giter Club logo

load-balancing-in-k8s's Introduction

load-balancing-in-k8s

Creating A Load Balancer using kubernetes

Kubernetes Architecture

image

Why Load Balancing is required?

Real-life examples of load balancing used in production environments

Load Balancing in K8s

Kubernetes Cluster Setup

Install minikube, kubectl on your system.

Minikube is used to create a local K8s cluster. After installing minikube, run the following commands to start a minikube cluster on docker.

  • Create a Kubernetes cluster: You need to have a Kubernetes cluster running on Fedora. You can use a tool like kubeadm to create a cluster.
  • Create a deployment: You need to create a deployment that defines the pods that will run your application. You can use a YAML file to define the deployment.
  • Create a service: You need to create a service that exposes your deployment to the network. You can use a YAML file to define the service. In the YAML file, you can specify the type field as LoadBalancer to create a load balancer service.
  • Deploy the service: You can deploy the service using the kubectl create command.

Step 1: minikube start --driver=kvm2

image

It will perform the following tasks:

  • Starting control plane node minikube in cluster minikube
  • Pulling base image ...

    gcr.io/k8s-minikube/kicbase..

  • Preparing Kubernetes v1.28.3 on kvm.
  • kubectl is now configured to use "minikube" cluster and "default" namespace by default

Reference: https://minikube.sigs.k8s.io/docs/drivers/kvm2/

Step 2: Deployment of minikube(kubernetes cluster)

kubectl apply -f deployment.yaml

You should get an output similar to this:

    service/flask-test-service created
    deployment.apps/flask-test-app created

Step 3:

kubectl get po -A

image

kubectl get po

image

kubectl get svc

image

minikube dashboard

image

On the browser,

image

image

You can access your flask application in your local host browser.

minikube service flask-test-service

image

image

Reference: https://minikube.sigs.k8s.io/docs/start/ https://minikube.sigs.k8s.io/docs/drivers/kvm2/

Docker Hub

image

load-balancing-in-k8s's People

Contributors

chococandy63 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.