Deckhouse CLI is a command line interface for cluster management created by the developers of Deckhouse Kubernetes Platform (DKP). Starting with version 1.59, the D8 CLI is automatically installed on all cluster nodes. You can also install the CLI on any machine and use it to operate clusters that are not managed by DKP.

On the command line, the utility can be invoked using the d8 alias. All the commands are grouped by their function:

The d8 d and d8 mirror command groups are not available for Community Edition (CE) and Basic Edition (BE).

  • d8 k — the kubectl command family.
    For example, d8 k get pods is the same as kubectl get pods.
  • d8 dk — the range of delivery-related commands (see the werf tool).
    For example, you can run d8 d plan --repo registry.deckhouse.io instead of werf plan --repo registry.deckhouse.io.

  • d8 mirror — the range of commands that allow you to copy DKP distribution images to a private container registry (previously the dhctl mirror tool was used for this purpose). For example, you can run d8 mirror pull -l <LICENSE> <TAR-BUNDLE-PATH> instead of dhctl mirror --license <LICENSE> --images-bundle-path <TAR-BUNDLE-PATH>.

    Usage scenarios:

  • d8 v — the set of commands for managing virtual machines created by Deckhouse Virtualization Platform.
    For example, the d8 virtualization console command execs you into the VM console.

    More virtualization commands...
    • d8 v console execs you into the VM console.
    • d8 v port-forward forwards local ports to the virtual machine.
    • d8 v scp uses the SCP client to work with files on the virtual machine.
    • d8 v ssh connects you to the virtual machine over SSH.
    • d8 v vnc connects you to the virtual machine over VNC.

How do I install the Deckhouse CLI?

There are two ways to install the Deckhouse CLI:

  • Starting with version 0.10, you can install using trdl. This method allows you to get fresh versions of the tool with all improvements and fixes.

    Note that trdl installation requires Internet access to the tuf repository containing the tool. This method will not work in an air-gapped environment!

  • You can manually download the executable file and install it on the system.

trdl-based installation

Starting with the Deckhouse CLI version 0.10, you can install it using trdl.

Versions earlier than 0.10 must be uninstalled before proceeding.

If you need to install one of the versions below 0.10, use the outdated installation method.

  1. Install trdl client.

  2. Add the Deckhouse CLI repository to trdl:

    URL=https://deckhouse.ru/downloads/deckhouse-cli-trdl
    ROOT_VERSION=1
    ROOT_SHA512=343bd5f0d8811254e5f0b6fe292372a7b7eda08d276ff255229200f84e58a8151ab2729df3515cb11372dc3899c70df172a4e54c8a596a73d67ae790466a0491
    REPO=d8
    
    trdl add $REPO $URL $ROOT_VERSION $ROOT_SHA512
    
  3. Install the latest stable release of the d8 utility and check if it works as expected:

    . $(trdl use d8 0 stable) && d8 --version
    

To avoid having to run . $(trdl use d8 0 stable) before every Deckhouse CLI invocation, add the following line to your shell’s RC file: alias d8='trdl exec d8 0 stable -- "$@"'.

Congratulations, you have installed the Deckhouse CLI.

Installing the executable

Linux x86-64 macOS x86-64 macOS ARM64 Windows

  1. Download the archive for Linux x86-64 in a convenient way:

    • From your cluster:

      1. Turn on the module deckhouse-tools;
      2. Open the web interface with download links. The web interface address is generated according to the publicDomainTemplate template of the Deckhouse global configuration parameter (the %s key is replaced with tools).

        For example, if publicDomainTemplate is set as %s-kube.company.my, the web interface will be available at tools-kube.company.my;

      3. Click on the button to download Deckhouse CLI for Linux.
    • From the Deckhouse website:

      curl -LO https://deckhouse.io/downloads/deckhouse-cli/v0.11.3/d8-v0.11.3-linux-amd64.tar.gz
      
  2. Extract the archive:

    tar -xvf "d8-v0.11.3-linux-amd64.tar.gz" "linux-amd64/bin/d8"
    
  3. Move the file d8 to the directory listed in the PATH system environment variable (for example, /usr/local/bin/):

    sudo mv "linux-amd64/bin/d8" /usr/local/bin/
    

    PATH is a system environment variable containing a list of directories with executable files. This is where the OS will look for the binary when a command is run in the terminal. You can view this list with the echo $PATH command.

  4. Check that the CLI is working:

    d8 help
    

