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:

    1. 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.
    2. Create a new compute instance to host the self-managed node:
      1. Open the navigation menu and click Compute. Under Compute, click Instances.
      2. 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.
      3. In the Image and Shape section, click Change image.
      4. 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.
      5. Click Show advanced options, and on the Management tab, select the Paste cloud-init script option.
      6. 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.
      7. 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 .

    3. 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
    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:

  • Run the LaunchInstance operation to create a self-managed node.