API Gateway With Kong

Intro API Kong Gateway And Docker Demo

Btech Engineering
btech-engineering
4 min readNov 6, 2022

--

Kong Gateway

Kong Gateway is a lightweight, fast, and flexible cloud-native API gateway. An API gateway is a reverse proxy that lets you manage, configure, and route requests to your APIs. — Konghq

What Is Kong?

Kong act as Restful API to provide comunicate between client and microservice mesh. Kong Gateway runs in front of any RESTful API and can be extended through modules and plugins. Based on documentation, the user can do several things with Kong Gateway

  • Leverage workflow automation and modern GitOps practices
  • Decentralize applications/services and transition to microservices
  • Create a thriving API developer ecosystem
  • Proactively identify API-related anomalies and threats
  • Secure and govern APIs/services, and improve API visibility across the entire organization.

Kong gateway offers 2 product for API Gateway service, enterprise and Open-Source. The most striking difference is in the use of plugins, if the need to use the basic functions of Kong is enough to use OSS, if it is necessary to use advanced plugins, it is necessary to use the enterprise version. In this article we’ll show how to install Kong Gateway on Docker.

How It Works?

And here is an illustration, how Kong Gateway manages incoming traffic and responds to it:

  • From Client send Request to Kong By Hit Kong Endpoint
  • Kong will provide request and forward to Backend
  • Backend will respos request and sending response back to Kong
  • Kong will Forward Response from Backend to Client

Where can install?

Kong provide any method for installation (Containerized and VM Based) you can see more in here

Konghq.com

Demo

Overview

In this demo we’ll install Kong on docker with DB Less Mode and DB Mode

Prerequires

For this installation, make sure that you have installed docker engine on your machine

Step-by-Step

For the first demo we will using Kong DB Less Mode

Create Docker Network

Create Volume

Prepare your declarative configuration file

Start the Kong

Check

The Second Demo we use DB

Create Network

Start database (2 Option Choose one)

Prepare database

Start Kong

Test

Closing

What Next?

For the next article we’ll try to use Kong Gateway Pluging (Kong Administration) to help our job with kong. Stay tune …

By Sulaiman, Ops Team Btech

--

--

Btech Engineering
btech-engineering

Our mission is continuous learning and remember together is better.