<p>I have multiple services and their probes are configured in the same way. I would like to extract common values like initialDelaySeconds, periodSeconds etc for livenessProbe into configMap. Is it possible?</p>
<p>When I create a configMap like this:</p>
<pre><code>data:
  liveness-endpoint: /actuator/health/liveness
  liveness-initialDelaySeconds: 60
  liveness-periodSeconds: 5
</code></pre>
<p>and try to reference it in probe like this:</p>
<pre><code>  livenessProbe:
    httpGet:
      path: liveness-endpoint
      port: http-api
    initialDelaySeconds: liveness-initialDelaySeconds
    periodSeconds: liveness-periodSeconds
</code></pre>
<p>kubernetes complain, that configMap must have only Strings, so I'm changing it to</p>
<pre><code>  liveness-initialDelaySeconds: &quot;60&quot;
</code></pre>
<p>and then it complains that probe must use Integer, not String.</p>
<p>As you see, I can reference port for probe, so probably there is a way to define those int values, but how?</p>

Marx
<p>Kubernetes doesn't allow configMap usage in yaml files. Basically it needs to know before configMap even loads, you can only use configMaps as volumes and environment variables.</p>
<p>Also ports can be string because you can name the ports in pod, svc definitions and then reference that in liveness, readiness probes. But periodSeconds is just plain old integer value only.</p>
