Skip to content

Instantly share code, notes, and snippets.

@carljavier
Created March 4, 2022 08:21
Show Gist options
  • Save carljavier/c237b4d26a484fa4283436b41cfa8015 to your computer and use it in GitHub Desktop.
Save carljavier/c237b4d26a484fa4283436b41cfa8015 to your computer and use it in GitHub Desktop.
Consul External Service Registration
{
"Node": "chucknorris",
"Address": "api.chucknorris.io",
"NodeMeta": {
"external-node": "true",
"external-probe": "true"
},
"Service": {
"ID": "chucknorris",
"Service": "chucknorris-api",
"Port": 80
},
"Checks": [
{
"Name": "http-check",
"status": "passing",
"Definition": {
"http": "https://api.chucknorris.io",
"interval": "30s"
}
}
]
}
{
"Node": "hashicorp",
"Address": "learn.hashicorp.com",
"NodeMeta": {
"external-node": "true",
"external-probe": "true"
},
"Service": {
"ID": "learn1",
"Service": "learn",
"Port": 80
},
"Checks": [
{
"Name": "http-check",
"status": "passing",
"Definition": {
"http": "https://learn.hashicorp.com/consul/",
"interval": "30s"
}
}
]
}
@carljavier
Copy link
Author

carljavier commented Mar 4, 2022

To register service

curl --header "Authorization: Bearer " --request PUT --data @l.json localhost:8500/v1/catalog/register

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment