Warning
This page was translated from the original Japanese version by PLaMo Translate. The Japanese version is authoritative; the English translation may contain inaccuracies.
Connecting to a Cluster
This page explains how to connect to a Kubernetes cluster.
Installing the Command Line Tool for Cluster Operations
You will connect to your Kubernetes cluster using the kubectl command-line tool.
For kubectl tool installation, please refer to the official documentation.
Configuring Kubernetes Cluster Connection Credentials
- Navigate to the kubectl setup page in the portal.
- From the Cluster Name dropdown menu, select the cluster you wish to use.
- Click Retrieve Credentials, copy the generated command, and execute it in your terminal.
Note
Connecting to Clusters from Multiple Environments
If you are connecting to clusters from multiple environments, repeat the Retrieve Credentials process for each environment to generate and use separate commands.
If you reuse the same credentials across multiple environments, the credentials will be invalidated, resulting in failure when attempting to operate the cluster with the following error:
failed to refresh token: oauth2: "invalid_grant" "Unknown or invalid refresh token."If your credentials have been invalidated, you must re-retrieve and reconfigure them.
Tip
Updating Expired Credentials
Using the kubelogin tool (
kubectl oidc-login) allows you to update credentials that have expired without needing to reaccess the portal.For kubelogin installation instructions, please refer to the tool’s official documentation. Note that kubelogin is a third-party tool, and its use is at your own discretion.
Connection Verification
Run kubectl auth whoami to verify that your Username displays your email address and that the Groups section shows your organization’s group name.
$ kubectl auth whoami
ATTRIBUTE VALUE
Username oidc:<your-organization-name>/<your-email-address>
Groups [oidc:<your-organization-name> system:authenticated]