Skip to content

buraksekili/multiple-tyk-gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multiple Tyk Gateway

Problem

Previously, running multiple instances of Tyk Gateway without Tyk Dashboard causes a synchronization issue.

Assume that you have the following setup:

multiple-tyk-gateway

The service object forwards incoming requests to one of the Tyk Gateway pods. Eventually, your ApiDefinition will be saved one of the Pod which handled the request. So, other Pod is unaware of existence of this ApiDefinition.

For example, let's suppose the ApiDefinition is created on Tyk Gateway 1.

tyk-gateway-api-def

At the moment, since Tyk Gateway 2 does not have ApiDefinition X, any incoming requests regarding ApiDefinition X cannot be processed properly on Tyk Gateway 2.

For example, If you send a HTTP request to Service in order to retrieve ApiDefinition X, you may face with 404 response because your request might be forwarded to a pod where the ApiDefinition was not created.

Demo

To solve this problem, you can use Persistent Volumes with Tyk Operator.

Each Gateway pod will use shared persistent volumes, so that each of them can access to same files. However, this is not enough. Since Gateway requires hot-reloads, you need to send additional group reload request each time. Tyk Operator helps us to solve this.

solution


Prepare environment

  • Create a cluster
kind create cluster --config ./manifests/kind.yaml

If you are using other clusters, Minikube or Cloud Providers, please update Persistent Volume according to your cluster information.

  • Install Tyk Gateway, Tyk Operator and their dependencies
./install.sh

This script depends on helm and kubectl.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages