Boost Your Productivity with a New CLI Experience for the IBM Cloud Kubernetes Service

4 min read

Big changes are coming to the IBM Cloud Kubernetes Service CLI plugin to change your experience for the better.

Today, we're announcing big enhancements in the user experience with the CLI plugin for IBM Cloud Kubernetes Service. Changes to the kubernetes-service will be rolled out in two phases—a backward-compatible release (0.4) today and an upcoming major release (1.0). Version 1.0 will be released on March 16th, 2020.

Version 1.0 contains breaking changes from previous releases, so we've included extra tools in 0.4 to make the transition smoother.

These new releases are the result of a backend overhaul and months of user testing to bring our UX up to speed. For more on the engineering challenges and our user experience journey, see this blog post.

New features and compatibility

These releases of the Kubernetes Service plugin enable you to more easily do the following:

  • Discover new commands
  • Integrate with community tools
  • Intuitively understand commands, flags, and arguments based on names and usage text

User testing has shown that this release is a significant step forward for our user experience, and we'd love to share it with you. In fact, we're so excited to deliver a better experience that we're releasing most of these UX improvements today as a backward-compatible release (0.4).

The 1.0 release will contain breaking changes from previous releases:

  • Replaces flat commands with structured commands, from ibmcloud ks cluster-get to ibmcloud ks cluster get
  • Drops support for positional arguments in favor of using flags, from ibmcloud ks cluster get mycluster to ibmcloud ks cluster get --cluster mycluster
  • Switches from --camelCase flags to --dash-name flags
  • Drops support for comma-delimited values in favor of repeated flags that have shorthand aliases, from ibmcloud ks logging config create --app-containers cont1,cont2,cont3 to create -c cont1 -c cont2 -c cont3
  • The ibmcloud ks cluster config command now appends the kubeconfig file to your existing kubeconfig in ~/.kube/config (or the first file in the KUBECONFIG environment variable). After running the command, you can interact with your cluster immediately.
    • Run kubectl config use-context CTX_NAME to switch between clusters
    • If you installed kubectl with auto-completion, then you can tab-complete the context names too

For a full list of changes, see the CLI changelog.

Upgrade the IBM Cloud Kubernetes Service plugin

To get started, all you need to do is upgrade the Kubernetes Service plugin to the latest version with this command: ibmcloud plugin update kubernetes-service

If you update to 0.4, you'll still get lots of awesome improvements without breaking backward compatibility. If you want to try out 1.0 or need to test your scripts with the new CLI behavior, you can opt-in to 1.0 in its full glory. Just set the IKS_BETA_VERSION environment variable to 1. In bash, this looks like export IKS_BETA_VERSION=1.

Structured commands

The biggest change is the new command structure and help output. Instead of a long list of all possible commands, only a small subset is shown. As soon as you decide on a command, you can drill one step further into the subcommands.

For example, I want to update a worker but I don't know which command that is. I'll start by getting help output for the plugin: ibmcloud ks

➜ ~ ibmcloud ks
NAME:
        ibmcloud ks - Manage IBM Cloud Kubernetes Service clusters.
USAGE:
        ibmcloud ks command [arguments...] [command options]

COMMANDS:

Cluster Management Commands:
    cluster       View and modify cluster and cluster service settings.
    worker        View and modify worker nodes for a cluster.
    worker-pool   View and modify worker pools for a cluster.
    zone          View and modify the zones attached to a worker pool.

...

The new structured help output breaks down the commands into categories and only one layer at a time, so my next step is to run ibmcloud ks worker followed by ibmcloud ks worker update. At each step, run an additional subcommand to narrow down the choices to the intended command.

Since more commands are uncovered with each step, you can intuit the desired command without being completely overwhelmed with choices.

Upgrade tools

We've included some additional tools to help ease the transition to 1.0.

The first thing you may notice is warnings are printed when you run deprecated commands:

➜ ~ ibmcloud ks cluster-config
WARNING: This legacy command is deprecated and will soon be unsupported. Use the 'ibmcloud ks cluster config' command instead.

We also created a special command to help upgrade your automated scripts that use our CLI.

Run ibmcloud ks script update ./your_script_here.sh ./another.sh to show a diff of which things should change in the given script files. If you agree with the changes, run it again with the --in-place flag to save those changes.

We recommend you set IKS_BETA_VERSION=1 and run your scripts to verify they work as expected.

Wait, I'm not ready! How do I go back?

If you need time to update your automated scripts that use the Kubernetes Service plugin and the ibmcloud ks script update command is insufficient for your needs, you can always install an older version of the plugin: ibmcloud plugin install kubernetes-service -v 0.4.

Note: New features will not be back-ported to old releases of the CLI. You will need to update automation scripts as soon as possible to gain access to new feature releases.

More details

For more information, including a list of changes between each version of the CLI plug-in, see the IBM Cloud Kubernetes Service documentation.

Contact us

If you have questions, engage our team via Slack by registering here and join the discussion in the #general channel on our public IBM Cloud Kubernetes Service Slack.

Be the first to hear about news, product updates, and innovation from IBM Cloud