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. A Cloud Native + Infrastructure as Code Love Story
Engineering
November 17, 2021
4 min read

A Cloud Native + Infrastructure as Code Love Story

Kat Cosgrove
Topics
Cloud NativeCloudAutomation
Share on Social

More on this topic

eBooks

APIOps: Automating the API Lifecycle with DevOps and GitOps

eBooks

The Evolution of APIs: From Cloud Age and Beyond

See Kong in action

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

Get a Demo

We love abstractions. We want to make things easier for developers, teams and end users. In doing that, sometimes we build things a little bit too complex for those who don't already understand the pain points for which the abstraction layers were built. Kubernetes is an example of this; it solves a very real, very painful problem, but it is notoriously difficult to wrap your head around. The scale of the work it does for us means that it covers so much ground that one person can't possibly have the necessary expertise to babysit every aspect.

Fortunately, an entire ecosystem has formed around Kubernetes and cloud native development. Tools upon tools, open source or commercial, have sprung up to relieve some of the pain points involved in application development today. It doesn't have to be so difficult anymore, and you may not even need to learn much to take advantage of it. These tools are built for the cloud, first and foremost, solving different problems while using skills your team probably already has.

One such tool is Kong Gateway, allowing you to manage the communications between your microservices and your clients at lightning speed. It even includes a Kubernetes Ingress Controller, using native CRDs so you can tightly control any aspect of an API gateway that you might want.

We also have ways to make infrastructure deployment faster and more familiar for developers. Pulumi is infrastructure as code. When I say infrastructure as code, I mean really code—you can stand up whatever infrastructure you want on whatever cloud provider you like. Plus, deploy your application in a language you're probably already familiar with—Python, Typescript, C#, and of course, because we're cloud native, Go.

Standing up your Kubernetes cluster on whatever cloud provider you like is relatively low impact, requiring only about 50 lines of Python code. This can even live right alongside your application code if you want. It's the way cloud engineering was meant to be done, with minimal complexity and maximum impact.

Kong and Pulumi Together

Standing up a vanilla Kubernetes cluster isn't all you want to do, though, is it? Surely you want to take advantage of some of the fancy cloud native tooling I mentioned earlier to make managing that cluster less painful and more secure? Perhaps, implementing an API gateway? Well, it turns out Pulumi and Kong work really well together. In Python, let's look at how to stand up a Kubernetes cluster on DigitalOcean and deploy Kong Ingress Controller with Pulumi!
For this, you'll need a Pulumi account and the Pulumi CLI installed. You will also need a Digital Ocean account and Pulumi set up to access Digital Ocean.

Create a new directory called kong-ingress and initialize a new Pulumi project inside of it with pulumi new python -y.
Now activate your virtual environment with source /venv/bin/activate and run pip3 install pulumi_digitalocean pulumi_kubernetes to install your dependencies. We're ready to go, and from here on out, we'll be adding code to __main__.py.

First, get our config values to define what our cluster looks like and tell Digital Ocean to use the latest version of Kubernetes.

Here, we're provisioning the cluster itself, setting up the Kubernetes provider for Pulumi and adding a namespace for better organization.

Below is all it takes to deploy Kong using a Helm chart while applying a transformation to it simultaneously. In this case, we're using a small helper function to look at the custom resource definition and remove the "status" object so that the Helm chart doesn't return it. It is also possible to deploy via config files without much more code than this.

Finally, we're getting the Kong Ingress resource that we've just deployed and exporting its ingress URL so that we know where it is.

To run this, set your config values from the terminal.

Then run pulumi up and watch! In a few minutes, you'll have a fully functional Kubernetes cluster with four nodes deployed to Digital Ocean and running a Kong Ingress Controller, all in around 60 lines of code. When you're ready to tear this down, run pulumi destroy and watch it disappear! If you want to copy and paste the running code, you can find it in this GitHub repo.

If you want to go a bit further, click here or watch the video below to learn how to use Pulumi to provision an AWS EC2 instance and configure it as an API gateway data plane for Kong Konnect!

Topics
Cloud NativeCloudAutomation
Share on Social
Kat Cosgrove

Recommended posts

Unlocking API Analytics for Product Managers

Kong Logo
EngineeringSeptember 9, 2025

Meet Emily. She’s an API product manager at ACME, Inc., an ecommerce company that runs on dozens of APIs. One morning, her team lead asks a simple question: “Who’s our top API consumer, and which of your APIs are causing the most issues right now?”

Christian Heidenreich

How to Build a Multi-LLM AI Agent with Kong AI Gateway and LangGraph

Kong Logo
EngineeringJuly 31, 2025

In the last two parts of this series, we discussed How to Strengthen a ReAct AI Agent with Kong AI Gateway and How to Build a Single-LLM AI Agent with Kong AI Gateway and LangGraph . In this third and final part, we're going to evolve the AI Agen

Claudio Acquaviva

How to Build a Single LLM AI Agent with Kong AI Gateway and LangGraph

Kong Logo
EngineeringJuly 24, 2025

In my previous post, we discussed how we can implement a basic AI Agent with Kong AI Gateway. In part two of this series, we're going to review LangGraph fundamentals, rewrite the AI Agent and explore how Kong AI Gateway can be used to protect an LLM

Claudio Acquaviva

How to Strengthen a ReAct AI Agent with Kong AI Gateway

Kong Logo
EngineeringJuly 15, 2025

This is part one of a series exploring how Kong AI Gateway can be used in an AI Agent development with LangGraph. The series comprises three parts: Basic ReAct AI Agent with Kong AI Gateway Single LLM ReAct AI Agent with Kong AI Gateway and LangGr

Claudio Acquaviva

Build Your Own Internal RAG Agent with Kong AI Gateway

Kong Logo
EngineeringJuly 9, 2025

What Is RAG, and Why Should You Use It? RAG (Retrieval-Augmented Generation) is not a new concept in AI, and unsurprisingly, when talking to companies, everyone seems to have their own interpretation of how to implement it. So, let’s start with a r

Antoine Jacquemin

AI Gateway Benchmark: Kong AI Gateway, Portkey, and LiteLLM

Kong Logo
EngineeringJuly 7, 2025

In February 2024, Kong became the first API platform to launch a dedicated AI gateway, designed to bring production-grade performance, observability, and policy enforcement to GenAI workloads. At its core, Kong’s AI Gateway provides a universal API

Claudio Acquaviva

Scalable Architectures with Vue Micro Frontends: A Developer-Centric Approach

Kong Logo
EngineeringJanuary 9, 2024

In this article, which is based on my talk at VueConf Toronto 2023, we'll explore how to harness the power of Vue.js and micro frontends to create scalable, modular architectures that prioritize the developer experience. We'll unveil practical strate

Adam DeHaven

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 KonnectKong GatewayKong AI GatewayKong InsomniaDeveloper PortalGateway ManagerCloud GatewayGet a Demo
Explore More
Open Banking API SolutionsAPI Governance SolutionsIstio API Gateway IntegrationKubernetes API ManagementAPI Gateway: Build vs BuyKong vs PostmanKong vs MuleSoftKong vs Apigee
Documentation
Kong Konnect DocsKong Gateway DocsKong Mesh DocsKong AI GatewayKong Insomnia DocsKong Plugin Hub
Open Source
Kong GatewayKumaInsomniaKong Community
Company
About KongCustomersCareersPressEventsContactPricing
  • Terms•
  • Privacy•
  • Trust and Compliance•
  • © Kong Inc. 2025