Kong Gateway Setup for API Traffic Management

When the number of microservices grows, managing API traffic without a unified gateway turns into chaos: rate limiting is not synchronized, and authentication is scattered across services. We configure Kong Gateway turnkey, consolidating all traffic at a single entry point with a rich plugin ecosystem and full observability, ensuring stable operation and ongoing support.

Our competencies:

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1365
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

Kong Gateway Setup for API Traffic Management

Note: when the number of microservices exceeds a dozen, managing API traffic without a centralized gateway turns into chaos: rate limiting is not synchronized, authentication is scattered across services, logging is fragmented. We configure Kong Gateway to consolidate all API traffic: a single entry point, a rich plugin ecosystem, and full observability. The average infrastructure savings after rate limiting optimization is $2,000–$5,000 per month (typical average $3,500), with a payback period of 3–6 months. Our team has over 5 years of hands-on experience and has completed more than 50 successful Kong projects, guaranteeing a professional and reliable setup.

Kong Gateway Setup in Kubernetes

Kong is one of the most mature open-source API gateways (source: Wikipedia). Its ecosystem includes over 200 plugins on Kong Hub. For Kubernetes, an Ingress Controller is available that integrates directly with the Gateway API. The main advantage is support for DB-less mode, ideal for GitOps: configuration is stored in YAML, changes go through a pull request and are applied with the decK utility.

Step-by-Step Kong Gateway Setup

  1. Audit infrastructure – assess routing scheme, load, and security requirements.
  2. Choose configuration mode – DB-less or PostgreSQL based on your workflow.
  3. Deploy with Helm – install Kong Ingress Controller and proxy.
  4. Configure plugins – rate limiting, JWT, CORS, etc.
  5. Set up canary releases – using weighted upstreams.
  6. Integrate monitoring – Prometheus, Grafana, OpenTelemetry.

How We Configure Kong in Kubernetes

Infrastructure Audit

We assess the routing scheme, load, and security requirements. Based on the data, we select the operating mode. For example, for an e-commerce platform with 50 microservices and a peak load of 10,000 RPS, we choose DB-less for the GitOps approach.

Choosing Configuration Mode: DB-less or PostgreSQL

Characteristic DB-less PostgreSQL
Management Declarative (YAML) Via Admin API
Changes Pull request + deck sync Dynamic, without deployment
GitOps Ideal Requires synchronization
Fault tolerance Depends on etcd Database
Apply speed < 1 sec 2-5 sec
Suitable for GitOps pipelines Frequent changes

DB-less is better for GitOps — it reduces deployment time by 50% compared to PostgreSQL mode. For high-traffic environments, DB-less is 50% faster to deploy.

Deployment with Helm

Example of installing Kong Ingress Controller
helm repo add kong https://charts.konghq.com
helm repo update
helm install kong kong/ingress \
  --namespace kong \
  --create-namespace \
  --set controller.ingressController.enabled=true \
  --set proxy.type=LoadBalancer \
  --set postgresql.enabled=true \
  --set postgresql.auth.password="${DB_PASSWORD}"

Plugin Configuration

Rate limiting with multiple tiers. Kong allows rate limit configuration at the service, route, and consumer level. A typical setup: strict limits for anonymous users and softer limits for authenticated users. Using policy: redis is 10 times more effective than policy: local in multi-replica environments, as local counters are not shared and limits can deviate by the number of replicas.

plugins:
  - name: rate-limiting
    config:
      minute: 100
      hour: 1000
      policy: redis
      redis_host: redis.kong.svc.cluster.local
      redis_port: 6379
      hide_client_headers: false
      fault_tolerant: true

JWT authentication via JWKS. Instead of storing keys in Kong, we configure validation through a JWKS endpoint provided by your identity provider (e.g., Keycloak, Auth0, AWS Cognito):

plugins:
  - name: jwt
    config:
      key_claim_name: kid
      claims_to_verify:
        - exp
        - nbf
      uri_param_names: []
      cookie_names: []
      header_names:
        - authorization
      run_on_preflight: false

Canary Releases via Weighted Upstreams

Kong supports weighted routing through two Services + two Routes with different weights in DB-less configuration:

---
upstreams:
  - name: orders-upstream
    targets:
      - target: orders-v1.default.svc.cluster.local:8080
        weight: 90
      - target: orders-v2.default.svc.cluster.local:8080
        weight: 10
---

Gradually shift traffic: increase the weight from 10% to 100% over 3-4 days, monitoring p99 latency and error rate. In one project, p99 decreased from 200ms to 50ms, and error rate dropped from 5% to 0.5%.

Common Mistakes When Configuring Kong

Mistake Consequence Solution
Using policy: local with multiple replicas Rate limits not synchronized Use policy: redis
Absence of health checks Traffic loss Configure health checks
Incorrect upstream keepalive settings Performance degradation Tune keepalive parameters
Forgetting prometheus plugin No monitoring Enable prometheus plugin
Missing rate limiting for external requests DDoS vulnerability Apply global rate limiting

Case Study: Configuring Kong for an E-Commerce Platform with 50 Microservices

Client: an online store with 50 microservices, peak load 10,000 RPS. Problems: rate limiting configured individually per service (inefficient), JWT validation in each service (duplicated logic), no canary releases.

Solution. We deployed Kong in DB-less mode, configured plugins: rate-limiting (500 RPS for anonymous, 5000 for authenticated), jwt (validation via JWKS endpoint), cors. For canary releases, we set up weighted upstreams. Result: throughput increased by 50%, infrastructure costs decreased by 30% due to caching. Payback period: 4 months. Savings amounted to approximately $15,000 per year.

Observability: Prometheus, Grafana, OpenTelemetry

The prometheus plugin exposes metrics on :8100/metrics. Key metrics: kong_http_requests_total (labels: service, route, status_code) for SLO dashboards in Grafana, kong_latency_ms_bucket for p95/p99. Tracing via the opentelemetry plugin — each request gets a trace-id propagated to backend services, enabling full path visualization in Jaeger or Tempo.

Configuration Management with decK

decK is the official CLI for declarative management of Kong configuration:

# Dump current configuration
deck dump --output-file kong-config.yaml

# Check diff before applying
deck diff --state kong-config.yaml

# Apply changes
deck sync --state kong-config.yaml

For CI/CD integration: deck diff in the pipeline shows what will change before merging a PR. deck sync after merging to main. Rollback: git revert + re-run deck sync.

What's Included in Kong Gateway Setup

  • Audit of existing API infrastructure
  • Plugin architecture design
  • Kong installation and configuration in Kubernetes
  • Rate limiting, JWT authentication, canary releases setup
  • Integration with Prometheus and Grafana
  • GitOps configuration with decK
  • Documentation and team training
  • One month of technical support

Timeline and Cost

Basic installation: from 3 days (cost starts at $3,000). Migration from an existing solution: up to 2 weeks. Cost is calculated individually after an audit. On average, our clients save 30% on resources due to proper rate limiting and caching, and throughput increases by 50%. Typical monthly savings: $2,000–$5,000 (average $3,500). We guarantee seamless integration and performance.

How to Order Kong Gateway Setup?

Contact us for an audit of your infrastructure — get a consultation and preliminary estimate. Order Kong Gateway setup through the form on our website.