ocne cluster join
Joins a node to a cluster, or generates the Ignition files required to do so.
This command can be used for:
-
Preprovisioned compute resources created with the
byo
provider. Nodes are migrated from one cluster to another cluster. -
Self provisioned compute created with the
byo
provider. Generates the materials needed to join a node to a cluster on first boot.
Nodes are migrated as worker nodes, unless you specify the
--role-control-plane
node option of the ocne cluster
join
command.
Set the location of the source cluster using the --kubeconfig
command option. This option is required for this command.
ocne cluster join
[{-c|--config} path]
[{-d|--destination} path]
[{-N|--node} name]
[{-P|--provider} provider]
[{-r|--role-control-plane}]
Where:
-
{-c|--config} path
-
The path to a configuration file that contains the definition of the cluster. If this value isn't provided, a small (ephemeral) cluster might be created, using the default hypervisor, for the system where the command is run.
-
{-d|--destination} path
-
The path to the
kubeconfig
file for the destination cluster. -
{-N|--node} name
-
The name of the node to move from the source cluster to the destination cluster, as seen from within Kubernetes. The name must be one of the nodes listed in the output of a
kubectl get nodes
command. -
{-P|--provider} provider
-
The provider to use when interacting with the cluster. Options are:
-
libvirt
(the default) -
oci
-
byo
-
none
-
-
{-r|--role-control-plane}
-
Sets the role of the node to be a control plane node in the target cluster. If this option isn't used, the node is set as a worker node.
Example 4-48 Migrate a node to another BYO cluster
To migrate a node from one cluster to another BYO cluster:
ocne cluster join --kubeconfig $HOME/.kube/kubeconfig.mycluster --provider byo --node source-worker-1 --destination $HOME/.kube/kubeconfig.targetcluster
Example 4-49 Migrate a node to another BYO cluster as a control plane node
To migrate a node from one cluster to another BYO cluster, and assign it as a control plane node:
ocne cluster join --kubeconfig $HOME/.kube/kubeconfig.mycluster --provider byo --node source-worker-1 --destination $HOME/.kube/kubeconfig.targetcluster --role-control-plane
Example 4-50 Migrate a node to another BYO cluster using a configuration file
To migrate a node from one cluster to another BYO cluster, using a configuration file:
ocne cluster join --kubeconfig $HOME/.kube/kubeconfig.mycluster --config byo.yaml --node source-worker-1 --destination $HOME/.kube/kubeconfig.targetcluster
Example 4-51 Generate Ignition file for a worker node in a BYO cluster
To generate the Ignition information required to add a worker node to a BYO cluster:
ocne cluster join --kubeconfig $HOME/.kube/kubeconfig.mycluster --config byo.yaml > worker.ign
Example 4-52 Generate Ignition file for a control plane node in a BYO cluster
To generate the Ignition information required to add a control plane node to a BYO cluster:
ocne cluster join --kubeconfig $HOME/.kube/kubeconfig.mycluster --config byo.yaml --role-control-plane > control_plane.ign