Skip to content

Commit 0ba249a

Browse files
Merge pull request #2385 from madeline-underwood/kedify
Kedify_JA to review
2 parents b5b6abe + ee56b4c commit 0ba249a

File tree

4 files changed

+128
-135
lines changed

4 files changed

+128
-135
lines changed

content/learning-paths/servers-and-cloud-computing/kedify-http-autoscaling/_index.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
---
2-
title: Autoscaling HTTP applications on Kubernetes
2+
title: Autoscale HTTP applications on Kubernetes with KEDA and Kedify
33

4-
draft: true
5-
cascade:
6-
draft: true
7-
84
minutes_to_complete: 45
95

10-
who_is_this_for: This is an introductory topic for developers running HTTP-based workloads on Kubernetes who want to enable event-driven autoscaling.
6+
who_is_this_for: This is an introductory topic for developers running HTTP workloads on Kubernetes who want to enable event-driven autoscaling with KEDA and Kedify.
117

128
learning_objectives:
13-
- Install Kedify (KEDA build, HTTP Scaler, and Kedify Agent) via Helm
14-
- Verify that the components are running in your cluster
9+
- Install Kedify (KEDA build, HTTP Scaler, and Kedify Agent) with Helm
10+
- Verify that Kedify and KEDA components are running in the cluster
1511
- Deploy a sample HTTP application and test autoscaling behavior
1612

1713
prerequisites:
1814
- A running Kubernetes cluster (local or cloud)
19-
- kubectl and helm installed locally
20-
- Access to the Kedify Service dashboard (https://dashboard.kedify.io/) to obtain Organization ID and API Key. You can log in or create an account if you don’t have one
15+
- Kubectl and Helm installed
16+
- Access to the Kedify Service dashboard to obtain your Organization ID and API key (sign up at [Kedify dashboard](https://dashboard.kedify.io/))
2117

2218
author: Zbynek Roubalik
2319

content/learning-paths/servers-and-cloud-computing/kedify-http-autoscaling/http-scaling.md

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
11
---
2-
title: "HTTP Scaling for Ingress-Based Applications"
2+
title: "Autoscale HTTP applications with Kedify and Kubernetes Ingress"
33
weight: 4
44
layout: "learningpathall"
55
---
6+
## Overview
67

7-
In this section, you’ll gain hands-on experience with Kedify HTTP autoscaling. You will deploy a small web service, expose it through a standard Kubernetes Ingress, and rely on Kedify’s autowiring to route traffic via its proxy so requests are measured and drive scaling.
8+
In this section, you’ll gain hands-on experience with Kedify HTTP autoscaling. You will deploy a small web service, expose it through a standard Kubernetes Ingress, and rely on Kedify’s autowiring to route traffic through its proxy so that requests are measured and drive scaling.
89

9-
You will scale a real HTTP app exposed through Kubernetes Ingress using Kedify’s [kedify-http](https://docs.kedify.io/scalers/http-scaler/) scaler. You will deploy a simple application, enable autoscaling with a [ScaledObject](https://keda.sh/docs/latest/concepts/scaling-deployments/), generate load, and observe the system scale out and back in (including scale-to-zero when idle).
10+
You will scale a real HTTP app exposed through Kubernetes Ingress using [Kedify’s HTTP Scaler](https://docs.kedify.io/scalers/http-scaler/), and then move on to deploy a simple application, enable autoscaling with a scaled object, generate load, and observe the system scale out and back in (including scale-to-zero when idle).
11+
12+
For more information, see [Scaling Deployments, StatefulSets & Custom Resources](https://keda.sh/docs/latest/concepts/scaling-deployments/) on the KEDA website.
1013

1114
## How it works
1215

13-
With ingress autowiring enabled, Kedify automatically routes traffic through its proxy before it reaches your Service/Deployment:
16+
With ingress autowiring enabled, Kedify automatically routes traffic through its proxy before it reaches your service and deployment:
1417

1518
```output
1619
Ingress → kedify-proxy → Service → Deployment
1720
```
1821

19-
The [Kedify Proxy](https://docs.kedify.io/scalers/http-scaler/#kedify-proxy) gathers request metrics used by the scaler to make decisions.
22+
The [Kedify proxy](https://docs.kedify.io/scalers/http-scaler/#kedify-proxy) gathers request metrics used by the scaler to make decisions.
23+
24+
## Deployment overview
2025

21-
## Deployment Overview
22-
* Deployment & Service: An HTTP server with a small response delay to simulate work
23-
* Ingress: Public entry point configured using host `application.keda`
24-
* ScaledObject: A Kedify HTTP scaler using `trafficAutowire: ingress`
26+
There are three main components involved in the process:
27+
* For the application deployment and service, there is an HTTP server with a small response delay to simulate work.
28+
* For ingress, there is a public entry point that is configured using the `application.keda` host.
29+
* For the ScaledObject, there is a Kedify HTTP scaler using `trafficAutowire: ingress`.
2530

26-
## Step 1 — Configure the Ingress IP environment variable
31+
## Configure the Ingress IP environment variable
2732

28-
Before testing the application, make sure the INGRESS_IP environment variable is set to your ingress controller’s external IP address or hostname.
33+
Before testing the application, make sure the `INGRESS_IP` environment variable is set to your ingress controller’s external IP address or hostname.
2934

3035
If you followed the [Install Ingress Controller](../install-ingress/) guide, you should already have this set. If not, or if you're using an existing ingress controller, run this command:
3136

@@ -39,11 +44,9 @@ This will store the correct IP or hostname in the $INGRESS_IP environment variab
3944
If your ingress controller service uses a different name or namespace, update the command accordingly. For example, some installations use `nginx-ingress-controller` or place it in a different namespace.
4045
{{% /notice %}}
4146

42-
## Step 2 — Deploy the application and configure Ingress
43-
44-
Now you will deploy a simple HTTP server and expose it using an Ingress resource. The source code for this application is available on [GitHub](https://github.com/kedify/examples/tree/main/samples/http-server).
47+
## Deploy the application and configure Ingress
4548

46-
#### Deploy the application
49+
Now you will deploy a simple HTTP server and expose it using an Ingress resource. The source code for this application is available on the [Kedify GitHub repository](https://github.com/kedify/examples/tree/main/samples/http-server).
4750

4851
Run the following command to deploy your application:
4952

@@ -116,25 +119,29 @@ spec:
116119
EOF
117120
```
118121

119-
Notes:
120-
- `RESPONSE_DELAY` adds ~300ms latency per request, making scaling effects easier to see.
121-
- The Ingress uses host `application.keda`. To access this app we will use your ingress controller’s IP with a `Host:` header (shown below).
122+
## Key settings explained
122123

123-
#### Verify the application is running correctly
124+
The manifest includes a few key options that affect scaling behavior:
124125

125-
You will now check if you have 1 replica of the application deployed and ready:
126+
- `RESPONSE_DELAY` is set in the Deployment manifest above and adds approximately 300 ms latency per request; this slower response time increases the number of concurrent requests, making scaling effects easier to observe.
127+
- The ingress uses the host `application.keda`. To access this app, use your Ingress controller’s IP with a `Host:` header.
128+
129+
## Verify the application is running
130+
131+
Run the following command to check that 1 replica is ready:
126132

127133
```bash
128134
kubectl get deployment application
129135
```
130136

131-
In the output you should see 1 replica ready:
137+
Expected output includes 1 available replica:
132138
```output
133139
NAME READY UP-TO-DATE AVAILABLE AGE
134140
application 1/1 1 1 3m44s
135141
```
136142

137-
#### Test the application
143+
## Test the application
144+
138145
Once the application and Ingress are deployed, verify that everything is working correctly by sending a request to the exposed endpoint. Run the following command:
139146

140147
```bash
@@ -150,13 +157,14 @@ Content-Length: 301
150157
Connection: keep-alive
151158
```
152159

153-
## Step 3 — Enable autoscaling with Kedify
160+
## Enable autoscaling with Kedify
154161

155-
The application is now running. Next, you will enable autoscaling so that it can scale dynamically between 0 and 10 replicas. Kedify ensures that no requests are dropped during scaling. Apply the `ScaledObject` by running the following command:
162+
The application is now running. Next, you will enable autoscaling so that it can scale dynamically between 0 and 10 replicas. Kedify ensures that no requests are dropped during scaling. Apply the `ScaledObject` by running the following command:
156163

157164
```bash
158165
cat <<'EOF' | kubectl apply -f -
159166
apiVersion: keda.sh/v1alpha1
167+
160168
kind: ScaledObject
161169
metadata:
162170
name: application
@@ -192,50 +200,52 @@ spec:
192200
EOF
193201
```
194202

195-
Key Fields explained:
196-
- `type: kedify-http` — Specifies that Kedify’s HTTP scaler should be used.
197-
- `hosts`, `pathPrefixes` — Define which requests are monitored for scaling decisions.
198-
- `service`, `port` — TIdentify the Kubernetes Service and port that will receive the traffic.
199-
- `scalingMetric: requestRate` and `targetValue: 10` — Scale out when request rate exceeds the target threshold (e.g., 1000 req/s per window, depending on configuration granularity).
200-
- `minReplicaCount: 0` — Enables scale-to-zero when there is no traffic.
201-
- `trafficAutowire: ingress` — Automatically wires your Ingress to the Kedify proxy for seamless traffic management.
203+
## Key fields explained
204+
205+
Use the following field descriptions to understand how the `ScaledObject` controls HTTP-driven autoscaling and how each setting affects traffic routing and scale decisions:
206+
207+
- `type: kedify-http` - Uses Kedify’s HTTP scaler.
208+
- `hosts`, `pathPrefixes` - Define which requests are monitored for scaling decisions.
209+
- `service`, `port` - Identify the Kubernetes Service and port that receive traffic.
210+
- `scalingMetric: requestRate`, `granularity: 1s`, `window: 10s`, `targetValue: "10"` - Scales out when the average request rate exceeds ~10 requests/second (rps) per replica over the last 10 seconds.
211+
- `minReplicaCount: 0` - Enables scale to zero when there is no traffic.
212+
- `trafficAutowire: ingress` - Automatically wires your Ingress to the Kedify proxy for seamless traffic management.
202213

203214
After applying, the `ScaledObject` will appear in the Kedify dashboard (https://dashboard.kedify.io/).
204215

205-
![Kedify Dashboard With ScaledObject](images/scaledobject.png)
216+
![Kedify dashboard showing the ScaledObject alt-text#center](images/scaledobject.png "Kedify dashboard: ScaledObject")
206217

207-
## Step 4 — Send traffic and observe scaling
218+
## Send traffic and observe scaling
208219

209220
Since no traffic is currently being sent to the application, it will eventually scale down to zero replicas.
210221

211-
#### Verify scale to zero
222+
## Verify scale to zero
212223

213224
To confirm that the application has scaled down, run the following command and watch until the number of replicas reaches 0:
214225

215226
```bash
216227
watch kubectl get deployment application -n default
217228
```
218229

219-
You should see similar output:
220-
```bash
230+
You should see output similar to:
231+
```output
221232
Every 2,0s: kubectl get deployment application -n default
222233
223234
NAME READY UP-TO-DATE AVAILABLE AGE
224235
application 0/0 0 0 110s
225236
```
226237
This continuously monitors the deployment status in the default namespace. Once traffic stops and the idle window has passed, you should see the application deployment report 0/0 replicas, indicating that it has successfully scaled to zero.
227238

228-
#### Verify the app can scale from zero
239+
## Verify the app can scale from zero
229240

230-
Next, test that the application can scale back up from zero when traffic arrives. Send a request to the app:
241+
Send a request to trigger scale-up:
231242

232243
```bash
233244
curl -I -H "Host: application.keda" http://$INGRESS_IP
234245
```
235-
The application should scale from 0 → 1 replica automatically.
236246
You should receive an HTTP 200 OK response, confirming that the service is reachable again.
237247

238-
#### Test higher load
248+
The application scales from 0 → 1 replica automatically, and you should receive an HTTP `200 OK` response.
239249

240250
Now, generate a heavier, sustained load against the application. You can use `hey` (or a similar benchmarking tool):
241251

@@ -264,7 +274,7 @@ Expected behavior:
264274

265275
You can also monitor traffic and scaling in the Kedify dashboard:
266276

267-
![Kedify Dashboard ScaledObject Detail](images/load.png)
277+
![Kedify dashboard showing request load and scaling over time alt-text#center](images/load.png "Kedify dashboard: request load and scaling over time")
268278

269279
## Clean up
270280

@@ -280,4 +290,4 @@ This will delete the `ScaledObject`, Ingress, Service, and Deployment associated
280290

281291
## Next steps
282292

283-
To go futher, you can explore the Kedify [How-to guides](https://docs.kedify.io/how-to/) for more configurations such as Gateway API, Istio VirtualService, or OpenShift Routes.
293+
To go further, you can explore the [Kedify How-To Guides](https://docs.kedify.io/how-to/) for more configurations such as Gateway API, Istio VirtualService, or OpenShift Routes.
Lines changed: 32 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,73 @@
11
---
2-
title: "Install Ingress Controller"
2+
title: "Install an ingress controller"
33
weight: 3
44
layout: "learningpathall"
55
---
66

7-
Before deploying HTTP applications with Kedify autoscaling, you need an Ingress Controller to handle incoming traffic. Most managed Kubernetes services offered by major cloud providers (AWS EKS, Google GKE, Azure AKS) do not include an Ingress Controller by default.
7+
## Install an ingress controller for HTTP autoscaling on Kubernetes
8+
9+
Before deploying HTTP applications with Kedify autoscaling, you need an ingress controller to handle incoming traffic. Most managed Kubernetes services (AWS EKS, Google GKE, Azure AKS) do not include an ingress controller by default. In this Learning Path, you install the NGINX Ingress Controller with Helm and target arm64 nodes.
810

911
{{% notice Note %}}
10-
If your cluster already has an Ingress Controller installed and configured, you can skip this step and proceed directly to the [HTTP Scaling guide](../http-scaling/).
12+
If your cluster already has an ingress controller installed and configured, you can skip this step and proceed to the [Autoscale HTTP applications with Kedify and Kubernetes Ingress section](../http-scaling/).
1113
{{% /notice %}}
1214

13-
## Install NGINX Ingress Controller via Helm
15+
## Install the NGINX Ingress Controller with Helm
1416

1517
Add the NGINX Ingress Controller Helm repository:
16-
1718
```bash
1819
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
1920
helm repo update
2021
```
2122

22-
Install the NGINX Ingress Controller:
23-
23+
Install the NGINX Ingress Controller (with `nodeSelector` and `tolerations` for arm64):
2424
```bash
25-
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx \
26-
--namespace ingress-nginx \
27-
--create-namespace \
28-
\
29-
--set "controller.nodeSelector.kubernetes\.io/arch=arm64" \
30-
--set "controller.tolerations[0].key=kubernetes.io/arch" \
31-
--set "controller.tolerations[0].operator=Equal" \
32-
--set "controller.tolerations[0].value=arm64" \
33-
--set "controller.tolerations[0].effect=NoSchedule" \
34-
\
35-
--set "controller.admissionWebhooks.patch.nodeSelector.kubernetes\.io/arch=arm64" \
36-
--set "controller.admissionWebhooks.patch.tolerations[0].key=kubernetes.io/arch" \
37-
--set "controller.admissionWebhooks.patch.tolerations[0].operator=Equal" \
38-
--set "controller.admissionWebhooks.patch.tolerations[0].value=arm64" \
39-
--set "controller.admissionWebhooks.patch.tolerations[0].effect=NoSchedule"
25+
helm upgrade --install ingress-nginx ingress-nginx/ingress-nginx --namespace ingress-nginx --create-namespace --set "controller.nodeSelector.kubernetes\.io/arch=arm64" --set "controller.tolerations[0].key=kubernetes.io/arch" --set "controller.tolerations[0].operator=Equal" --set "controller.tolerations[0].value=arm64" --set "controller.tolerations[0].effect=NoSchedule" --set "controller.admissionWebhooks.patch.nodeSelector.kubernetes\.io/arch=arm64" --set "controller.admissionWebhooks.patch.tolerations[0].key=kubernetes.io/arch" --set "controller.admissionWebhooks.patch.tolerations[0].operator=Equal" --set "controller.admissionWebhooks.patch.tolerations[0].value=arm64" --set "controller.admissionWebhooks.patch.tolerations[0].effect=NoSchedule"
4026
```
4127

42-
Wait for the LoadBalancer to be ready:
43-
28+
Wait for the load balancer to be ready:
4429
```bash
45-
kubectl wait --namespace ingress-nginx \
46-
--for=condition=ready pod \
47-
--selector=app.kubernetes.io/component=controller \
48-
--timeout=300s
30+
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=300s
4931
```
5032

51-
## Get the External Endpoint
33+
Managed clouds may take a few minutes to allocate a public IP address or hostname.
5234

53-
Get the external IP address or hostname for your ingress controller and save it as an environment variable:
35+
## Get the external endpoint
5436

37+
Retrieve the external IP address or hostname and store it in an environment variable:
5538
```bash
56-
export INGRESS_IP=$(kubectl get service ingress-nginx-controller --namespace=ingress-nginx -o jsonpath='{.status.loadBalancer.ingress[0].ip}{.status.loadBalancer.ingress[0].hostname}')
39+
export INGRESS_IP=$(kubectl get service ingress-nginx-controller --namespace=ingress-nginx -o jsonpath='{.status.loadBalancer.ingress[0].ip}{.status.loadBalancer.ingress[0].hostname}')
5740
echo "Ingress IP/Hostname: $INGRESS_IP"
5841
```
5942

60-
This will save the external IP or hostname in the `INGRESS_IP` environment variable and display it. If the command doesn't print any value, please repeat it after some time. Please note the value:
61-
- **AWS EKS**: You'll see an AWS LoadBalancer hostname (e.g., `a1234567890abcdef-123456789.us-west-2.elb.amazonaws.com`)
62-
- **Google GKE**: You'll see an IP address (e.g., `34.102.136.180`)
63-
- **Azure AKS**: You'll see an IP address (e.g., `20.62.196.123`)
43+
Typical values by provider:
44+
- **AWS EKS**: Load balancer hostname (for example, `a1234567890abcdef-123456789.us-west-2.elb.amazonaws.com`)
45+
- **Google GKE**: IP address (for example, `34.102.136.180`)
46+
- **Azure AKS**: IP address (for example, `20.62.196.123`)
6447

65-
## Configure Access
48+
If no value is printed, wait briefly and re-run the command.
6649

67-
To configure access to the ingress controller, you have two options:
50+
## Configure access
6851

69-
### Option 1: DNS Setup (Recommended for production)
70-
Point `application.keda` to your ingress controller's external IP/hostname using your DNS provider.
52+
You have two options:
7153

72-
### Option 2: Host Header (Quick setup)
73-
Use the external IP/hostname directly with a `Host:` header in your requests. When testing, you will use:
54+
- Option 1: DNS (recommended for production):
55+
create a DNS record pointing `application.keda` to the external IP address or hostname of your ingress controller.
7456

75-
```bash
76-
curl -H "Host: application.keda" http://$INGRESS_IP
77-
```
78-
79-
The `$INGRESS_IP` environment variable contains the actual external IP or hostname from your ingress controller service.
57+
- Option 2: host header (quick test):
58+
use the external IP address or hostname directly with a `Host:` header:
59+
```bash
60+
curl -H "Host: application.keda" http://$INGRESS_IP
61+
```
62+
Here, `$INGRESS_IP` expands to the external IP address or hostname of the ingress controller.
8063

81-
## Verification
82-
83-
Verify that the ingress controller is working by checking its readiness:
64+
## Verify the installation
8465

66+
List the controller pods and confirm they are running:
8567
```bash
8668
kubectl get pods --namespace ingress-nginx
8769
```
8870

8971
You should see the `ingress-nginx-controller` pod in `Running` status.
9072

91-
92-
Now that you have an Ingress Controller installed and configured, proceed to the next section to deploy an application and configure Kedify autoscaling.
73+
Now that you have an ingress controller installed and configured, proceed to the next section to deploy an application and configure Kedify autoscaling.

0 commit comments

Comments
 (0)