Skip to content

SevginGalibov/Keda-HTTP-Add-On-Scaling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bu proje hakkında Türkçe Dil için (docs/README.tr.md) dökümanlarına göz atın.

Kubernetes KEDA HTTP Add-on Load Test and Auto-scaling Guide

This guide explains how to perform load testing and auto-scaling using KEDA and HTTP Add-on in a Kubernetes environment. Follow the steps below to set up your environment and conduct tests.


Step 1: Create a Kubernetes Cluster (with Kind)

Create a local Kubernetes cluster using Kind (Kubernetes in Docker) by running the following command:

kind create cluster --config kind-ingress-config.yaml

Creating Cluster


Step 2: Install NGINX Ingress Controller

Install the NGINX Ingress Controller to manage ingress traffic:

kubectl apply --filename https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/provider/kind/deploy.yaml

Verify that the ingress controller has been installed successfully:

kubectl get pods -n ingress-nginx

Ingress Controller Pods


Step 3: Install the KEDA Operator

Install the KEDA operator using Helm:

helm repo add kedacore https://kedacore.github.io/charts
helm repo update
helm install keda kedacore/keda --namespace keda --create-namespace

KEDA Operator Installation


Step 4: Install the KEDA HTTP Add-on

Install the KEDA HTTP Add-on by running:

helm install http-add-on kedacore/keda-add-ons-http --namespace keda

Check that the HTTP Add-on components are running:

kubectl get pods -n keda

HTTP Add-on Pods


Step 5: Deploy Application and Services

Deploy a test Deployment, Service, and HTTPScaledObject resources.

  1. Create a namespace:

    kubectl create ns test
  2. Apply application and service resources:

    kubectl apply -f nginx-app.yaml -n test
    kubectl apply -f external-proxy-service.yaml -n test
    kubectl apply -f httpscaleobject.yaml -n test
  3. Verify that the resources have been successfully created:

    kubectl get all -n test

Application and Service Deployment


Step 6: Perform Load Testing (with K6)

To perform a load test using K6, create and save the following script (k6-load.js):

import http from 'k6/http';
import { sleep } from 'k6';

export const options = {
    vus: 50,               // 50 virtual users concurrently
    duration: '600s',      // Test duration of 10 minutes
};

export default function () {
    const url = 'http://127.0.0.1';

    const params = {
        headers: {
            'Host': 'www.sevgin.com',
        },
    };

    http.get(url, params);
    sleep(1);
}

Run the load test using:

k6 run k6-load.js

K6 Load Test


Step 7: Monitor Pod Scaling

During the load test, KEDA HTTP Add-on will automatically scale the number of pods. To monitor the scaling activity, run:

kubectl get pods -w -n test

Pods status

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published