Closed arunvelsriram closed 5 years ago
Same issue here 👍
It is possible for Consul to exec into a docker container and then run a command. It is also possible to get the container ID from the Kubernetes Pod Status
. This could be an alternative approach instead of skipping. Consul might need some extra previlege to run shell command into a container ID.
I am using
register_mode: pod
for registering the pods to consul agent running on the same node. The pod spec has a liveness probe command:In this case, the liveness probe cannot be converted to consul health check.
kube-consul-register
is failing to register the pods because onlyhttpGet
andtcpSocket
are handled here: controller/pods/controller.go#L492.This forces users to modify the
livenessProbe
to eitherhttpGet
ortcpSocket
. Most of the community helm charts usescommand
aslivenessProbe
. Instead of failing to register the pods to consul we can register them without consul health check. This allows users to use the community helm charts without patching them.Am happy to implement this fix in
kube-consul-register
. Let me know if you are okay with the idea.