Custom Nodes

Use Rancher to create a Kubernetes cluster on your on-premise bare metal servers. This option creates a cluster using a combination of Docker Machine and RKE, which is Rancher’s own lightweight Kubernetes installer. In addition to bare metal servers, RKE can also create clusters on any infrastructure provider by integrating with node drivers.

To use this option you’ll need access to servers you intend to use as your Kubernetes cluster. Provision each server according to Rancher requirements, which includes some hardware specifications and Docker. After you install Docker on each server, run the command provided in the Rancher UI to turn each server into a Kubernetes node.

Objectives for Creating Cluster with Custom Nodes

Want to use Windows hosts as Kubernetes workers?

See Configuring Custom Clusters for Windows before you start.

1. Provision a Linux Host

Begin creation of a custom cluster by provisioning a Linux host. Your host can be:

  • A cloud-host virtual machine (VM)
  • An on-premise VM
  • A bare-metal server

Notes:

  • While creating your cluster, you must assign Kubernetes roles to your cluster nodes. If you plan on dedicating bare-metal servers to each role, you must provision a bare-metal server for each role (i.e. provision multiple bare-metal servers).
  • If you want to reuse a node from a previous custom cluster, clean the node before using it in a cluster again. If you reuse a node that hasn’t been cleaned, cluster provisioning may fail.

Provision the host according to the requirements below.

Requirements

Each node in your cluster must meet our Requirements.

2. Create the Custom Cluster

Use Rancher to clone your Linux host and configure them as Kubernetes nodes.

  1. From the Clusters page, click Add Cluster.

  2. Choose Custom.

  3. Enter a Cluster Name.

  4. Use Member Roles to configure user authorization for the cluster.

    • Click Add Member to add users that can access the cluster.
    • Use the Role drop-down to set permissions for each user.

  5. Use Cluster Options to choose the version of Kubernetes, what network provider will be used, if you want to enable Pod Security Policies and whether the nodes added to this cluster need to have a supported Docker version installed.

    Using Windows nodes as Kubernetes workers?

  6. Click Next.

  7. From Node Role, choose the roles that you want filled by a cluster node.

    Notes:

    • Using Windows nodes as Kubernetes workers? See Node Configuration.
    • Bare-Metal Server Reminder: If you plan on dedicating bare-metal servers to each role, you must provision a bare-metal server for each role (i.e. provision multiple bare-metal servers).
  8. Optional: Click Show advanced options to specify IP address(es) to use when registering the node, override the hostname of the node or to add labels to the node.

    Rancher Agent Options
    Kubernetes Documentation: Labels

  9. Copy the command displayed on screen to your clipboard.

  10. Log in to your Linux host using your preferred shell, such as PuTTy or a remote Terminal connection. Run the command copied to your clipboard.

    Note: Repeat steps 7-10 if you want to dedicate specific hosts to specific node roles. Repeat the steps as many times as needed.

  11. When you finish running the command(s) on your Linux host(s), click Done.

Result:

  • Your cluster is created and assigned a state of Provisioning. Rancher is standing up your cluster.
  • You can access your cluster after its state is updated to Active.
  • Active clusters are assigned a Project and Namespace, both of which are named Default.

3. Amazon Only: Tag Resources

If you have configured your cluster to use Amazon as Cloud Provider, tag your AWS resources with a cluster ID.

Amazon Documentation: Tagging Your Amazon EC2 Resources

Note: You can use Amazon EC2 instances without configuring a cloud provider in Kubernetes. You only have to configure the cloud provider if you want to use specific Kubernetes cloud provider functionality. For more information, see Kubernetes Cloud Providers

The following resources need to tagged with a ClusterID:

  • Nodes: All hosts added in Rancher.
  • Subnet: The subnet used for your cluster
  • Security Group: The security group used for your cluster.

    Note: Do not tag multiple security groups. Tagging multiple groups generates an error when creating Elastic Load Balancer.

The tag that should be used is:

Key=kubernetes.io/cluster/<CLUSTERID>, Value=owned

<CLUSTERID> can be any string you choose. However, the same string must be used on every resource you tag. Setting the tag value to owned informs the cluster that all resources tagged with the <CLUSTERID> are owned and managed by this cluster.

If you share resources between clusters, you can change the tag to:

Key=kubernetes.io/cluster/CLUSTERID, Value=shared