I have a docker container that is called from other docker containers (locally) over http. My app needs to respond based on information that it finds from labels on the calling application. Specifically, the other applications are containerized applications using the AWS SDK in various languages that get credentials by hitting the instance metadata port, which I have redirected to my container. The other containers have the role provided as a label.
Question: Can I rely on a docker event stream to provide me with creation events or will it drop some? Will it be timely?
A problem would occur if a container starts with IP A, with Role X, and then it dies, and another starts with IP A but no Role. If the event stream is unreliable, then my app would give the second application Role X, when it should have no role. That would be bad.
Another problem would occur if the event stream buffered. If my docker container is awake (i.e. processing http requests), is it also guaranteed that, if it is listening to the event stream, the event stream will be up-to-date?
I’m thinking these are hard guarantees to make, and perhaps my app should pay the penalty of calling out to docker to confirm the identity of the IP, but I’d rather not.