Skip to main content

Cluster Login

Prerequisites​

There are two different methods for logging into your Kubernetes cluster, depending on your use-case:

  1. Login with your Cockpit account for use on your personal machine
  2. Login with a service account for automation purposes

The instructions differ slightly for these two methods.

Cockpit Account Login​

First you will need to login to your Cockpit account with the CLI. The auth login command will automatically open your browser where you can login interactively.

$ nctl auth login
βœ“ added nineapis.ch to kubeconfig πŸ“
βœ“ logged into cluster nineapis.ch πŸš€

Now you can authenticate with any cluster within your organization using the auth cluster command:

$ nctl auth cluster <cluster-name>
βœ“ added <cluster-name>/<org> to kubeconfig πŸ“

Alternatively you can also download the kubeconfig from Cockpit when viewing your Kubernetes cluster and use that directly instead of letting nctl create the config.

Now you are ready to use kubectl as usual. nctl will take care keeping you logged in at all times.

Service Account Login​

Using a service account does not require any additional tooling.

  • Create a new Account in Cockpit using the Access Management tab
  • Create a Cluster Role Binding and attach it to your previously created Account
  • Go to the Account and download the kubeconfig

Now you can use the kubeconfig as you would any other. In case you want to selectively add permissions to this service account, you can do so using normal rbac. This service account will map to a service account in your clusters default namespace with the full name system:serviceaccount:default:<service account name>.