Created
August 24, 2021 20:26
-
-
Save laughingbiscuit/90ca227c7a98a7fdf201b49377d011f1 to your computer and use it in GitHub Desktop.
Kong Hybrid (OSS) in 5 Commands!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker network create kong-net | |
docker run -d --name kong-db \ | |
--network=kong-net \ | |
-p 5432:5432 \ | |
-e "POSTGRES_USER=kong" \ | |
-e "POSTGRES_DB=kong" \ | |
-e "POSTGRES_PASSWORD=kong" \ | |
postgres:9.6 | |
docker run --rm --network=kong-net \ | |
-e "KONG_DATABASE=postgres" \ | |
-e "KONG_PG_HOST=kong-db" \ | |
-e "KONG_PG_PASSWORD=kong" \ | |
-e "KONG_PASSWORD=password" \ | |
kong kong migrations bootstrap | |
docker run -d --name kong-cp --network=kong-net \ | |
-e "KONG_DATABASE=postgres" \ | |
-e "KONG_PG_HOST=kong-db" \ | |
-e "KONG_PG_PASSWORD=kong" \ | |
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \ | |
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \ | |
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \ | |
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \ | |
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001" \ | |
-e "KONG_ROLE=control_plane" \ | |
-e "KONG_CLUSTER_CERT=/tmp/cluster.crt" \ | |
-e "KONG_CLUSTER_CERT_KEY=/tmp/cluster.key" \ | |
-v "$PWD/certs/cluster.crt:/tmp/cluster.crt" \ | |
-v "$PWD/certs/cluster.key:/tmp/cluster.key" \ | |
-p 8000:8000 \ | |
-p 8443:8443 \ | |
-p 8001:8001 \ | |
-p 8444:8444 \ | |
kong | |
docker run -d --name kong-dp --network=kong-net \ | |
-e "KONG_ROLE=data_plane" \ | |
-e "KONG_DATABASE=off" \ | |
-e "KONG_PROXY_LISTEN=0.0.0.0:8000" \ | |
-e "KONG_CLUSTER_CONTROL_PLANE=kong-cp:8005" \ | |
-e "KONG_CLUSTER_CERT=/tmp/cluster.crt" \ | |
-e "KONG_CLUSTER_CERT_KEY=/tmp/cluster.key" \ | |
-v "$PWD/certs/cluster.crt:/tmp/cluster.crt" \ | |
-v "$PWD/certs/cluster.key:/tmp/cluster.key" \ | |
-p 8002:8000 \ | |
kong |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
remember to create certs with
kong hybrid gen_cert
as a prerequisite!