kubeconfig
Command Reference
In order for a cluster to be used with K10 Multi-Cluster Manager, it must first be bootstrapped. The bootstrapping process can be performed on a single cluster at a time using the Bootstrap Command command. Alternatively, multiple clusters can be added through the K10 Multi-Cluster Manager interface by uploading a portable kubeconfig.
Using the k10multicluster
tool to prepare a portable kubeconfig that can
be used to bootstrap multiple clusters is outlined below.
prepare
Command
The prepare
command uses local Kubernetes credentials to setup a temporary
service account and cluster role binding that can be used for bootstrapping.
This service account is used to prepare a portable kubeconfig that can be
uploaded or pasted into the K10 Multi-Cluster Manager.
The service account created through this process is created in the default
namespace and is labeled with k10.kasten.io/purpose=bootstrapping
to
allow it to be easily identified. The corresponding cluster role bindings are
also labeled this way.
prepare
Parameters
Parameter |
Required |
Description |
Default |
---|---|---|---|
|
no |
Name of a context that should be prepared. May be specified multiple times or as a comma-separated list of contexts. |
current context |
|
no |
Path to a kubeconfig file. |
|
The --context
flag may be provided multiple times or as a comma-separated
list to prepare a kubeconfig for multiple clusters.
Examples
Given that the local system already had two contexts: cluster-1
and
cluster-2
, the following command could be used to prepare a kubeconfig:
$ k10multicluster kubeconfig prepare --context cluster-1 --context cluster-2 | pbcopy
Preparing context cluster-1…
Preparing context cluster-2…
The pbcopy
command is used to copy the resulting kubeconfig into the
system clipboard on macOS, other platforms may need to substitute this
command. This kubeconfig file can then be pasted into the K10 Multi-Cluster
Manager to allow some or all of these clusters to be bootstrapped.