Services

    The main attribute of a service is its URL. You can specify the URL with a single string, or by specifying its protocol, host, port, and path individually.

    Services, in conjunction with , let you expose your services to clients with Kong Gateway. Kong Gateway abstracts the service from the clients by using routes. Since the client always calls the route, changes to the services(like versioning) don’t impact how clients make the call. Routes also allow the same service to be used by multiple clients and apply different policies based on the route used.

    In the example above, two routes can be created, say /external and , and both routes can point to hwservice. A policy can be configured to limit how often the route is used and the route can be communicated to the external client for use. When the external client tries to access the service via Kong Gateway using /external, they are rate limited. But when the internal client accesses the service via Kong Gateway using , the internal client will not be limited.

    Service configuration

    You can configure a service in Kong Gateway using the following methods: