Exposing pod at different times to multiple external services

55 Views Asked by At

How can I expose a pod's endpoints to two external kubernetes services (i.e. load balancer) in two phases? It's important that the first service have access to the pod's endpoints before the second service does. The first service is required to initialize the pod with data and keep its state updated throughout the pods lifetime. The second service needs the pod to be initialized before it can allow its client to reach the pod.

The only solution I could think of seems like a hack and I'm not even sure if it'll work in production: To initiate phase two a pod label would be added to the pod. The corresponding selector would only be used in the second service. Adding a pod label would be done in the application code since this needs to be automated.

0

There are 0 best solutions below