Prepare to Administer Kong Gateway

Before getting started with using Kong Gateway, verify that it was installed correctly, and that you’re ready to administer it.

Before you begin

Before you start this section, make sure that:

  • Kong Gateway is installed and running.
  • Kong Manager (if applicable) and Kong Admin API ports are listening on the appropriate port/IP/DNS settings.
  • If using declarative configuration to configure Kong Gateway, decK is installed.

In this guide, an instance of Kong Gateway is referenced via <admin-hostname>. Make sure to replace <admin-hostname> with the hostname of your control plane instance.

Verify the Kong Gateway configuration

Using Kong Manager

Using the Admin API

Using decK (YAML)

As a Kong Gateway user, you can use Kong Manager for environment administration. You’re going to use it later on in this guide, so first make s ure you can access Kong Manager.

Open a web browser and navigate to http://<admin-hostname>:8002.

If Kong Gateway was installed correctly, it automatically logs you in and presents the Kong Manager Overview page.

Ensure that you can send requests to the gateway’s Admin API using either cURL or HTTPie.

View the current configuration by issuing the following command in a terminal window:

cURL

HTTPie

  1. curl -i -X GET http://<admin-hostname>:8001
  1. http <admin-hostname>:8001

The current configuration returns.

  1. Check that decK is connected to Kong Gateway:

    1. deck ping

    You should see a success message with the version that you’re connected to:

    1. Successfully connected to Kong!
    2. Kong version: 2.1.0
  2. Ensure that you can pull configuration from Kong Gateway by issuing the following command in a terminal window:

    1. deck dump

    This command creates a kong.yaml file with the gateway’s entire current configuration, in the directory where decK is installed.

    You can also use this command at any time (for example, after a deck sync) to see the Kong Gateway’s most recent configuration.

    Be careful! Any subsequent deck dump will overwrite the existing kong.yaml file. Create backups as needed.

  3. Open the file in your preferred code editor. Since you haven’t configured anything yet, the file should only contain the decK version:

    1. _format_version: "1.1"

    You will use this file to configure Kong Gateway.

(Optional) Verify Control Plane and Data Plane connection

If you’re running Kong Gateway in hybrid mode, you need to perform all tasks in this guide from the control plane. You can check that all of your configurations are being pushed from the control plane to your data planes using the Cluster Status CLI.

Run the following from a control plane:

cURL

HTTPie

  1. curl -i -X GET http://<admin-hostname>:8001/clustering/data-planes
  1. http :8001/clustering/data-planes

The output shows all of the connected data plane instances in the cluster:

  1. {
  2. "data": [
  3. {
  4. "config_hash": "a9a166c59873245db8f1a747ba9a80a7",
  5. "hostname": "data-plane-2",
  6. "id": "ed58ac85-dba6-4946-999d-e8b5071607d4",
  7. "ip": "192.168.10.3",
  8. "last_seen": 1580623199,
  9. "status": "connected"
  10. },
  11. {
  12. "config_hash": "a9a166c59873245db8f1a747ba9a80a7",
  13. "hostname": "data-plane-1",
  14. "id": "ed58ac85-dba6-4946-999d-e8b5071607d4",
  15. "ip": "192.168.10.4",
  16. "last_seen": 1580623200,
  17. "status": "connected"
  18. }
  19. ],
  20. "next": null
  21. }

Summary and next steps

In this section, you learned about the methods of administering Kong Gateway and how to access its configuration. Next, go on to learn about exposing your services with Kong Gateway.