/demo-argo-selfmanaged

Demo - Tyk Self-Managed deployed with ArgoCD

Mozilla Public License 2.0MPL-2.0

Demo: deploying Tyk self-managed platform with ArgoCD

Warning: this is a demo project - not production ready.

Follow along to deploy 2 environments with ArgoCD and Tyk Self-Managed. You will need a license for Tyk Self-Managed. You can register for a free trial: https://tyk.io/sign-up/#self.

This demo is based on the blog post:

Create local Kubernetes cluster for staging and production

In this demo, we will assume 2 environments (staging and prod) running in minikube:

minikube start -p staging
minikube start -p production

Later, to list the clusters:

minikube profile list

Then to switch cluster use kubectx:

kubectx staging
kubectx production

Deploy staging

Switch to the staging cluster

kubectx staging

Install ArgoCD

Here are the commands needed to Install ArgoCD on your cluster. Refer to ArgoCD documentation for more details.

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Log in to ArgoCD

Forward the local port 9080 to ArgoCD's secure port (443) to access ArgoCD UI interface:

kubectl port-forward svc/argocd-server -n argocd 9080:443

Download and install Argo CD CLI and retrieve default admin password:

argocd admin initial-password -n argocd

Argo admin UI (empty)

Create ArgoCD applications and deploy Tyk Self-Managed

  • Clone this repository locally
  • Replace YOUR-LICENSE-GOES-HERE with your Tyk self-managed license in ./staging/argo-applications-tyk/tyk-stack.yml. You can register for a free trial: https://tyk.io/sign-up/#self.
  • Start by deploying the dependencies (configuration, Redis, PostgreSQL):
cd ./staging/argo-applications-tyk
kubectl apply -f tyk-config-secrets.yml
kubectl apply -f tyk-redis.yml
kubectl apply -f tyk-postgres.yml

Wait for all the applications to be Healthy and Synched, then deploy Tyk Self-Managed:

kubectl apply -f tyk-stack.yml

Argo admin UI (Tyk Self-Managed deployed)

Try it out

Port forward Tyk Gateway:

kubectl port-forward svc/gateway-svc-tyk-stack-tyk-gateway 8080:8080 -n tyk

Check that it is healthy by sending a request to the health endpoint: http://localhost:8080/hello.

Port forward Tyk Dashboard:

kubectl port-forward svc/dashboard-svc-tyk-stack-tyk-dashboard 3000:3000 -n tyk

Log into Tyk Dashboard: http://localhost:3000 (default@example.com / 123456 if you haven't changed the default from the Helm chart).

Deploy Tyk Operator

Configure an Argo CD application to deploy Tyk Operator and Cert Manager. Tyk Operator enables the management of Tyk API Gateway within Kubernetes, and Cert Manager handles SSL/TLS for secure communication.

kubectl apply -f application-cert-manager.yaml
kubectl apply -f application-tyk-operator.yaml

Sync API Definitions

API Definitions are going to be stored into the direction ./api-definitions. Let's create an Argo app to synced the API Definitions automatically from GitHub:

kubectl apply -f application-api-definitions.yaml

Try it out


Deploy production

Switch to the staging cluster

kubectx production

Install ArgoCD

Here are the commands needed to Install ArgoCD on your cluster. Refer to ArgoCD documentation for more details.

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Log in to ArgoCD

Forward the local port 9080 to ArgoCD's secure port (443) to access ArgoCD UI interface:

kubectl port-forward svc/argocd-server -n argocd 9080:443

Download and install Argo CD CLI and retrieve default admin password:

argocd admin initial-password -n argocd

Argo admin UI (empty)

Create ArgoCD applications and deploy Tyk Self-Managed

  • Clone this repository locally
  • Replace YOUR-LICENSE-GOES-HERE with your Tyk self-managed license in ./staging/argo-applications-tyk/tyk-stack.yml. You can register for a free trial: https://tyk.io/sign-up/#self.
  • Start by deploying the dependencies (configuration, Redis, PostgreSQL):
cd ./production/argo-applications-tyk
kubectl apply -f tyk-config-secrets.yml
kubectl apply -f tyk-redis.yml
kubectl apply -f tyk-postgres.yml

Wait for all the applications to be Healthy and Synched, then deploy Tyk Self-Managed:

kubectl apply -f tyk-stack.yml

Argo admin UI (Tyk Self-Managed deployed)

Try it out

Port forward Tyk Gateway:

kubectl port-forward svc/gateway-svc-tyk-stack-tyk-gateway 8080:8080 -n tyk

Check that it is healthy by sending a request to the health endpoint: http://localhost:8080/hello.

Port forward Tyk Dashboard:

kubectl port-forward svc/dashboard-svc-tyk-stack-tyk-dashboard 3000:3000 -n tyk

Log into Tyk Dashboard: http://localhost:3000 (default@example.com / 123456 if you haven't changed the default from the Helm chart).

Contributions welcome

  1. Contribution guidelines
  2. PR template
  3. Bug report template
  4. Feature request template
  5. Contributor License Agreement - This will enforce your contributors to sign the CLA on the first time they submit a PR.
  6. License from tyk-gateway
  7. Default Repo README, which resides in /.github