I'm using Consul version 1.2.1 and trying to implement health check that runs the command:
# echo ruok | nc localhost 2181
imok
Therefore, I defined the health check in this json file, however, I'm unable to locate any documentation that shows how to handle pipe in the command. Hashi Corp Consul documentation on defining health check is here.
This is what I have tried, but is not correct.
{
"service": {
"name": "testapp",
"port": 2181,
"check": [
{
"args": ["echo ruok | nc localhost 2181"],
"interval": "15s",
"timeout": "2s"
}
]
}
}