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?
When I create a configMap like this:
data:
liveness-endpoint: /actuator/health/liveness
liveness-initialDelaySeconds: 60
liveness-periodSeconds: 5
and try to reference it in probe like this:
livenessProbe:
httpGet:
path: liveness-endpoint
port: http-api
initialDelaySeconds: liveness-initialDelaySeconds
periodSeconds: liveness-periodSeconds
kubernetes complain, that configMap must have only Strings, so I'm changing it to
liveness-initialDelaySeconds: "60"
and then it complains that probe must use Integer, not String.
As you see, I can reference port for probe, so probably there is a way to define those int values, but how?