Check out what's in the latest release of Kabanero Learn More

Managing stacks with the command-line interface (CLI)

The stack management CLI is a command-line interface used by the enterprise, solution, or application architect who defines and manages the Kabanero stacks. Developers use these stacks to create governed applications for their business.

Installing the Kabanero CLI

  1. Download the archive corresponding to the platform you are running on.

    • Latest CLI release

    • Latest CLI release - If you are using Homebrew, you can use the brew install kabanero-io/kabanero/kabanero command to do a brew install of the latest version

    • All CLI releases

  2. Extract the archive. The archive holds the ./kabanero command, which is ready to be used.

    • Test the installation by running the ./kabanero help command and viewing the help output.

  3. Configure the CLI service. To do this, follow the steps outlined in the following documentation:

  4. Optional - Add the path to the kabanero command to your PATH environment variable so that you can use the kabanero command without specifying the path each time.

Monitoring and administration commands

Login

Use the stack management CLI URL to log in. There are two ways you can get this URL:

  1. View the CLI URL in the landing page instance details.

  2. Log in to your cluster and run: oc get routes -n kabanero. The URL is for the kabanero-cli route.

Run the kabanero login command to authenticate.

kabanero login <SM_CLI_URL> -u <GITHUB_USER_ID>
  • <SM_CLI_URL> is your Kabanero CLI URL from above.

  • <GITHUB_USER_ID> is your GitHub user name.

  • <GITHUB_PAT> is your GitHub Personal Access Token.

    • Your PAT must have the read:org - Read org and team membership, read org projects OAuth Scope allowed. You can select this when creating your PAT in GitHub

  • You can also use your GitHub password for the <GITHUB_PAT> argument.

    • Login options**

  • Pass in GitHub user name

    • -u <string>

    • --username <string>

Log in to an instance by using GitHub credentials and store a temporary access token for subsequent command-line calls. The temporary access token is stored in a your-home-directory/.kabanero/config.yaml file. Use your GitHub user ID and either a password or Personal Access Token (PAT) to log in.

Examples:

  • Log in with A GitHub user ID and password

    kabanero login <SM_CLI_URL> -u <GITHUB_USER_ID>
    PASSWORD: <GITHUB_PASSWORD>
  • Log in with previously used url GitHub user ID and PAT

    kabanero login -u <GITHUB_USER_ID>
    PASSWORD: <GITHUB_PAT>

Example result:

Logged in to Kabanero instance: <SM_CLI_URL>

Onboard a developer

Run the kabanero onboard command to onboard a developer.

kabanero onboard <GITHUB_USER_ID>

This command is under development.

Example result:

Go to the pipelines dashboard at <tekton-url> in your browser and manually configure the webhook for gituser: <GITHUB_USER_ID>

List application stacks

Run the kabanero list command to list all the application stacks in a kabanero instance, along with their status.

kabanero list

Example result:

Kabanero Instance Stacks  Version Status
------------------------  ------- ------
java-microprofile         0.2.19  active
java-microprofile         0.2.21  active
java-spring-boot2         0.3.18  active
java-spring-boot2         0.3.21  active
nodejs                    0.2.6   inactive
nodejs                    0.3.1   active
nodejs-express            0.2.8   active
nodejs-loopback           0.1.6   active
nodejs-loopback           0.1.8   active

GitHub Curated Stacks (repo name - url):
  central - <stack_hub_index_1_url>
  central2 - <stack_hub_index_2_url>

GitHub Curated Stacks     Version Repo
---------------------     ------- ----
java-microprofile         0.2.19  central
java-spring-boot2         0.3.18  central
java-spring-boot2         0.3.21  central2
nodejs                    0.3.1   central
nodejs                    0.2.6   central2
nodejs-express            0.2.8   central
nodejs-express            0.2.9   central2
nodejs-loopback           0.1.6   central
nodejs-loopback           0.1.8   central2

If a stack is removed from the curated stack hub on GitHub, its status shows as obsolete. If a stack is obsolete, a SYNC command deletes it.

Example result showing stack with an obsolete status:

Kabanero Instance Stacks  Version Status
------------------------  ------- ------
java-microprofile         0.2.19  active
java-microprofile         0.2.21  active (obsolete)
java-spring-boot2         0.3.18  active
java-spring-boot2         0.3.21  active
nodejs                    0.2.6   inactive
nodejs                    0.3.1   active
nodejs-express            0.2.8   active
nodejs-loopback           0.1.6   active
nodejs-loopback           0.1.8   active


