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-
ibmcloud ks cluster get
- Drops support for positional arguments in favor of using flags, from
ibmcloud ks cluster get
ibmcloud ks cluster get --cluster mycluster
- Switches from
- Drops support for comma-delimited values in favor of repeated flags that have shorthand aliases, from
ibmcloud ks logging config create --app-containers
create -c cont1 -c cont2 -c cont3
ibmcloud ks cluster configcommand now appends the kubeconfig file to your existing kubeconfig in
~/.kube/config(or the first file in the
KUBECONFIGenvironment variable). After running the command, you can interact with your cluster immediately.
kubectl config use-context CTX_NAMEto switch between clusters
- If you installed
kubectlwith 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
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:
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.
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:
We also created a special command to help upgrade your automated scripts that use our CLI.
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.
For more information, including a list of changes between each version of the CLI plug-in, see the IBM Cloud Kubernetes Service documentation.