Third-party Service Support
Third-party Service Classification
The most important thing for third-party services is the service communication address provided by the user. Therefore, we divide third-party services into two categories according to the way the user provides the service communication address:
Static Registration of Third-party Services
As the name suggests, such third-party services are users who provide one or more fixed service communication addresses when they are created, which we call Endpoints. The communication request traffic will be fixed to these targets.
Dynamic Registration of Third-party Services
Compared with static registration, usually our service may also be a dynamic communication address. Therefore, we support APIs provided by third-party service registration centers (etcd, zookeeper, consul) or Kato to allow users to dynamically change the service communication address . We call this type of dynamic registration third-party service.
After the third-party service is created in Kato, the Kato application runtime service will automatically start to maintain the service endpoints. After Kato obtains the service communication address list through the above two methods, it will create a model for each service to store the service’s Endpoints information. After this model works, it will perform a health check on the service according to the health check policy configured by the user, thereby presenting the health status of the service Endpoints.
The health check is divided into TCP check and HTTP check, which correspond to different service types. If the instance is in an unhealthy state, there will be two processing methods: offline or no processing. The current default setting is no processing. When the user is set to offline, the instance will be offline from the cluster when the instance is unhealthy, so that the gateway or other services will Unhealthy instances will not be accessed.
Kato’s Service Access Security Control
The Kato service performs internal service registration by setting the internal and external opening properties of the port, which is actually similar to the concept of a firewall. [Reference document](/docs/user-manual/component-op/service-port-domain/#Port access control), as for third-party services, by setting the internal and external opening properties of the port to control whether the current service The gateway or other services enable access.
Third-party Service Port Settings
Like built-in services, third-party services also need to set ports, the difference is that third-party services are more flexible. In the current version, we stipulate that third-party services can only add one port. What is the relationship between this port and the port that the service actually monitors?
Normally, we recommend setting the port to be consistent with the listening port for easy understanding. When adding service endpoints, users only need to provide the IP address of the service, and fill in multiple IP addresses for multiple instances of the service. For these services, we default to the same listening port, so Kato will use the IP defined by Endpoint and the port defined by the service to form the communication address when communicating with these services.
Docking Service Gateway
After the third-party service configures the port, the external service will generate the default access domain name for the HTTP type like the built-in service. After the application gateway receives the service request, it will load balance to the Endpoints endpoint of the service. This principle is consistent with the built-in service, please refer to application gateway
Access to Other Services
Like built-in services, other services need to rely on third-party services when they need to access third-party services. At this time, the Kato ServiceMesh mechanism will work. According to the service port configured by the user, a local listener will be established in the access-side service network space, and the Endpoints of the service will be monitored. Load balancing and other service management.