GitHub Curated Stacks (repo name - url):
  central - <stack_hub_index_1_url>
  central2 - <stack_hub_index_2_url>

GitHub Curated Stacks     Version Repo
---------------------     ------- ----
java-microprofile         0.2.19  central
java-spring-boot2         0.3.18  central
java-spring-boot2         0.3.21  central2
nodejs                    0.2.6   central
nodejs                    0.3.1   central2
nodejs-express            0.2.8   central
nodejs-express (new)      0.2.9   central2
nodejs-loopback           0.1.6   central
nodejs-loopback           0.1.8   central2

Synchronize stacks

Running the kabanero sync will ensure that the desired states of stacks are consistent with the current configuration. Sync activates, deletes, and updates versions of the Kabanero stacks to reflect the state of the curated application stack hub. See also [kabanero deactivate]. Modifications to the curated application stack hub index might be slow to replicate in GitHub and therefore might not be reflected immediately in KABANERO LIST or SYNC display output.

kabanero sync

Example results:

kabanero instance stacks are already synchronized with the github curated stacks

Curated stacks and active stacks are now fully synchronized.

Inactive stacks are activated during the sync operation, as shown in the following example:

Kabanero Instance Stacks  Version Status
------------------------  ------- ------
nodejs                    0.2.6   inactive ==> active

This example result shows a stack added from a stack entry in curated stack hub:

Kabanero Instance Stacks  Version Status
------------------------  ------- ------
java-microprofile         0.2.21  added to Kabanero

Running the kabanero sync command when one of the stacks is obsolete deletes the stack.

This example result shows a stack deleted because it is no longer in curated stack hub:

Kabanero Instance Stacks  Version Status
------------------------  ------- ------
java-microprofile         0.2.21  deleted

Show the active repository application stack for an instance

Make sure the instance is installed in the Kabanero namespace. There are two ways to view the active application stacks repository for an instance.

  1. From the OpenShift console, view Administration > Custom Resource Definitions > Kabanero > Instances > Kabanero > YAML

  2. Displaying the configured Kabanero CR with the OC CLI command

    oc get kabanero -n kabanero -o yaml

Show the version number

Run the kabanero version command to display the version of Kabanero that is running.

kabanero version

Example result:

kabanero cli version: 0.6.0
kabanero command line service image: kabanero/kabanero-command-line-services:0.6.0

Deactivate

Run the kabanero deactivate command to prevent a specific version of an application stack from being used in pipeline builds.

kabanero deactivate stack-name version-number

Running the deactivate command removes the specified application stack from the list of available application types, without deleting it from the instance.

To restore a deactivated application stack, run the kabanero sync command. See [Synchronize application stacks].

Example:

kabanero deactivate nodejs 0.3.1

Example result:

Stack name: nodejs version: 0.3.1 deactivated

Running the kabanero list command now shows the deactivated application stack as inactive.

Kabanero Instance Stacks  Version Status
------------------------  ------- ------
java-microprofile         0.2.19  active
java-spring-boot2         0.3.18  active
java-spring-boot2         0.3.21  active
nodejs                    0.2.6   inactive
nodejs                    0.3.1   inactive
nodejs-express            0.2.8   active
nodejs-loopback           0.1.6   active
nodejs-loopback           0.1.8   active

GitHub Curated Stacks (repo name - url):
  central - <stack_hub_index_1_url>
  central2 - <stack_hub_index_2_url>

GitHub Curated Stacks     Version Repo
---------------------     ------- ----
java-microprofile         0.2.19  central
java-spring-boot2         0.3.18  central
java-spring-boot2         0.3.21  central2
nodejs                    0.3.1   central
nodejs                    0.2.6   central2
nodejs-express            0.2.8   central
nodejs-express            0.2.9   central2
nodejs-loopback           0.1.6   central
nodejs-loopback           0.1.8   central2

Log out

Run the kabanero logout command to disconnect from the instance.

kabanero logout

Example result:

Logged out of kab instance: <SM_CLI_URL>

Global Options

These options can be enabled on any command.

  • Help for a command. For example, kabanero refresh -h

    • -h

    • --help

  • Turn on debug output and logging to a file in $HOME/.kabanero/logs

    • -v

    • --verbose

Edit This Page