You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/kedify-http-autoscaling/_index.md
+6-10Lines changed: 6 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,19 @@
1
1
---
2
-
title: Autoscaling HTTP applications on Kubernetes
2
+
title: Autoscale HTTP applications on Kubernetes with KEDA and Kedify
3
3
4
-
draft: true
5
-
cascade:
6
-
draft: true
7
-
8
4
minutes_to_complete: 45
9
5
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.
11
7
12
8
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
15
11
- Deploy a sample HTTP application and test autoscaling behavior
16
12
17
13
prerequisites:
18
14
- 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/))
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/kedify-http-autoscaling/http-scaling.md
+52-42Lines changed: 52 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,36 @@
1
1
---
2
-
title: "HTTP Scaling for Ingress-Based Applications"
2
+
title: "Autoscale HTTP applications with Kedify and Kubernetes Ingress"
3
3
weight: 4
4
4
layout: "learningpathall"
5
5
---
6
+
## Overview
6
7
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.
8
9
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.
10
13
11
14
## How it works
12
15
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:
14
17
15
18
```output
16
19
Ingress → kedify-proxy → Service → Deployment
17
20
```
18
21
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
20
25
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`.
25
30
26
-
## Step 1 — Configure the Ingress IP environment variable
31
+
## Configure the Ingress IP environment variable
27
32
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.
29
34
30
35
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:
31
36
@@ -39,11 +44,9 @@ This will store the correct IP or hostname in the $INGRESS_IP environment variab
39
44
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.
40
45
{{% /notice %}}
41
46
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
45
48
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).
47
50
48
51
Run the following command to deploy your application:
49
52
@@ -116,25 +119,29 @@ spec:
116
119
EOF
117
120
```
118
121
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
122
123
123
-
#### Verify the application is running correctly
124
+
The manifest includes a few key options that affect scaling behavior:
124
125
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:
126
132
127
133
```bash
128
134
kubectl get deployment application
129
135
```
130
136
131
-
In the output you should see 1 replica ready:
137
+
Expected output includes 1 available replica:
132
138
```output
133
139
NAME READY UP-TO-DATE AVAILABLE AGE
134
140
application 1/1 1 1 3m44s
135
141
```
136
142
137
-
#### Test the application
143
+
## Test the application
144
+
138
145
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:
139
146
140
147
```bash
@@ -150,13 +157,14 @@ Content-Length: 301
150
157
Connection: keep-alive
151
158
```
152
159
153
-
## Step 3 — Enable autoscaling with Kedify
160
+
## Enable autoscaling with Kedify
154
161
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:
156
163
157
164
```bash
158
165
cat <<'EOF' | kubectl apply -f -
159
166
apiVersion: keda.sh/v1alpha1
167
+
160
168
kind: ScaledObject
161
169
metadata:
162
170
name: application
@@ -192,50 +200,52 @@ spec:
192
200
EOF
193
201
```
194
202
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.
202
213
203
214
After applying, the `ScaledObject` will appear in the Kedify dashboard (https://dashboard.kedify.io/).
204
215
205
-

216
+

206
217
207
-
## Step 4 — Send traffic and observe scaling
218
+
## Send traffic and observe scaling
208
219
209
220
Since no traffic is currently being sent to the application, it will eventually scale down to zero replicas.
210
221
211
-
####Verify scale to zero
222
+
## Verify scale to zero
212
223
213
224
To confirm that the application has scaled down, run the following command and watch until the number of replicas reaches 0:
214
225
215
226
```bash
216
227
watch kubectl get deployment application -n default
217
228
```
218
229
219
-
You should see similar output:
220
-
```bash
230
+
You should see output similar to:
231
+
```output
221
232
Every 2,0s: kubectl get deployment application -n default
222
233
223
234
NAME READY UP-TO-DATE AVAILABLE AGE
224
235
application 0/0 0 0 110s
225
236
```
226
237
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.
227
238
228
-
####Verify the app can scale from zero
239
+
## Verify the app can scale from zero
229
240
230
-
Next, test that the application can scale back up from zero when traffic arrives. Send a request to the app:

268
278
269
279
## Clean up
270
280
@@ -280,4 +290,4 @@ This will delete the `ScaledObject`, Ingress, Service, and Deployment associated
280
290
281
291
## Next steps
282
292
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.
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.
8
10
9
11
{{% 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/).
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=300s
49
31
```
50
32
51
-
## Get the External Endpoint
33
+
Managed clouds may take a few minutes to allocate a public IP address or hostname.
52
34
53
-
Get the external IP address or hostname for your ingress controller and save it as an environment variable:
35
+
## Get the external endpoint
54
36
37
+
Retrieve the external IP address or hostname and store it in an environment variable:
55
38
```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}')
57
40
echo"Ingress IP/Hostname: $INGRESS_IP"
58
41
```
59
42
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`)
64
47
65
-
## Configure Access
48
+
If no value is printed, wait briefly and re-run the command.
66
49
67
-
To configure access to the ingress controller, you have two options:
50
+
## Configure access
68
51
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:
71
53
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.
Here, `$INGRESS_IP` expands to the external IP address or hostname of the ingress controller.
80
63
81
-
## Verification
82
-
83
-
Verify that the ingress controller is working by checking its readiness:
64
+
## Verify the installation
84
65
66
+
List the controller pods and confirm they are running:
85
67
```bash
86
68
kubectl get pods --namespace ingress-nginx
87
69
```
88
70
89
71
You should see the `ingress-nginx-controller` pod in `Running` status.
90
72
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