diff options
author | Austin S. Hemmelgarn <austin@netdata.cloud> | 2021-03-08 08:12:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-08 08:12:22 -0500 |
commit | 0a47bbdd6f44bf56e309c96d718467ef931a0b4f (patch) | |
tree | 74d04e60f24f79aa4684546d71e0832119f93407 /packaging/docker/run.sh | |
parent | 790af9620f400471d274339db4ec7dd7a9f18982 (diff) |
Added support for claiming nodes as part of installation. (#10084)
* Added support for claiming nodes as part of installation.
This adds four new options to the `netdata-installer.sh` script:
* `--claim-token`
* `--claim-rooms`
* `--claim-uri`
* `--claim-proxy`
These directly correspond to the `-token`, `-rooms`, `-uri`, and `-proxy`
options for the `netdata-claim.sh` script. They have the following
associated logic:
* If any are specified and the `--disable-cloud` option is also
specified, we bail and tell the user to either enable the cloud or
remove the claiming options.
* If only some but not all of the token, rooms, and uri options are
specified, we bail and tell the user that they must pass all three.
* If all three of the token, rooms, and uri are specified, we invoke the
`netdata-claim.sh` script for the install itself as one of the last
steps in the installation process, using the values passed to these
options.
This allows users to directly claim the agent as part of the install,
which is useful for automated installation scenarios.
* Add missing space as suggested by @knatsakis
* Properly handle installs in /.
* Properly handle unprefixed installs.
* Fix another spelling error in an option name.
* Properly fix option naming.
* Move claiming into kickstart script instead of netdata-installer.
This makes us more future-proof.
The required changes also fix some buggy behavior in the option parsing
code in the kickstart scripts.
* Fix checksums.
* Sanely handle the daemon not running during the claiming process.
* Silence incorrect shellcheck warning.
* Simplify condition as suggested by @vkalintiris.
* Clean up old changes that should not be here anymore.
These are leftovers from an earlier revision, they are not actually
needed.
* Add ID generation logic to the claiming script.
This lets it reliably claim nodes which have not yet had the daemon run.
Also fixes a consistency issue in the claiming logic in the Docker
entrypoint.
Diffstat (limited to 'packaging/docker/run.sh')
-rwxr-xr-x | packaging/docker/run.sh | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/packaging/docker/run.sh b/packaging/docker/run.sh index 432d199075..d8bda83907 100755 --- a/packaging/docker/run.sh +++ b/packaging/docker/run.sh @@ -25,6 +25,7 @@ if [ -n "${NETDATA_CLAIM_URL}" ] && [ -n "${NETDATA_CLAIM_TOKEN}" ] && [ ! -f /v -url "${NETDATA_CLAIM_URL}" \ ${NETDATA_CLAIM_ROOMS:+-rooms "${NETDATA_CLAIM_ROOMS}"} \ ${NETDATA_CLAIM_PROXY:+-proxy "${NETDATA_CLAIM_PROXY}"} + -daemon-not-running fi exec /usr/sbin/netdata -u "${DOCKER_USR}" -D -s /host -p "${NETDATA_LISTENER_PORT}" -W set web "web files group" root -W set web "web files owner" root "$@" |