We only sync the readiness status of the pod to Consul as described in these docs. This is also consistent with how Kubernetes shows status of your pod if your run kubectl get pods . When a liveness probe is failing, it’ll still show that your container status is running and that the containers are ready. You should also configure a readiness probe for your use case which will signal to both the Kubernetes cluster and the Consul service mesh when your application can receive traffic. This is consistent with how Kubernetes will route traffic to pods as well if you were just to deploy your applications without the mesh. Please see these docs on the purpose of each probe.
At the moment, we don’t allow you to specify custom checks for your service on the service mesh. We haven’t seen a use case when you’d need to do that. You can’t provide it via config-dir because the controller that auto-registers services on the service mesh will overwrite that.
If you need that as a feature, then could you create an issue in the hashicorp/consul-k8s repo and describe your use case?
Oh…! If I want to registry my services and periodic check them
either using auto-inject sidecar with TTL health checks or registering services by hcl/json file that has customized checks
{
“service”: {
“name”: “xxx”,
“port”: ooo,
“check”: {
“http”: “http://localhost:ooo/health”,
“method”: “GET”,
“interval”: “1s”,
“timeout”: “1s”
},
“connect”: {
“sidecar_service”: {}
}
}
}