-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from ehh-why-its-so-hard/health-check
feat: add health-check to all nodes
- Loading branch information
Showing
5 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
- name: Download health-check binary | ||
ansible.builtin.get_url: | ||
force: true | ||
url: "https://github.com/{{- vega_core_health_check_repository -}}/releases/download/{{- vega_core_health_check_version -}}/vega-health-check-linux-amd64" | ||
dest: /usr/local/bin/vega-health-check | ||
mode: '0755' | ||
|
||
- name: Install health-check systemd | ||
ansible.builtin.template: | ||
src: "lib/systemd/system/vega-health-check.service.j2" | ||
dest: "/lib/systemd/system/vega-health-check.service" | ||
owner: "root" | ||
group: "root" | ||
mode: "0644" | ||
notify: "Restart vega-health-check" |
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
23 changes: 23 additions & 0 deletions
23
roles/vega_core/templates/lib/systemd/system/vega-health-check.service.j2
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[Unit] | ||
Description=healthcheck | ||
Documentation=https://github.com/vegaprotocol/ansible | ||
After=network.target network-online.target | ||
Requires=network-online.target | ||
|
||
[Service] | ||
User=vega | ||
Group=vega | ||
{% if vega_core_with_block_explorer | default(false) %} | ||
ExecStart=/usr/local/bin/vega-health-check blockexplorer --blockexplorer-api-url "http://localhost:1515" --core-url "http://localhost:3003" --http-port 8080 | ||
{% elif vega_core_with_data_node | default(false) %} | ||
ExecStart=/usr/local/bin/vega-health-check data-node --api-url "http://localhost:3008" --core-url "http://localhost:3003" --http-port 8080 | ||
{% else %} | ||
ExecStart=/usr/local/bin/vega-health-check vega --core-url "http://localhost:3003" --http-port 8080 | ||
{% endif %} | ||
TimeoutStopSec=10s | ||
ProtectSystem=full | ||
AmbientCapabilities=CAP_NET_BIND_SERVICE | ||
CPUQuota=10% | ||
|
||
[Install] | ||
WantedBy=multi-user.target |