Kubernetes (k8s) has a number of internal APIs that are used for the complex orchestration of containers. When using k8s as the underlying orchestration platform, Grey Matter Control can utilize some of these APIs to also do easy service announcement and discovery.
The Grey Matter Control server will discover services based on their pod IP and container port, see the kubernetes specifications in the setup docs for how to configure your deployments for service discovery. Also, see the example deployment.
Behavior
As described in the Grey Matter Control service discovery kubernetes docs, the Grey Matter Control server will discover from namespaces specified on startup by the environment variable GM_CONTROL_KUBERNETES_NAMESPACES. In the case that a Kubernetes namespace that Control is configured to discover from is or becomes undiscoverable (see permissions), the Control server follows a specific pattern of behavior.
If a namespace goes down, the Control server will label the connection to the namespace as having a bad state. It will retain the last known state of discovered pods for the namespace and generate clusters for them. If the namespace eventually becomes discoverable again, it will update its pod list accordingly. In the meantime, it will continue to poll the unavailable namespace, and it will be left up to EDS to determine the endpoint health for the last known state of the pods.
Example Deployment
The Kubernetes Deployment below is properly setup (label and port) to be discovered by the Grey Matter Control server.