<p>I have a configuration file as part of the Kubernetes ConfigMap data section. Whenever there is a change in the content of the configuration file(ConfigMap data:), there should be some trigger/listener resulting in some invocation. (As part of this invocation, I need to have some code implemented which restarts some service objects).</p>
<p>Is there some Kubernetes configuration available that can be used to configure this listener for ConfigMap?.</p>
<p>ConfigMap sample :</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Release.Name }}-glare-configurations
data:
  glare.conf.template: |
    use_stderr = false
    bind_port = 9494
    default_api_limit = {{ .Values.configruations.default_api_limit | default 150 }}
</code></pre>

srinivas
<p>There is no built-in support in Kubernetes for this feature at the time of writing this answer afaik.</p>
<p>Update:</p>
<p>You can use one of the <a href="https://kubernetes.io/docs/reference/using-api/client-libraries/" rel="nofollow noreferrer">supported client libraries</a> and write a custom listener.</p>
<p>Here is an <a href="https://github.com/kubernetes-client/python/blob/master/examples/pod_namespace_watch.py" rel="nofollow noreferrer">example</a> of how to watch for pods using the python client library.</p>
<hr />
<p>The below section is useful to provide rolling updates to the objects like <code>Deployments</code> in case of changes in the resources that they reference like <code>ConfigMap</code>/<code>Secret</code>.</p>
<p>There is a <a href="https://github.com/kubernetes/kubernetes/issues/22368" rel="nofollow noreferrer">feature request</a> in the works for the requirement.</p>
<p>You can have a look at <a href="https://github.com/stakater/Reloader" rel="nofollow noreferrer"><code>Reloader</code></a> which is a custom plugin used exactly for this requirement.</p>
