Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
Skip to Content
CLICommands

orl kubernetes update-kubeconfig

Add the cluster to a kubeconfig and switch kubectl to it, part of the orl CLI for OpenRelay GPU VMs, pods, batches and billing.

orl kubernetes update-kubeconfig --cluster <cluster>

Add the cluster to a kubeconfig and make it kubectl's current context, as aws eks update-kubeconfig does. The file is --kubeconfig; else the first file in KUBECONFIG that already holds this cluster; else the first file KUBECONFIG names; else ~/.kube/config. A missing file and its directory are created, readable only by you.

The cluster, a user and a context are added beside the file's other entries, which are kept as they are. The cluster is named openrelay-<cluster-name>-<cluster-id>, the user that name and the role, and the context after the user unless --alias names it. An entry of one of those names, in the file or in a KUBECONFIG file kubectl reads before it, is never replaced or shadowed: when it differs, nothing is written and the command exits 6. --alias and --user-alias add the context and user under other names; a different cluster entry has to be deleted first (kubectl config delete-cluster). Run again with the same arguments, it changes only the current context.

The current context is set where kubectl reads it: in a KUBECONFIG file before this one when that file names the current context, else in this file.

The kubeconfig holds no credential: its user runs orl kubernetes token, so kubectl gets a new cluster token whenever the last one expires, and orl must be on the PATH where kubectl runs. Its tokens carry view unless --role asks for cluster-admin, which kubectl needs to change the cluster or list its nodes.

The kubeconfig authenticates with the key orl auth login stored for this organization, whatever key the shell running kubectl exports. When your key comes from OPENRELAY_API_KEY instead, the kubeconfig reads that variable where kubectl runs. A key given with --api-key is refused, since no later kubectl run could read it.

Flags

FlagTypeRequired
--aliasstringnoname the context this instead of the user's name
--clusterstringyescluster id (orl kubernetes cluster list prints them)
--dry-runboolnoprint the kubeconfig that would be written, and write nothing
--kubeconfigstringnothe kubeconfig file to add the cluster to (default: KUBECONFIG, else ~/.kube/config)
--roleview, cluster-adminnocredential role: view (the default) or cluster-admin
--user-aliasstringnoname the user this instead of openrelay-<cluster-name>-<cluster-id>-<role>
--verboseboolnoalso print the cluster, user and context entries

This wraps the getKubernetesKubeconfig API operation.

On this page