trigger event when a pod is created or deleted in kubernetes to write or delete its IP in some database

6/11/2019

We have a system of two application A & B deployed over kubernetes cluster. What we need is to set an event/trigger in kubernetes. So each time a pod of application B is created, it will trigger an action to add its IP to configmap. Also when any pod of application B is deleted, it will trigger an action to remove its IP from the configmap.

Is there any built in object in kubernetes to perform such function, or do we need a 3rd party plugin?

-- Hanna
docker
events
kubernetes
kubernetes-pod
triggers

1 Answer

6/11/2019

Basically you have two options:

The later is at the container level, but should work for your use case as well.

-- Thomas
Source: StackOverflow