Link Search Menu Expand Document

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 with 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.

If you however would like to retrieve it programmatically, use the following command:

playground get-kubeconfig

And the napptive-kubeconfig file will be downloaded in the the current path.

Using kubectl to interact with the platform

Once you have retrieved 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