Congrats, you have successfully installed Deckhouse CLI.

  1. Download the archive for macOS x86-64 in a convenient way:

    • From your cluster:

      1. Turn on the module deckhouse-tools;
      2. Open the web interface with download links. The web interface address is generated according to the publicDomainTemplate template of the Deckhouse global configuration parameter (the %s key is replaced with tools).

        For example, if publicDomainTemplate is set as %s-kube.company.my, the web interface will be available at tools-kube.company.my;

      3. Click on the button to download Deckhouse CLI for macOS.
    • From the Deckhouse website:

      curl -LO https://deckhouse.io/downloads/deckhouse-cli/v0.11.3/d8-v0.11.3-darwin-amd64.tar.gz
      
  2. Extract the archive:

    tar -xvf "d8-v0.11.3-darwin-amd64.tar.gz" "darwin-amd64/bin/d8"
    
  3. Move the file d8 to the directory listed in the PATH system environment variable (for example, /usr/local/bin/):

    sudo mv "darwin-amd64/bin/d8" /usr/local/bin/
    

    PATH is a system environment variable containing a list of directories with executable files. This is where the OS will look for the binary when a command is run in the terminal. You can view this list with the echo $PATH command.

  4. Check that the CLI is working:

    d8 help
    

Congrats, you have successfully installed Deckhouse CLI.

  1. Download the archive for macOS ARM64 in a convenient way:

    • From your cluster:

      1. Turn on the module deckhouse-tools;
      2. Open the web interface with download links. The web interface address is generated according to the publicDomainTemplate template of the Deckhouse global configuration parameter (the %s key is replaced with tools).

        For example, if publicDomainTemplate is set as %s-kube.company.my, the web interface will be available at tools-kube.company.my;

      3. Click on the button to download Deckhouse CLI for macOS.
    • From the Deckhouse website:

      curl -LO https://deckhouse.io/downloads/deckhouse-cli/v0.11.3/d8-v0.11.3-darwin-arm64.tar.gz
      
  2. Extract the archive:

    tar -xvf "d8-v0.11.3-darwin-arm64.tar.gz" "darwin-arm64/bin/d8"
    
  3. Move the file d8 to the directory listed in the PATH system environment variable (for example, /usr/local/bin/):

    sudo mv "darwin-arm64/bin/d8" /usr/local/bin/
    

    PATH is a system environment variable containing a list of directories with executable files. This is where the OS will look for the binary when a command is run in the terminal. You can view this list with the echo $PATH command.

  4. Check that the CLI is working:

    d8 help
    

Congrats, you have successfully installed Deckhouse CLI.

  1. Download the archive for Windows x86-64 in a convenient way.

    • From your cluster:

      1. Turn on the module deckhouse-tools;
      2. Open the web interface with download links. The web interface address is generated according to the publicDomainTemplate template of the Deckhouse global configuration parameter (the %s key is replaced with tools).

        For example, if publicDomainTemplate is set as %s-kube.company.my, the web interface will be available at tools-kube.company.my;

      3. Click on the button to download Deckhouse CLI for Windows.
    • From the Deckhouse website, download the archive from this link: Windows x86-64.

  2. Extract the archive, move the file d8.exe to the directory of your choice, and add the directory to the ‘PATH’ environment variable of the operating system.
  3. Unlock the file d8.exe, for example, in the following way:
    • Right-click on the file and select Properties from the context menu.
    • In the Properties window, make sure you are on the General tab.
    • At the bottom of the General tab, you may see a section that says Security with a message like This file came from another computer and might be blocked to help protect this computer. If this message is displayed, there will be an Unblock button or checkbox next to it.
    • Check the Unblock checkbox or click the Unblock button, then click Apply and OK to save the changes.
  4. Check that the CLI is working:

    d8 help
    
  5. Enable auto-completion in PowerShell by running the following command:

    d8 completion powershell >> $PROFILE
    

Congrats, you have successfully installed Deckhouse CLI.