Install the Kubernetes Command Line Tool
Download and install kubectl - the Kubernetes command line tool that allows access to SAP BTP, Kyma runtime.
Overview
You will learn
- How to download kubectl - the Kubernetes command line tool
- How to install the plugin kubectl oidc-login and use it to connect to a SAP BTP, Kyma runtime instance
- How to use a few basic kubectl commands
Prerequisites
Prerequisites
- Tutorials: Enable SAP BTP, Kyma Runtime
Steps
Intro
SAP BTP, Kyma runtime provides a managed Kubernetes cluster in which you can install the Kyma modules. To manage resources and configurations from the command line, you can use the kubectl tool. This tutorial provides the steps necessary to configure the tool to access SAP BTP, Kyma runtime. In subsequent tutorials, you will learn various commands provided by kubectl.
Download the latest kubectl version from the Kubernetes website. Use the following URL:
On the Kubernetes website, follow the instructions listed for your operating system, for example: Install kubectl on macOS.
The use of the kubectl command line tool requires an authenticated user to perform any tasks on SAP BTP, Kyma runtime. SAP BTP, Kyma runtime is configured to use OpenID Connect (OIDC) authentication and requires the installation of the plugin kubectl oidc-login to perform the authentication.
To install kubectl oidc-login, follow the instructions detailed in the project repository. Use the relevant commands for macOS, Linux, or Windows users.
The kubectl oidc-login runs on port
8000. In case of issues, make sure the port is not occupied.
Open a command prompt on your computer.
On Windows, you can search for the
cmdorcommand promptapplications in the Start menu.On macOS, use Spotlight to find the
Terminalapplication.On Linux/Unix, you know how this works - just open your favorite command shell.
To verify that kubectl is installed correctly, run the following command in your CLI:
Shell/Bashkubectl version --clientThe command should return a list of version properties, for example:
Shell/BashClient Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2",GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"clean",BuildDate:"2021-09-15T21:31:32Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"darwin/amd64"}
The kubectl tool relies on a configuration file called kubeconfig to configure access to the cluster. Follow the instructions to learn how to obtain it from both SAP BTP cockpit and Kyma dashboard.
To obtain kubeconfig from SAP BTP cockpit:
Within your SAP BTP account, navigate to the sub-account with SAP BTP, Kyma runtime enabled.
In the Overview section, scroll down to the Kyma Environment details.
Choose the link next to KubeconfigURL to download the kubeconfig file.

BTP kubeconfig
To obtain kubeconfig from Kyma dashboard:
Select Dashboard URL under the Kyma Environment section.
Select the dropdown at the top of the Kyma dashboard window, and choose Clusters Overview.

Clusters Overview Choose the download icon to download the file.

Dashboard kubeconfig
For more information on kubectl, visit the Kubernetes command line tool overview and kubectl commands websites.
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.