Liqo CLI tool

Introduction

Liqoctl is the CLI tool to streamline the installation and management of Liqo. Specifically, it abstracts the creation and modification of Liqo defined custom resources, allowing to:

  • Install/uninstall Liqo, wrapping the corresponding Helm commands and automatically retrieving the appropriate parameters based on the target cluster configuration.

  • Establish and revoke peering relationships towards remote clusters.

  • Enable and configure workload offloading on a per-namespace basis.

  • Retrieve the status of Liqo, as well as of given peering relationships and offloading setups.

Note

liqoctl displays a kubectl compatible behavior concerning Kubernetes API access, hence supporting the KUBECONFIG environment variable, as well as the standard flags, including --kubeconfig and --context.

Warning

The following instructions will guide you through the installation of the latest stable version of liqoctl, which might exhibit a different behavior compared to the one shown in the rest of this documentation. If you want to use the latest liqoctl version, build it from source.

Install liqoctl with Homebrew

If you are using the Homebrew package manager, you can install liqoctl with Homebrew:

brew install liqoctl

When installed with Homebrew, autocompletion scripts are automatically configured and should work out of the box.

Install liqoctl manually

You can download and install liqoctl manually, following the appropriate instructions based on your operating system and architecture.

Download liqoctl and move it to a file location in your system PATH:

AMD64:

curl --fail -LS "https://github.com/liqotech/liqo/releases/latest/download/liqoctl-linux-amd64.tar.gz" | tar -xz
sudo install -o root -g root -m 0755 liqoctl /usr/local/bin/liqoctl

ARM64:

curl --fail -LS "https://github.com/liqotech/liqo/releases/latest/download/liqoctl-linux-arm64.tar.gz" | tar -xz
sudo install -o root -g root -m 0755 liqoctl /usr/local/bin/liqoctl

Note

Make sure /usr/local/bin is in your PATH environment variable.

Download liqoctl, make it executable, and move it to a file location in your system PATH:

Intel:

curl --fail -LS "https://github.com/liqotech/liqo/releases/latest/download/liqoctl-darwin-amd64.tar.gz" | tar -xz
chmod +x liqoctl
sudo mv liqoctl /usr/local/bin/liqoctl

Apple Silicon:

curl --fail -LS "https://github.com/liqotech/liqo/releases/latest/download/liqoctl-darwin-arm64.tar.gz" | tar -xz
chmod +x liqoctl
sudo mv liqoctl /usr/local/bin/liqoctl

Note

Make sure /usr/local/bin is in your PATH environment variable.

Download the liqoctl binary:

curl --fail -LSO "https://github.com/liqotech/liqo/releases/latest/download/liqoctl-windows-amd64"

And move it to a file location in your system PATH.

Alternatively, you can manually download liqoctl from the Liqo releases page on GitHub.

Install Kubectl plugin with Krew

You can install liqoctl as a kubectl plugin by using the Krew plugin manager:

kubectl krew install liqo

Then, all commands shall be invoked with kubectl liqo rather than liqoctl, although all functionalities remain the same.

Warning

While the kubectl plugin is supported, it is recommended to use liqoctl as this enables a better experience via tab auto-completion. Install it with Homebrew if available on your system or by manually downloading the binary from GitHub.

Install liqoctl from source

You can install liqoctl building it from source. To do so, clone the Liqo repository, build the liqoctl binary, and move it to a file location in your system PATH:

git clone https://github.com/liqotech/liqo.git
cd liqo
make ctl
mv liqoctl /usr/local/bin/liqoctl

Enable shell autocompletion

liqoctl provides autocompletion support for Bash, Zsh, Fish, and PowerShell.

The liqoctl completion script for Bash can be generated with the liqoctl completion bash command. Sourcing the completion script in your shell enables liqoctl autocompletion.

However, the completion script depends on bash-completion, which means that you have to install this software first. You can test if you have bash-completion already installed by running type _init_completion. If it returns an error, you can install it via your OS’s package manager.

To load completions in your current shell session:

source <(liqoctl completion bash)

To load completions for every new session, execute once:

source <(liqoctl completion bash) >> ~/.bashrc

After reloading your shell, liqoctl autocompletion should be working.

The liqoctl completion script for Zsh can be generated with the liqoctl completion zsh command.

If shell completion is not already enabled in your environment, you will need to enable it. You can execute the following once:

echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions for each session, execute once:

liqoctl completion zsh > "${fpath[1]}/_liqoctl"

After reloading your shell, liqoctl autocompletion should be working.

The liqoctl completion script for Fish can be generated with the liqoctl completion fish command.

To load completions in your current shell session:

liqoctl completion fish | source

To load completions for every new session, execute once:

liqoctl completion fish > ~/.config/fish/completions/liqoctl.fish

After reloading your shell, liqoctl autocompletion should be working.

The liqoctl completion script for PowerShell can be generated with the liqoctl completion powershell command.

To load completions in your current shell session:

liqoctl completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command to your PowerShell profile.

After reloading your shell, liqoctl autocompletion should be working.