Created
March 4, 2022 08:21
-
-
Save carljavier/c237b4d26a484fa4283436b41cfa8015 to your computer and use it in GitHub Desktop.
Consul External Service Registration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To register service
curl --header "Authorization: Bearer " --request PUT --data @l.json localhost:8500/v1/catalog/register