From 91bcb8d2cccf7b5e022a5d7c5aa4f1f176111a2a Mon Sep 17 00:00:00 2001 From: Zachary Hu Date: Mon, 15 Aug 2022 22:33:40 +0800 Subject: [PATCH] feat(redis) support spec tests with redis cluster Kong currently does not support connection to redis cluster and will be fixed in FTI-2104. For pongo to support redis cluster, we need to define the Pongo network with custom subnet (required by Docker Compose). Also, we should support an ENV to load redis cluster seeds: KONG_SPEC_TEST_REDIS_CLUSTER_ADDRESSES --- assets/docker-compose.yml | 6 ++++++ assets/pongo_entrypoint.sh | 2 ++ 2 files changed, 8 insertions(+) diff --git a/assets/docker-compose.yml b/assets/docker-compose.yml index 8046a52c..b497d4da 100644 --- a/assets/docker-compose.yml +++ b/assets/docker-compose.yml @@ -3,6 +3,12 @@ version: '3.5' networks: pongo-test-network: name: ${SERVICE_NETWORK_NAME} + driver: bridge + attachable: true + ipam: + config: + - subnet: 192.168.56.0/21 + gateway: 192.168.56.1 services: expose: diff --git a/assets/pongo_entrypoint.sh b/assets/pongo_entrypoint.sh index 35750fd5..b1e922ac 100755 --- a/assets/pongo_entrypoint.sh +++ b/assets/pongo_entrypoint.sh @@ -69,6 +69,8 @@ export KONG_LOG_LEVEL=debug export KONG_SPEC_REDIS_HOST=redis # Kong test-helpers 3.0.0+ export KONG_SPEC_TEST_REDIS_HOST=redis +# Support Redis Cluster +export KONG_SPEC_TEST_REDIS_CLUSTER_ADDRESSES='["rc-node-1:6379","rc-node-2:6379","rc-node-3:6379"]' # set the certificate store export KONG_LUA_SSL_TRUSTED_CERTIFICATE=/etc/ssl/certs/ca-certificates.crt