• 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 API Gateway on Kubernetes with Pulumi
Engineering
March 15, 2022
4 min read

Kong API Gateway on Kubernetes with Pulumi

Kat Morgan

The Kong Laboratory – Kong API Gateway

The quest for resilience and agility has driven us into the modern age of microservices. Bringing services to market on a microservice architecture demands the utilization of sprawling technology offerings and tooling. While daunting at first glance, we can break down the process into 3 major categories:

  • Infrastructure Orchestration
  • Application Deployment
  • Service Publishing

In this hands-on series, we will use:

  • Kubernetes-in-Docker (Kind) as our infrastructure platform.
  • Pulumi to orchestrate our supporting infrastructure and deploy our applications.
  • And finally, Kong API Gateway for publishing the services that we have deployed.

Key Concepts

Kong API Gateway is an API Gateway and Ingress Controller. At its core, Kong is a reverse proxy that allows an organization to offer APIs as a product to internal and external clients via a centralized ingress point. An API Gateway truly begins to shine when leveraged to consolidate capabilities such as authentication, RBAC, session handling, rate limiting, request & response transformation, redirection, load balancing, traffic monitoring, and logging. These advanced routing features offload enforcement, maintenance, and visibility from the application teams, improving their agility and consolidating this functional ownership into a central location for improved global consistency and visibility.

Pulumi is an Infrastructure as Code (IaC) or Infrastructure as Software (IaS) cloud engineering platform. Pulumi supports IaC/IaS patterns using popular programming languages including Python, JavaScript, TypeScript, Golang, and .NET/C#. At it's heart, the Pulumi ecosystem is a cloud engineering platform and SDK offering that brings together developer, operations, and security teams through a unified software engineering process to accelerate innovation with more confidence via a full suite of OpenGitOps compliant tools.

Host Setup

This article is designed for you to follow along with your MacOS or Linux laptop. Before starting, please check that you have installed all dependencies.

Okay, now that you have your dependencies, let's grab the code and get your system ready to build the lab platform.

  1. Write Hosts File Entries to resolve your lab domain names locally
# Set ADDRESS to your host IP if you plan to use Keycloak

export ADDRESS=127.0.0.1
cat <<EOF | sudo tee -a /etc/hosts
${ADDRESS}  apps.kind.home.arpa
${ADDRESS}  portal.kong.kind.home.arpa
${ADDRESS}  manager.kong.kind.home.arpa
${ADDRESS}  keycloak.apps.kind.home.arpa
${ADDRESS}  podinfo.apps.kind.home.arpa
EOF
  1. Create docker volumes for persistent local container image caching
docker volume create worker1
docker volume create controlplane1
  1. Clone TheKongLaboratory git repo
cd ~
git clone --depth 1 --branch v2.8.0 https://github.com/kong/TheKongLaboratory
cd ~/TheKongLaboratory

Pulumi Infrastructure as Code

Great! Reviewing our checklist, we now have:

  • ✓ Installed all dependencies.
  • ✓ Configured /etc/hosts to resolve our domain names to our local IP.
  • ✓ Created local cache volumes for kind node images.
  • ✓ Cloned the demo repo codebase.

Your system is ready to run the lab and we have the code! Next, before we can deploy the Kong API Gateway we need to initialize the Pulumi codebase and configure a Stack.

  1. Configure Pulumi local state provider
# Set a Pulumi local state login password
export PULUMI_CONFIG_PASSPHRASE=mypassword

# Run pulumi login --help for more state backend and login information
pulumi login --local
  1. Initialize & Select Pulumi Stack
# Download npm packages for Pulumi typescript IaC
npm install

# Initialize and select your pulumi stack
pulumi stack init thekonglaboratory
pulumi stack select thekonglaboratory
  1. Set Pulumi Stack Configuration Variables
# Set Kong Enterprise License, an empty license enables free mode
pulumi config set --secret kong:license "'{}'"

# Set enterprise to true if deploying with an enterprise license
pulumi config set kong:enterprise false

Deploy Kong API Gateway

Reviewing our checklist again, we now have:

  • ✓ Installed all dependencies.
  • ✓ Configured /etc/hosts to resolve our domain names to our local IP.
  • ✓ Created local cache volumes for kind node images.
  • ✓ Cloned the demo repo codebase.
  • ✓ Initialized & Configured your Pulumi Stack

Now, it is time to start your Kind cluster and deploy Kong to it!

  1. Deploy Kong Gateway Stack
# Start Kind Kubernetes Cluster
kind create cluster --config hack/kind/config.yml

# Pulumi Deploy Kong Gateway & Dependencies
pulumi up -y
  1. Go ahead and open up the Kong Manager UI !!
    >> https://manager.kong.kind.home.arpa/

Deploy a Sample App

Let's go ahead and test our new Kong API Gateway by deploying Podinfo as a sample application to experiment with.

  1. Deploy a simple Podinfo Sample application.
# change directory to Podinfo App
cd ~/TheKongLaboratory/doc/gateway-s01e01-simple-app

# Set a Pulumi local state login password
export PULUMI_CONFIG_PASSPHRASE=mypassword

# Run pulumi login --help for more state backend and login information
pulumi login --local

# Download npm packages for Pulumi typescript IaC
npm install

# Initialize and select your pulumi stack
pulumi stack init podinfo
pulumi stack select podinfo

