Kubernetes Client

1 minute read
On this page

1. Goal

Ensure the Kubernetes client is properly configured on the machine running the cbsupport CLI.

2. Tests

2.1. kubectl can run

Verify that the kubectl binary can be called from the machine running the cbsupport CLI.

In case this test fails, you will need to make sure kubectl is properly set up. You should be able to run kubectl version --short and observe an output similar to:

Client Version: v1.21.1 Server Version: v1.20.6-gke.1000

(note: the actual versions can be different).

If you wrap kubectl with a shell script, do not forget to make it executable and to declare a shebang like #!/bin/sh to ensure that the system can detect the type of script used.

To troubleshoot such issue, executes file $(which kubectl).

This one should return something like this:

kubectl is a bash script
/path/to/kubectl: Bourne-Again shell script text executable, ASCII text

It shouldn’t return:

kubectl is a text file
/path/to/kubectl: ASCII text

2.2. kubectl returns a version

Verify that kubectl version --client --output=yaml returns a value.

In case this test fails, please review the output of kubectl version --client --output=yaml to determine what is wrong.