In the docs on requirements for Pods and Services, it says:
Service association : A pod must belong to at least one Kubernetes service even if the pod does NOT expose any port.
I have Deployments that don’t expose any ports (kafka consumers, resque workers, shell pods, etc.). What sort of Service should I create? Does it matter if it’s ClusterIP, or should I create a headless service? (.spec.clusterIP = None)
If I create a Service that doesn’t have anything for spec.ports, I get an error from the Kubernetes API. Do I just choose some arbitrary port for the service, even if the pod doesn’t expose that port? Does it matter what name/protocol I give it?
Also, what’s the reasoning for this? It seems like a really awkward requirement that doesn’t fit with the abstractions of Kubernetes.