kickstart.sh random install to either /etc/netdata or /opt/netdata/etc/netdata

With that exact set of options, you actually should be getting a fatal error about the use of --install-prefix without --build-only (we are only able to support custom install prefixes when building locally).

If you just want things under /opt, you can achieve that by forcing use of a static build using the --static-onlyoption (without the --install-prefix option), or by adding --build-only to the list of options you’re passing the kickstart script.

If you just want things under /, you can enforce that by either:

  • Ensuring the systems in question have a working internet connection and can reliably access https://packagecloud.io (note though that this will change to https://repos.netdata.cloud at some point within the next few months), and then using the --native-only option without any --install-prefix option. This will use native DEB packages, allowing you to manage updates with APT.

or:

  • Using --build-only to build locally, without using any --install-prefix option.

As far as why you’re seeing this inconsistent behavior, my guess is that you’ve got issues with your internet connection that are preventing reliable access to https://packagecloud.io. If that access happens to work, you end up with a native package (which installs under /), if it fails at any of about half a dozen points during the install the installer will instead fall back to a static build (which installs under /opt/netdata).