Determining ingress host availability across Kubernetes clusters
Lets say you have two apps available at a.b.com and x.y.com and you have 3 available Kubernetes it could potentially be deployed on, clusterA, clusterB and clusterC. Generally upstream from your cluster LoadBalancers you will have another cloud load balancer device or you are just using some sort of DNS service to control what cluster LoadBalancer IPs are relevant for each application at any given time. To be clear I’m NOT describing health checks here, but mearly existence checks; this distinction is important.
So what you can do in this case is list all possible cluster IPs as possible targets for those FQDNs hostname, but enable/disable them based on calls to some discovery like service that resides on all potential clusters. For this use-case I ended up creating https://github.com/bitsofinfo/kubernetes-ingress-info. For this to work, you need ensure each possible target cluster Ingress Controller
that is behind a LoadBalancer
has kubernetes-ingress-info
accessible via its own unique Ingress
.
This tool was specifically developed to serve as a endpoint for various cloud load-balancers and DNS services to be able to auto-detect which Kubernetes clusters are valid for a specific host
FQDN. This can aid in workload migration across various clusters or just enable workloads to be deployed to subsets of clusters out of many organizational clusters, while letting upstream DNS and or glsb based devices react accordingly as many of these platforms rely on simple HTTP 200 OK type of "checks".
Again, it’s important to note that this API does not report on the health of any given Ingresshost
but specifically whether or not ANY Ingress
currently exists on the cluster where kubernetes-ingress-info
is deployed, regardless of if its backend is actually up and healty. It is intended to be a very lightweight and open endpoint to interrogate for this status. This distinction however is important.
I’m currenently involted in a project that is rolling this capability out to production and hope it will be of use to others as well. Check it out at: https://github.com/bitsofinfo/kubernetes-ingress-info
Originally published at http://bitsofinfo.wordpress.com on July 12, 2019.