• Explore the unified API Platform
        • BUILD APIs
        • Kong Insomnia
        • API Design
        • API Mocking
        • API Testing & Debugging
        • MCP Client
        • RUN APIs
        • API Gateway
        • Context Mesh
        • AI Gateway
        • Event Gateway
        • Kubernetes Operator
        • Service Mesh
        • Ingress Controller
        • Runtime Management
        • DISCOVER APIs
        • Developer Portal
        • Service Catalog
        • MCP Registry
        • GOVERN APIs
        • Metering & Billing
        • APIOps & Automation
        • API Observability
        • Why Kong?
      • CLOUD
      • Cloud API Gateways
      • Need a self-hosted or hybrid option?
      • COMPARE
      • Considering AI Gateway alternatives?
      • Kong vs. Postman
      • Kong vs. MuleSoft
      • Kong vs. Apigee
      • Kong vs. IBM
      • GET STARTED
      • Sign Up for Kong Konnect
      • Documentation
  • Agents
      • FOR PLATFORM TEAMS
      • Developer Platform
      • Kubernetes & Microservices
      • Observability
      • Service Mesh Connectivity
      • Kafka Event Streaming
      • FOR EXECUTIVES
      • AI Connectivity
      • Open Banking
      • Legacy Migration
      • Platform Cost Reduction
      • Kafka Cost Optimization
      • API Monetization
      • AI Monetization
      • AI FinOps
      • FOR AI TEAMS
      • AI Cost Control
      • AI Governance
      • AI Integration
      • AI Security
      • Agentic Infrastructure
      • MCP Production
      • MCP Traffic Gateway
      • FOR DEVELOPERS
      • Mobile App API Development
      • GenAI App Development
      • API Gateway for Istio
      • Decentralized Load Balancing
      • BY INDUSTRY
      • Financial Services
      • Healthcare
      • Higher Education
      • Insurance
      • Manufacturing
      • Retail
      • Software & Technology
      • Transportation
      • See all Solutions
      • DOCUMENTATION
      • Kong Konnect
      • Kong Gateway
      • Kong Mesh
      • Kong AI Gateway
      • Kong Insomnia
      • Plugin Hub
      • EXPLORE
      • Blog
      • Learning Center
      • eBooks
      • Reports
      • Demos
      • Customer Stories
      • Videos
      • EVENTS
      • AI + API Summit
      • Webinars
      • User Calls
      • Workshops
      • Meetups
      • See All Events
      • FOR DEVELOPERS
      • Get Started
      • Community
      • Certification
      • Training
      • COMPANY
      • About Us
      • Why Kong?
      • We're Hiring!
      • Press Room
      • Investors
      • Contact Us
      • PARTNER
      • Kong Partner Program
      • SECURITY
      • Trust and Compliance
      • SUPPORT
      • Enterprise Support Portal
      • Professional Services
      • Documentation
      • Press Releases

        Kong Names Bruce Felt as Chief Financial Officer

        Read More
  • Pricing
  • Login
  • Get a Demo
  • Start for Free
Blog
  • AI Gateway
  • AI Security
  • AIOps
  • API Security
  • API Gateway
|
    • API Management
    • API Development
    • API Design
    • Automation
    • Service Mesh
    • Insomnia
    • View All Blogs
  1. Home
  2. Blog
  3. Engineering
  4. Kong Konnect Data Plane Pod Autoscaling with HPA on Amazon EKS 1.29
Engineering
February 12, 2024
3 min read

Kong Konnect Data Plane Pod Autoscaling with HPA on Amazon EKS 1.29

Claudio Acquaviva
Principal Architect, Kong

In my previous post, we discussed how to take advantage of VPA to implement automatic vertical scaling for our Konnect Data Planes. In this post, we'll focus on HPA for horizontal Kubernetes Pods autoscaling.

HPA

VPA docs recommend not using VPA along with HPA on CPU or memory metrics at this moment. HPA should be configured with custom and external metrics instead.

Since we'll be running fundamental HPA use cases, let's delete the VPA policy with:

kubectl delete vpa kong-vpa -n kong

HPA Fundamentals

Horizontal Pod Autoscaler (HPA) is a standard API resource in Kubernetes that automatically updates a workload resource, for example a Deployment, to match a throughput demand.

The following diagram was taken from the official Kubernetes HPA documentation. Please check it out to learn more.

HPA requires metrics provided by the Kubernetes Metrics Server, we have already installed. The Metrics Server collects resource metrics from the kubelets in your cluster, and exposes those metrics through the Kubernetes API.

To have better control of the HPA environment, let's set our Konnect Data Plane deployment requesting more CPU and memory resources:

