sudo snap install kubectl --classic
</syntaxhighlight>
At this point you might need to reboot or at least relog to add snap to your path, if it was not already installed previously. Try out the installation with
<syntaxhighlight lang="bash">
> kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.2", GitCommit:"66049e3b21efe110454d67df4fa62b08ea79a19b", GitTreeState:"clean", BuildDate:"2019-05-16T16:23:09Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
</syntaxhighlight>
TODO: The version of kubernetes running on the cluster is 14.1., it might be necessary that they match. Test this sometimes.
You have now installed kubectl. This is a command line tool which lets you talk to Kubernetes clusters (such as our CCU compute cluster). The last error message means that kubectl did not detect a running kubernetes cluster on your local host, which probably does not come as a surprise. We will now connect to the CCU cluster.
== Connecting to the CCU cluster ==
Now that you have kubectl running, attach it to our CCU compute cluster by executing the following steps:
* Generate a new directory ".kube" in your home directory to host Kubernetes configuration files.
* Download the following linked file called "config" and place it in the ".kube" directory.
* Modify the file: replace <your.username> with your CCU username.
If you looked at the file a bit, you have now set up a context called "ccu" to run kubectl commands, which contains information about where to find the cluster. Switch to the context with
<syntaxhighlight lang="bash">
> kubectl config use-context ccu
</syntaxhighlight>
You have not set up any user credentials yet. If you try any kubectl command such as
<syntaxhighlight lang="bash">
> kubectl cluster-info dump
</syntaxhighlight>
you will get asked for username and password. Note that your CCU account does not work here, the process to get credentials is unfortunately a bit more involved and covered in the next step of the tutorial. However, this shows that kubectl is now attached successfully to the cluster.