# Deploy Podinfo Sample App
pulumi up -y
  1. Now go check out your Podinfo app at:
    >> https://podinfo.apps.kind.home.arpa/

Conclusion

Congratulations! In roughly 1000 lines of TypeScript code, we have deployed a working Kong API Gateway and all supporting services with Pulumi! For transparency, I want to briefly list the scope of what you just deployed.

  • Kubernetes:
    • ✓ Kubernetes-in-Docker
  • Namespaces:
    • ✓ The namespace for Kong
    • ✓ The namespace for Cert Manager
  • Certificates:
    • ✓ Chain of Trust for a Cert Manager Self Signed Issuer
    • ✓ Default certificate for Kong API Gateway services & proxy
    • ✓ Kong controlplane <> dataplane mTLS certificate
  • Secrets:
    • ✓ Postgres database credentials
    • ✓ Kong Manager GUI session configuration
    • ✓ Kong API Gateway admin credentials
    • ✓ Kong Enterprise License
  • Helm Charts:
    • ✓ Cert Manager
    • ✓ Bitnami Postgresql
    • ✓ Kong Controlplane
    • ✓ Kong Ingress Controller
    • ✓ Kong Dataplane

Now that you have Kong installed and ready to use, this will be the foundation for future posts in the DevMyOps series and is also a great way to get started with Kong for evaluation and local development purposes.

From here you can continue with configuring Kong Manager and Kong plugins, or you can start using the Kong Ingress Controller to publish services on your kind cluster via Kong.

Appendix

Dependencies

DependencyInstallation Docs

kubectl

Linux / Mac

Docker

Linux / Mac

Kind

Linux / Mac

Helm

Linux / Mac

Pulumi

Linux / Mac

npm

Linux / Mac

git client

Linux / Mac

curl client

Linux / Mac

Cleanup

When you are finished with your local deployment you can clean up all lab artifacts in this order:

  1. Destroy Kong Pulumi Stack
  2. Delete Kind Cluster
  3. Remove Docker Volumes
  4. Remove TheKongLaboratory Git Repo
  5. Manually cleanup /etc/hosts entries
  1. Unlock your local secret store.
cd ~/TheKongLaboratory
export PULUMI_CONFIG_PASSPHRASE=mypassword
  1. Destroy Kong Pulumi Stack
pulumi --stack podinfo destroy -ypulumi --stack thekonglaboratory destroy -y
  1. Delete Kind Cluster
kind delete cluster --name=kong
  1. Remove Docker Volumes
docker volume rm worker1 controlplane1
  1. Remove TheKongLaboratory Git Repo
pulumi --stack thekonglaboratory stack rm -y
cd ~ && rm -rf ~/TheKongLaboratory
  1. Open the /etc/hosts file and remove the following entries:
127.0.0.1  apps.kind.home.arpa
127.0.0.1  portal.kong.kind.home.arpa
127.0.0.1  manager.kong.kind.home.arpa
127.0.0.1  keycloak.apps.kind.home.arpa
127.0.0.1  podinfo.apps.kind.home.arpa
KubernetesAPI GatewayKong Gateway

More on this topic

Videos

Centralized Decentralization: Migration from Azure to Kong

Videos

Kong Builders Nov 16- Introducing Kong Gateway Operator

See Kong in action

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

Get a Demo
Topics
KubernetesAPI GatewayKong Gateway
Kat Morgan

Recommended posts

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

How to Manage Your Kubernetes Services with an API Gateway

Kong Logo
EngineeringApril 9, 2024

Kubernetes is an open-source container orchestration system for automating deployment, scaling, and management of containerized applications. It groups containers into logical units for easy management and discovery.  API gateways sit between client

Peter Barnard

Sending Traffic Across Namespaces with Gateway API

EngineeringMarch 8, 2024

In this blog post, we’ll demonstrate how easy it is to use Gateway API HTTPRoutes to route traffic to workloads deployed in different namespaces in a single Kubernetes cluster — a process that’s easier than ever. Previously, we only had Ingress API

Grzegorz Burzyński

Gateway API vs Ingress: The Future of Kubernetes Networking

EngineeringJanuary 31, 2024

As Kubernetes has become the de facto orchestration platform for deploying cloud native applications , networking and traffic management have emerged as pivotal challenges when managing access to services and infrastructure. The core Kubernetes Ing

Peter Barnard

Kong Konnect EKS Marketplace Add-on for Kong Gateway Data Planes

EngineeringDecember 7, 2023

Today, we’re excited to release the Kong Konnect EKS Marketplace add-on as a means to deploy your Kong Gateway dataplanes in AWS. The add-ons are a step forward in providing fully managed Kubernetes clusters. It is here to simplify the post-procurem

Danny Freese

Kubernetes Gateway API: An Engineering Perspective

EngineeringNovember 8, 2023

The Kubernetes Gateway API represents a massive collaborative effort and key advancement in Kubernetes networking. Developed by multiple vendors and community members, the Gateway API provides a robust and extensible new standard for managing ingres

Mattia Lavacca

Gateway API: From Early Years to GA

EngineeringNovember 7, 2023

In the Kubernetes world, the Ingress API has been the longstanding staple for getting access to your Services from outside your cluster network. Ingress has served us well over the years and can be found present in several dozen different implementa

Shane Utt

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