Closed GKTheOne closed 5 years ago
@GKTheOne #16 was merged. I can't currently think of a case where a selector-less service would be a valid service definition.
We use them in our clusters so that code can be written environment agnostic.
eg, "third-party.external" can point to a mock service in the test environment, but the real third-party host(s) in production.
http://kubernetes.io/docs/user-guide/services/#services-without-selectors
@sstarcher can we discuss this and possibly re-open the PR as it sounds like it is still valid?
Your use case of wanting to check the health of a service without a selector is a valid case, but I believe it's a separate case from the usecase for the current check-kube-service-available
as it relies on the kubernetes probes.
To validate the health of a service that does not have a pod would need to be a bespoke action per service as it does not have probes that can validate it's health.
n/a
Currently the check-kube-service-available script requires an explicit service list. I'd like it to be able to verify all services in the cluster.
Note: I do have some code for this but I want to see how PR #16 goes first.
Also, as a general question, what is the opinion on validating selector-less services?
At the moment the script would look through ALL pods in the cluster for a selector-less service, which is probably a bug. My thought is to just check that a selector-less service has an endpoint.
(Actually my thought is to check for an endpoint for all services and rely on Kubernetes readiness checks to add/withdraw endpoints, along with the check-kube-pods-pending script this should cover the functionality of the check-kube-service-available script and cover all services. It would also cover the case where a pod is Ready, but it's readiness check prevents it from being a service endpoint)