Using Playground with kubectl.

The kubectl tool is the standard CLI to interact with Kubernetes environments. The NAPPTIVE Playground offers compatibility by default with the standard Kubernetes API and thus is compatible with kubectl without any changes.

Locating your kubeconfig

The kubeconfig file contains all the information required to interact with the standard Kubernetes API. By default, after you log on the playground with the CLI with:

playground login

The kubeconfig will be already available on ~/.napptive/default/napptive-kubeconfig. If you are using custom installations with the playground CLI, your kubeconfig may be located at ~/.napptive/<installation_name>/napptive-kubeconfig.

Each time you interact with the platform to change the active account, or the target environment, the underlying kubeconfig will be modified accordingly. It is not recommended to create a snapshot of the kubeconfig file as it may not work properly.

Using kubectl to interact with the platform

Once you have located the kubeconfig file using any of the aforementioned options, you are ready to execute any kubectl command such as:

kubectl --kubeconfig ~/.napptive/default/napptive-kubeconfig get pods

Notice that the kubeconfig is ONLY valid for the current selected environment. To change the selected environment use:

playground env use <account_name>/<environment_name>

which will automatically update the default kubeconfig file.

What’s next