Basic usage
Basic usage of the CLI includes learning how to log into your account, retrieve the kubeconfig associated with the current environment, and opening the web ui.
- Login into the Playground
- Login without launching a browser
- Obtaining the kubeconfig
- Environment information
- Opening the dashboard
- Log out from the Playground
Login into the Playground
To log into the playground from the CLI use:
playground login
Logged as <username> on <account>/default environment using <provider> credentials.
The CLI will store your credentials provider in the local ${HOME}/.napptive/.playground.yaml. In case you change the provider, or there was an error in the initial configuration, use the following command to reset your credential provider configuration.
playground login --showLoginOptions
Login without launching a browser
Some scenarios do not allow the CLI to launch the default browser to complete the authentication process. Examples of those are when the CLI is being through Docker, or when the CLI is being executed in a remote system through SSH. For this scenarios, we offer an alternative approach to the use of Personal Access Tokens that only requires being able to copy an URL from the terminal, and the ability to open a browser.
The headless login functionality will create a URL that needs to be pasted on the browser, and the browser once authenticated in the Playground will generate a code that needs to be copied in the CLI. Using that information, the CLI will finish the login process. To use it, execute the following commands
playground login --headless
And follow the instructions opening the URL that will appear on the CLI.
Obtaining the kubeconfig
The kubeconfig file is automatically managed by the CLI and it is stored at ~/.napptive/default/napptive-kubeconfig
. However, if you are interested in retrieving a copy to use it from another path, execute:
playground get-kubeconfig
ASSOCIATED SERVER
https://<server_IP>
Use this kubeconfig to connect to the cluster and deploy applications:
kubectl --kubeconfig <napptive-kubeconfig> ...
Environment information
To retrieve information about the current environment in use, execute:
playground env info
Server version: v1.21.12-gke.2200 OAM: v0.3.1
CREATION_TIME CREATED_BY
<timestamp> <username>
ACCOUNT ENV CPU RAM STORAGE
<account_name> <env_name> 0/2 0/2000 0/1000
DESCRIPTION
<environment description>
Open Dashboard
To open the Playground dashboard execute:
playground dashboard
and the dashboard home screen will open in your default browser
Log out from the playground
To log out from the playground, use:
playground logout
Thanks for using the playground, we hope to see you soon!
This command will invalidate the session, to be able to operate again, you must log in to the platform again.