Kyma CLI

Overview

Kyma CLI is a command-line tool that supports Kyma developers. It provides a set of commands and flags you can use to:

  • Provision a cluster locally or on cloud providers, such as GCP or Azure, or use Gardener to set up and manage your clusters.
  • Install, manage, and test Kyma.

Details

Use Kyma CLI

Kyma CLI comes with a set of commands, each of which has its own specific set of flags. Use them to provision the cluster locally or using a chosen cloud provider, install, and test Kyma.

For the commands and flags to work, they need to follow this syntax:

Click to copy
kyma {COMMAND} {FLAGS}
  • {COMMAND} specifies the operation you want to perform, such as provisioning the cluster or installing Kyma.
  • {FLAGS} specifies optional flags you can use to enrich your command.

See the example:

Click to copy
kyma install -s latest

See the full list of commands and flags.

CommandChild commandsDescriptionExample
completionNoneGenerates and displays the bash or zsh completion script.kyma completion
consoleNoneLaunches Kyma Console in a browser window.kyma console
installNoneInstalls Kyma on a cluster based on the current or specified release.kyma install
provisionminikube gardener gke aksProvisions a new cluster on a platform of your choice. Currently, this command supports cluster provisioning on GCP, Azure, Gardener, and Minikube.kyma provision minikube
testdefinitions delete list run status logs Runs and manages tests on a provisioned Kyma cluster. Using child commands, you can run tests, view test definitions, list and delete test suites, display test status, and fetch the logs of the tests.kyma test run
versionNoneShows the cluster version and the Kyma CLI version.kyma version

Kyma CLI command usage examples

The following examples show how to provision a cluster, install Kyma, and run the tests.

Provision a cluster locally or using cloud providers

To provision a cluster on a specific cloud provider (in this example GCP), run:

Click to copy
kyma provision gke -c {SERVICE_ACCOUNT_KEY_FILE_PATH} -n {CLUSTER_NAME} -p {GCP_PROJECT}

To provision a Minikube cluster, run:

Click to copy
kyma provision minikube

Install Kyma

To install Kyma using your own domain, run:

Click to copy
kyma install --domain {DOMAIN} --tlsCert {TLS_CERT} --tlsKey {TLS_KEY}

To install Kyma from the latest master branch, run:

Click to copy
kyma install -s latest

To install Kyma using your own Kyma installer image, run:

Click to copy
kyma install -s {IMAGE}

To build an image from your local sources and install Kyma based on this image, run:

Click to copy
kyma install -s local --custom-image {IMAGE}

Test Kyma

To check which test definitions are deployed on the cluster, run:

Click to copy
kyma test definitions

To run all the tests, run:

Click to copy
kyma test run

To check the test results, run:

Click to copy
kyma test status

Installation

Install Kyma CLI

You can easily install Kyma CLI on macOS, Linux, or Windows. To do so, perform the instructions described in the following sections.

macOS

To install Kyma CLI on macOS, run:

Click to copy
curl -Lo kyma.tar.gz "https://github.com/kyma-project/cli/releases/download/$(curl -s https://api.github.com/repos/kyma-project/cli/releases/latest | grep tag_name | cut -d '"' -f 4)/kyma_Darwin_x86_64.tar.gz" \
&& mkdir kyma-release && tar -C kyma-release -zxvf kyma.tar.gz && chmod +x kyma-release/kyma && sudo mv kyma-release/kyma /usr/local/bin \
&& rm -rf kyma-release kyma.tar.gz

Homebrew

To install Kyma CLI using Homebrew, run:

Click to copy
brew install kyma-cli

If the Homebrew team does not update the Homebrew formula of the CLI within three days of the release, follow this guide to update it manually to the most recent version. For a sample Homebrew Kyma CLI formula version bump, see this PR.

Linux

To install Kyma CLI on Linux, run:

Click to copy
curl -Lo kyma.tar.gz "https://github.com/kyma-project/cli/releases/download/$(curl -s https://api.github.com/repos/kyma-project/cli/releases/latest | grep tag_name | cut -d '"' -f 4)/kyma_Linux_x86_64.tar.gz" \
&& mkdir kyma-release && tar -C kyma-release -zxvf kyma.tar.gz && chmod +x kyma-release/kyma && sudo mv kyma-release/kyma /usr/local/bin \
&& rm -rf kyma-release kyma.tar.gz

Windows

To install Kyma CLI on Windows, download and unzip the release artifact. Remember to adjust your PATH environment variable.

Click to copy
{KYMA_VERSION}=1.2.0
Invoke-WebRequest -OutFile kyma.zip https://github.com/kyma-project/cli/releases/download/${KYMA_VERSION}/kyma_Windows_x86_64.zip
Expand-Archive -Path kyma.zip -DestinationPath .\kyma-cli
cd kyma-cli

Chocolatey (Windows)

To install Kyma CLI on Windows using Chocolatey, run:

Click to copy
choco install kyma-cli

You don't have to bump Kyma CLI Chocolatey package manually with each new release, as it includes a script that automatically checks for new releases and updates the package to the latest one.

Still, the package requires some maintenance to keep its dedicated site atchocolatey.org up to date. This means you should regularly update the description, details, screenshots, etc. To keep the site up to date, submit a pull request to Chocolatey's GitHub repository.

Other

To install a different release version, change the path to point to the desired version and architecture:

Click to copy
curl -Lo kyma.tar.gz https://github.com/kyma-project/cli/releases/download/${KYMA_VERSION}/kyma_${ARCH}.tar.gz

Tutorials

Use Kyma CLI as kubectl plugin

This short tutorial shows how to extend kubectl to support Kyma CLI and its commands.

To use Kyma CLI as the kubectl plugin, perform the following steps:

NOTE: To use Kyma CLI as a kubectl plugin, use Kubernetes version 1.12.0 or higher.

  1. Rename the kyma binary to kubectl-kyma and place it anywhere in your {PATH}:

    Click to copy
    sudo mv ./kyma /usr/local/bin/kubectl-kyma
  2. Run kubectl plugin list command to see your plugin on the list of all available plugins.

  3. Invoke your plugin as a kubectl command:

    Click to copy
    kubectl kyma version
    Kyma CLI version: v0.6.1
    Kyma cluster version: 1.0.0