kubectl set resources deployment kong-kong -n kong --requests "cpu=300m,memory=300Mi" --limits "cpu=1500m,memory=3Gi"

Also, to see HPA in action, we are going to replace the existing NodeGroup with a smaller one, this time based on the t3.large Instance Type with 2 vCPUs and 8GiB of memory:

eksctl delete nodegroup --cluster kong35-eks129-autoscaling --region us-west-1 --name nodegroup-kong

eksctl create nodegroup --cluster kong35-eks129-autoscaling --region us-west-1 \
  --name nodegroup-kong \
  --node-labels="nodegroupname=kong" \
  --node-type t3.large \
  --nodes 1 \
  --nodes-min 1 --nodes-max 10 \
  --max-pods-per-node 50

HPA Policy

The Kubernetes Autoscale command tells HPA how to proceed to instantiate new Pod replicas. The command tells that HPA should create new replicas of the Data Plane when the CPU usage reaches the 75% threshold. HPA should create up to 10 replicas of the Data Plane.

kubectl autoscale deployment kong-gateway -n kong --cpu-percent=75 --min=1 --max=10

You can use the HorizontalPodAutoscaler CRD instead. Bear in mind this is a basic use case, there are many other scenarios addressed by HPA. Please, check the HPA documentation to learn more about it.

cat <<EOF | kubectl apply -f -
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: kong-hpa
  namespace: kong
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: kong-kong
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 75
EOF

Check the HPA with. Since we haven't consumed the Data Plane yet, the HPA current usage is unknown.

% kubectl get hpa -n kong
NAME       REFERENCE              TARGETS         MINPODS   MAXPODS   REPLICAS   AGE
kong-hpa   Deployment/kong-kong   <unknown>/75%   1         10         0          5s

Consume the Data Plane

Now, you are going to submit the Data Plane to a higher throughput in order to see HPA in action, spinning up new replicas of the Pod. Additionally, this is a long 20-minute run, so we should see how HPA performs in a scenario like this. First of all, make sure you delete any Fortio Pods you might have running.

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
  name:  fortio
  labels:
    app: fortio
spec:
  containers:
  - name: fortio
    image: fortio/fortio
    args: ["load", "-c", "800", "-qps", "3000", "-t", "20m", "-allow-initial-errors", "http://kong-kong-proxy.kong.svc.cluster.local:80/route1/get"]
  nodeSelector:
      nodegroupname: fortio
EOF

After some minutes, you should see a new status:

% kubectl get hpa -n kong
NAME       REFERENCE              TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
kong-hpa   Deployment/kong-kong   96%/75%   1         10        7          14m

If you check the running Pods you should see new replicas were started. However, there are two of them in the Pending status.

% kubectl get pod -n kong
NAME                         READY   STATUS    RESTARTS   AGE
kong-kong-789ffd6f86-bmgh8   0/1     Pending   0          8m23s
kong-kong-789ffd6f86-cjrrp   1/1     Running   0          9m23s
kong-kong-789ffd6f86-fcnts   1/1     Running   0          8m23s
kong-kong-789ffd6f86-k7cnm   1/1     Running   0          9m23s
kong-kong-789ffd6f86-sf65t   0/1     Pending   0          22s
kong-kong-789ffd6f86-tv96x   1/1     Running   0          15m
kong-kong-789ffd6f86-twzd8   1/1     Running   0          9m23s

Let's check one of them a bit closer. The condition message says there are no more CPUs available to be allocated, hence the Pod has not been scheduled.

% kubectl get pod kong-kong-789ffd6f86-bmgh8 -n kong -o json | jq ".status"
{
  "conditions": [
    {
      "lastProbeTime": null,
      "lastTransitionTime": "2024-01-26T21:01:54Z",
      "message": "0/3 nodes are available: 1 Insufficient cpu, 2 node(s) didn't match Pod's node affinity/selector. preemption: 0/3 nodes are available: 1 No preemption victims found for incoming pod, 2 Preemption is not helpful for scheduling.",
      "reason": "Unschedulable",
      "status": "False",
      "type": "PodScheduled"
    }
  ],
  "phase": "Pending",
  "qosClass": "Burstable"
}

For more evidence, you can check the Nodes consumption themselves and see it has run out of resources:

% kubectl top node --selector='eks.amazonaws.com/nodegroup=nodegroup-kong'
NAME                                           CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
ip-192-168-11-188.us-west-1.compute.internal   1999m        103%   7080Mi          99%   

The straightforward solution would be to create new Nodes for the Cluster. That's the main reason why we should use a cluster autoscaler mechanism alongside HPA.

