Creating Self-Managed Nodes
Find out how to create a new self-managed node and add it to an existing cluster.
You use the Compute service to create the compute instance on which to run a self-managed node. Having created the self-managed node, you then add it to an existing enhanced cluster.
You can create self-managed nodes using the Console, the CLI, and the API.
To create a self-managed node using the Console:
- Create the cloud-init script containing the Kubernetes API private endpoint and base64-encoded CA certificate of the enhanced cluster to which you want to add the self- managed node. See Creating Cloud-init Scripts for Self-managed Nodes.
- Create a new compute instance to host the self-managed node:
- Open the navigation menu and click Compute. Under Compute, click Instances.
- Follow the instructions in the Compute service documentation to create a new compute instance. Note that appropriate policies must exist to allow the new compute instance to join the enhanced cluster. See Creating a Dynamic Group and a Policy for Self-Managed Nodes.
- In the Image and Shape section, click Change image.
- Click My images, select the Image OCID option, and then enter the OCID of the OKE Oracle Linux 7 (OL7) or Oracle Linux 8 (OL8) image you want to use. See Image Requirements.
- Click Show advanced options, and on the Management tab, select the Paste cloud-init script option.
- Copy and paste the cloud-init script containing the Kubernetes API private endpoint and base64-encoded CA certificate into the Cloud-init script field. See Creating Cloud-init Scripts for Self-managed Nodes.
- Click Create to create the compute instance to host the self-managed node.
When the compute instance is created, it is added as a self-managed node to the cluster with the Kubernetes API endpoint that you specified .
- Verify that the self-managed node has been added to the Kubernetes cluster and confirm the node's readiness status by entering:
kubectl get nodes
For example:
kubectl get nodes NAME STATUS ROLES AGE VERSION 10.0.103.170 Ready <none> 40m v1.25.4
- Confirm that labels have been added to the node and set as expected by entering:
kubectl get node <node-name> -o json | jq '.metadata.labels'
For example
kubectl get node 10.0.103.170 -o json | jq '.metadata.labels' { ... "displayName": "oke-self-managed-node", "oci.oraclecloud.com/node.info.byon": "true", ... }
Use the oci Compute instance launch command and required parameters to create a self-managed node:
oci compute instance launch --availability-domain <availability-domain> --compartment-id <compartment-ocid> --shape <shape> --subnet-id <subnet-ocid>[OPTIONS]
For a complete list of flags and variable options for CLI commands, see the Command Line Reference.
Tips:
- Specify the name of the file containing the cloud-init script (required to add the compute instance to the cluster as a self-managed node) using the oci Compute instance launch command's
--user-data-file
parameter. See Creating Cloud-init Scripts for Self-managed Nodes. - Specify the image to use to create the self-managed node by setting the oci Compute instance launch command's
--image-id
parameter. See Image Requirements.
- Specify the name of the file containing the cloud-init script (required to add the compute instance to the cluster as a self-managed node) using the oci Compute instance launch command's
Run the LaunchInstance operation to create a self-managed node.