Advanced Configuration

Customize installation directory

By default, Krew installs itself and plugins to $HOME/.krew. This means Krew itself and the installed plugins will be visible only to the user who installed it.

To customize this installation path, set the KREW_ROOT environment variable while installing Krew. After Krew is installed, you still need to set KREW_ROOT in your environment for Krew to be able to find its installation directory.

For example, add this to your ~/.bashrc or ~/.zshrc file:

export KREW_ROOT="/usr/local/krew"

Note that you still need to add $KREW_ROOT/bin to your PATH variable for kubectl to be able to find installed plugins.

Use a different default index

When Krew is installed, it automatically initializes an index named default pointing to the krew-index repository. You can force Krew to use a different repository by setting KREW_DEFAULT_INDEX_URI before running the installation instructions or after removing the default index. KREW_DEFAULT_INDEX_URI must point to a git repository URI that uses a valid git remote protocol.

To use a different default index, set the KREW_DEFAULT_INDEX_URI environment variable in your ~/.bashrc, ~/.bash_profile, or ~/.zshrc:

export KREW_DEFAULT_INDEX_URI='git@github.com:foo/custom-index.git'

Configure network proxy

If you want to use Krew with an HTTP proxy, you can configure environment variables HTTP_PROXY, HTTPS_PROXY and NO_PROXY. Behavior of these environment variables are explained here.

export HTTP_PROXY="proxy-ip:port"
export HTTPS_PROXY="proxy-ip:port"
export NO_PROXY="ip1,ip2:port2,.example.com"
← User Guide