Orient Me install fails when running install.sh via sudo
Chad Scott 110000E1UB Visits (5902)
When attempting to install Orient Me using a non-root account and sudo, you may see the following error:
./setup.sh: line 50: kubectl: command not found
In this case, you have verified you have correctly created the persistent volumes and persistent volume claims per the documentation. So what is going on?
The issue here is that sudo is often configured out of the box to use a defined path that does not include /usr/local/bin, which is where kubectl is installed. For example, my RHEL 7.4 system has the following in /etc/sudoers:
Defaults secure_path = /sbi
When I run install.sh with this configuration, the path is limited to those directories, and so kubectl will not be found, as we see in the first error message.
You can work around this by passing in the current user's path when running sudo, like this:
sudo env PATH="$PATH" ./install.sh
Because my current user's path includes /usr/local/bin, kubectl is found and the installation is able to proceed.