Connecting to Hosted Control Planes

For some operations, you may want to have full command line access to your hosted control plane. Under the hood, hosted control planes are powered by a hosted UXP instance managed by Upbound, so we can connect to it with kubectl like we would any remote Kubernetes cluster.

This guide will help you connect to your hosted control planes that reside in Upbound Cloud. For self-hosted control planes, you will have already established a kubectl connection in order to install UXP and connect it to Upbound Cloud.

Generate a Token

The first thing you'll need to connect to your hosted control plane is an API Token. To generate one, click on the Organization switcher and select "My Account". From there, navigate to "API Tokens" and click on "Create New Token". We're going to name our new token test-token.

Make sure to copy the token string and store it somewhere safe like a password manager. This is the last time Upbound Cloud will display it to you.

Create an API Token

Connect to Control Plane

Now you're ready to connect to your hosted control plane. If you're not familiar with connecting to a remote cluster, Upbound Cloud gives you the commands you need to connect to your control plane, you will only need to paste in your API token that we just created.

Just navigate to your control plane, then click "Connect Using CLI" in the bottom left, which will bring up a dialog with the commands you can copy/paste into your terminal.

Connect Instructions

It's easiest to just copy/paste the commands from that UI dialog (remembering to also fill in your API token), but the general commands are included below so that we can explain the purpose of each one.

Set a cluster entry in your kubeconfig that points to the API server of your hosted control plane:

kubectl config set-cluster [NAME] --server=[URL_TO_CONTROL_PLANE]

Set a user entry in your kubeconfig that includes your user name and API token to access the control plane:

kubectl config set-credentials [USER] --token=[ACCESS_TOKEN]

Create a context in the kubeconfig that associates your user entry and your cluster entry:

kubectl config set-context [NAME] --cluster=[NAME] --user=[USER]

Switch the current context of your kubeconfig to your hosted control plane, so kubectl now points to it by default:

kubectl config use-context [NAME]

You should now be able to execute kubectl commands against your hosted control plane, for example to view all installed CRDs:

kubectl get crd