Kong, Install, run on RHEL7 and some resources

By rami.sedhom, 25 March, 2022

Install and Run

  1. Download Kong OSS v1.5 for RHEL: curl -Lo kong-1.5.0.rhel7.amd64.rpm $( rpm --eval "https://download.konghq.com/gateway-1.x-rhel-7/Packages/k/kong-1.5.0.rhel7.amd64.rpm")
  2. Install it: sudo yum install kong-1.5.0.rhel7.amd64.rpm
  3. Init configuration to use YAML file instead of database, following command create kong.yml in home directory: kong config init
  4. Create kong configuration file from the default file:
    cd /etc/kong
    sudo cp kong.conf.default kong.conf
  5. Change configuration file so it is aware of the YAML declarative configuration file:
    database = off
    declarative_config = /home/apiteam/kong.yml
  6. Run Kong migrations: kong migrations bootstrap
  7. Add kong path to $PATH of sudoer secure_path (2): by running sudo visudo and edit the secure path line:
    Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
  8. Change admin_listen to allow connection from any client(3):

    -#admin_listen = 127.0.0.1:8001, 127.0.0.1:8444 ssl
    +admin_listen = 0.0.0.0:8001, 127.0.0.1:8444 ssl
  9. Start Kong: sudo kong start
  10. Verify the installation by checking the Admin API: curl -l http://localhost:8001`
    It should return 200 status code

Note

  • By default, Kong listens on the following ports:
    • :8000: Port on which listens for incoming HTTP traffic from your clients, and forwards it to your upstream services.
    • :8443: Port on which listens for incoming HTTPS traffic. This port has similar behavior as the :8000 port, except that it expects HTTPS traffic only.
    • :8001: Port on which the Admin API used to configure listens.
    • :8444: Port on which the Admin API listens for HTTPS traffic.

References

  1. Install Kong Gateway on RHEL
  2. How to set path for sudo commands
  3. Securing the Admin API > Network Layer Access Restrictions

Other Resources