Kong API Gateway

fulvi0TRIAL

10 months ago

Description: Setup for Kong Gateway with PostgreSQL and Konga UI management.

Category: Other

URL: https://railway.app/template/Addl8t

4 Replies

10 months ago

${POSTGRES_PASSWORD:-kong} is not valid syntax for templates.

Use reference variables - https://docs.railway.app/guides/variables#referencing-another-services-variable

Please temporarily unpublish this template until you have a working template.


cineqHOBBY

7 months ago

Is it possible to use PosgtreSQL and Kong with internal connection? When I tried this I receive kons deployment errors like:

[warn] 1#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/kong/nginx.conf:7 nginx:

[warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/kong/nginx.conf:7 2024/09/13 10:55:10

[error] 1#0: init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:664: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: No address associated with hostname stack traceback: [C]: in function 'assert' /usr/local/share/lua/5.1/kong/init.lua:664: in function 'init' init_by_lua(nginx-kong.conf:45):3: in main chunk nginx:

[error] init_by_lua error: /usr/local/share/lua/5.1/kong/init.lua:664: [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: No address associated with hostname stack traceback: [C]: in function 'assert' /usr/local/share/lua/5.1/kong/init.lua:664: in function 'init' init_by_lua(nginx-kong.conf:45):3: in main chunk

kong config:
KONG_ADMIN_ACCESS_LOG="/dev/stdout"

KONG_ADMIN_ERROR_LOG="/dev/stderr"

KONG_ADMIN_LISTEN="0.0.0.0:8001, 0.0.0.0:8444 ssl"

KONG_DATABASE="postgres"

KONG_PG_DATABASE="${{Postgres.PGDATABASE}}"

KONG_PG_HOST="${{Postgres.PGHOST}}"

KONG_PG_PASSWORD="${{Postgres.PGPASSWORD}}"

KONG_PG_PORT="${{Postgres.PGPORT}}"

KONG_PG_USER="${{Postgres.PGUSER}}"

KONG_PROXY_ACCESS_LOG="/dev/stdout"

KONG_PROXY_ERROR_LOG="/dev/stderr"

postgres config (working one):
DATABASE_PRIVATE_URL="postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"

DATABASE_URL="postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"

PGDATA="/var/lib/postgresql/data/pgdata"

PGDATABASE="${{POSTGRES_DB}}"

PGHOST="${{RAILWAY_TCP_PROXY_DOMAIN}}"

PGPASSWORD="${{POSTGRES_PASSWORD}}"

PGPORT="${{RAILWAY_TCP_PROXY_PORT}}"

PGPRIVATEHOST="${{RAILWAY_PRIVATE_DOMAIN}}"

PGUSER="${{POSTGRES_USER}}"

POSTGRES_DB="XXXX"

POSTGRES_PASSWORD="XXXXXXXXXXXXXXXXXXXXXXX"

POSTGRES_USER="XXXX"

SSL_CERT_DAYS="820"

Only public networking with TCP proxy seems to work unfortunately. Do I miss smth?


cineqHOBBY

7 months ago

Ok seems like this is kong problem not supporting IPv6. I think that this solution can help:

https://github.com/Kong/kong/discussions/7304#discussioncomment-1968390


cineq

Ok seems like this is kong problem not supporting IPv6. I think that this solution can help:https://github.com/Kong/kong/discussions/7304#discussioncomment-1968390

AnonymousHOBBY

2 months ago

Hey! Maybe you have a ready-made template that you could share? I would be very grateful.