Kong on Azure Container apps with PostgreSQL

Please help to install kong gateway on Azure container apps, we are facing issue while connect with postgres SQL

Container ‘kong-gateway’ was terminated with exit code ‘1’

Container ‘kong-gateway’ was terminated with exit code ‘1’ and reason ‘ProcessExited’

Probe of StartUp failed with status code: 1

Based on the information in the knowledge sources, Kong Gateway is supported on Azure Container Apps, but your error indicates a problem connecting to PostgreSQL, which is a common issue during setup. The exit code 1 and failed startup probe typically mean Kong Gateway could not connect to the database successfully.

Here are the most common causes and solutions:

  1. Database Credentials and Configuration
    Ensure that the PostgreSQL connection details (host, port, user, password, database name) are correctly set in your environment variables. For example:

    KONG_DATABASE=postgres
    KONG_PG_HOST=<your_postgres_host>
    KONG_PG_PORT=5432
    KONG_PG_USER=kong
    KONG_PG_PASSWORD=<your_password>
    KONG_PG_DATABASE=kong
    

    These must match the actual credentials and database setup in your PostgreSQL instance. If the password is incorrect, you may see errors like “authentication exchange unsuccessful” or “password authentication failed” Kong Gateway: PostgreSQL authentication error.

  2. PostgreSQL SSL Settings
    If your PostgreSQL server requires SSL, you must set KONG_PG_SSL=on and possibly specify the SSL version with KONG_PG_SSL_VERSION=tlsv1_2 or tlsv1_3, depending on your server configuration. Mismatched SSL settings can cause Kong to fail to connect and exit with code 1 Kong Gateway: PostgreSQL SSL error.

  3. pg_hba.conf and Network Access
    If you see errors about “no pg_hba.conf entry” or “SSL off”, your PostgreSQL server may be rejecting the connection due to authentication or SSL requirements. Make sure the server allows connections from your Kong Gateway container’s IP and user, and that SSL requirements match your Kong configuration Kong Gateway: pg_hba.conf entry error.

  4. Database User and Permissions
    The database and user must exist, and the user must own the database. Example SQL to set up:

    CREATE USER kong WITH PASSWORD 'super_secret';
    CREATE DATABASE kong OWNER kong;
    

    How to use an existing PostgreSQL database with Kong

Next Steps:

  • Double-check your environment variables for database connection.
  • Ensure the database is reachable from Azure Container Apps (network/firewall).
  • Check the Kong Gateway logs for the exact error message about PostgreSQL connection.
  • Adjust SSL settings if your database requires it.

If you can provide the specific error message from the Kong Gateway logs, I can help further pinpoint the issue. If the problem persists after checking these areas, please share the log output for more targeted troubleshooting.