Amazon EKS supports two autoscaling products:

  • Standard Kubernetes Cluster Autoscaler
  • Karpenter

Check out the third part of this series to see Kubernetes Cluster Autoscaler in action.

AWSKubernetes

More on this topic

Videos

Centralized Decentralization: Migration from Azure to Kong

eBooks

Hybrid API Gateway Clusters With Kong Konnect and Amazon Elastic Kubernetes Service

See Kong in action

Accelerate deployments, reduce vulnerabilities, and gain real-time visibility. 

Get a Demo
Topics
AWSKubernetes
Claudio Acquaviva
Principal Architect, Kong

Recommended posts

Announcing the Kong Konnect Mesh EKS Blueprint Add-on

EngineeringJanuary 8, 2024

Zero to Hero on Amazon EKS with Konnect’s Mesh Manager We’re excited to announce a new addition to our Kong Konnect EKS Blueprint Family: the Kong Konnect Mesh EKS Blueprint Add-on to deploy your Mesh Zones. Deploy your zones securely on AWS with

Danny Freese

AI Agent with Strands SDK, Kong AI/MCP Gateway & Amazon Bedrock

EngineeringJanuary 12, 2026

In one of our posts, Kong AI/MCP Gateway and Kong MCP Server technical breakdown, we described the new capabilities added to Kong AI Gateway to support MCP (Model Context Protocol). The post focused exclusively on consuming MCP server and MCP tool

Jason Matis

Farewell Ingress NGINX: Explore a Better Path Forward with Kong

EngineeringNovember 14, 2025

"To prioritize the safety and security of the ecosystem, Kubernetes SIG Network and the Security Response Committee are announcing the upcoming retirement of Ingress NGINX . Best-effort maintenance will continue until March 2026. Afterward, there w

Justin Davies

Kong Mesh 2.11: Reduced Privileges, Improved Support for AWS ECS

Product ReleasesJune 20, 2025

We’re at it again, bringing more incremental improvements to Kong Mesh!  Built on top of Kuma, Kong Mesh brings much-needed simplicity and production-grade tooling. Kong Mesh is built for smooth operations with platform teams in mind, providing secu

Justin Davies

Kuma 1.6.0 and Kong Mesh 1.7.0 Released With Kubernetes Gateway API support, AWS ACM Integration and more!

Product ReleasesApril 12, 2022

We are happy to announce the latest release for both Kong Mesh and Kuma, which is packed with features and improvements. Kong Mesh 1.7 is focused on security and stability, as it allows to better integrate with AWS thanks to a native AWS ACM integra

Marco Palladino

Kong Simplifies Multicloud Cloud Gateways with Managed Redis Cache

Product ReleasesMarch 12, 2026

Managed Redis cache is a turnkey "Shared State" add-on for Kong Dedicated Cloud Gateways. It is designed to combine the performance of an in-memory data store with the simplicity of a SaaS product. When you spin up a Dedicated Cloud Gateway in Kong

Amit Shah

Announcing Kong Operator 2.1

Product ReleasesFebruary 10, 2026

With Kong Ingress Controller, when your Control Plane was hosted in Kong Konnect, and you were using Kubernetes Gateway API, your dataplane, routes, and services were in read-only mode. When using Kong Ingress Controller with Kubernetes Gateway API

Justin Davies

Ready to see Kong in action?

Get a personalized walkthrough of Kong's platform tailored to your architecture, use cases, and scale requirements.

Get a Demo
Powering the API world

Increase developer productivity, security, and performance at scale with the unified platform for API management, AI gateways, service mesh, and ingress controller.

Sign up for Kong newsletter

    • Platform
    • Kong Konnect
    • Kong Gateway
    • Kong AI Gateway
    • Kong Insomnia
    • Developer Portal
    • Gateway Manager
    • Cloud Gateway
    • Get a Demo
    • Explore More
    • Open Banking API Solutions
    • API Governance Solutions
    • Istio API Gateway Integration
    • Kubernetes API Management
    • API Gateway: Build vs Buy
    • Kong vs Postman
    • Kong vs MuleSoft
    • Kong vs Apigee
    • Documentation
    • Kong Konnect Docs
    • Kong Gateway Docs
    • Kong Mesh Docs
    • Kong AI Gateway
    • Kong Insomnia Docs
    • Kong Plugin Hub
    • Open Source
    • Kong Gateway
    • Kuma
    • Insomnia
    • Kong Community
    • Company
    • About Kong
    • Customers
    • Careers
    • Press
    • Events
    • Contact
    • Pricing
  • Terms
  • Privacy
  • Trust and Compliance
  • © Kong Inc. 2026