beckn / beckn-onix

beckn onix
MIT License
63 stars 28 forks source link

Kubernetes Setup - Create Documentation for Horizontal Scaling #116

Open PritiEM opened 5 months ago

PritiEM commented 5 months ago

Description

Create landscape and documentation for horizontal scaling setup in Kubernetes for Beckn.

Goals

Expected Outcome

A detailed documentation guide on setting up horizontal scaling in Kubernetes tailored for Beckn.

Acceptance Criteria

Mockups / Wireframes

Not applicable

Product Name

Beckn

Domain

Kubernetes Setup

Tech Skills Needed

Complexity

Medium

Category

Infrastructure

prasad-takale-eminds commented 4 months ago

For Horizontal scaling in k8s, we need to create one service using k8s yaml file. This file will include all the required information. Below is the sample file which is used for auto-scaling. Below is the explanation of how auto scale will work for the sample file. Scale Up: If the current CPU utilization of the pods is 70%, the HPA will add more pods to bring the average utilization down towards 50%. Scale Down: If the current CPU utilization of the pods is 30%, the HPA will remove some pods to bring the average utilization up towards 50%.


kind: HorizontalPodAutoscaler
metadata:
  name: my-app-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  minReplicas: 2
  maxReplicas: 10
  targetCPUUtilizationPercentage: 50