Provisioning an RKE2 Cluster in DigitalOcean via Rancher
On this page
This guide demonstrates how to add DigitalOcean cloud credentials in Rancher and use them to provision an RKE2 cluster in DigitalOcean (DO).
Overview
DigitalOcean RKE2 Cluster in Rancher
Rancher simplifies the provisioning of downstream RKE2 clusters in DigitalOcean by integrating with the DigitalOcean API. By adding your DigitalOcean API token to Rancher, you can create a fully managed RKE2 cluster customized to your requirements.
Adding DigitalOcean Cloud Credentials
Prerequisites
- A DigitalOcean account with an active API token.
- Rancher installed and accessible.
Steps to Add DigitalOcean Cloud Credentials
Log in to Rancher: Access your Rancher installation via its hostname (e.g.,
https://rancher.your-domain.com).Navigate to Cloud Credentials:
- Open ☰ > Cluster Management.
- Click Cloud Credentials.
Add DigitalOcean Credentials:
- Click Create.
- Choose DigitalOcean as the cloud credential type.
- Enter the required details:
- API Token: Your DigitalOcean API token.
- Click Create.
Provisioning the RKE2 Cluster
Steps to Provision an RKE2 Cluster in DigitalOcean
Navigate to Cluster Management:
- Open ☰ > Cluster Management.
- Click Create on the Clusters page.
Select RKE2 and DigitalOcean:
- Set the toggle to RKE2/K3s.
- Click DigitalOcean.
Configure Cluster Details:
- Enter a cluster name (e.g.,
rke2-do-cluster). - Select your previously added DigitalOcean cloud credentials.
- Enter a cluster name (e.g.,
Machine Pool Configuration: Create two machine pools, following Rancher’s recommended cluster architecture:
Pool Roles Count Example Droplet size cpetcd, Control Plane 3 s-4vcpu-8gbworkersWorker 2 or more sized for your workloads - Use 3 etcd nodes, not 2. With 2 etcd members a single failure loses quorum; 3 members tolerate one failure.
- Rancher recommends at least two worker nodes and not combining the worker role with etcd or controlplane.
s-4vcpu-8gbmatches the 4 CPU and 8 GB recommendation in the RKE2 requirements. Droplets use SSD storage, which etcd needs.- Pick an image for an OS that the RKE2 v1.36 support matrix certifies, such as Ubuntu 24.04 or 22.04.
- Configure additional options as needed (SSH user, tags, monitoring).
Cluster and Network Configuration:
- Choose a Kubernetes version that your Rancher release supports. New RKE2 v1.36 clusters use Traefik as the default ingress controller, because the Kubernetes Ingress NGINX project was retired in March 2026 (see Ingress on RKE2).
- Place the Droplets in a VPC so node traffic stays on the private network, and use a Cloud Firewall that allows the RKE2 ports between nodes and 443 outbound to Rancher.
Review and Launch:
- Review the configuration summary.
- Click Create to start provisioning the cluster.
Testing and Validation
Accessing the Cluster
Verify the cluster status in Rancher:
- Navigate to Cluster Management and check the cluster state.
- The status should show as Active once the provisioning is complete.
Download the kubeconfig file:
- Open the cluster from the Rancher home page.
- Use Download KubeConfig in the cluster view, or open the built-in kubectl Shell.
Access the cluster via kubectl:
bashkubectl --kubeconfig=/path/to/kubeconfig get nodes
Testing Workloads
Deploy a test application to ensure the cluster is functional:
apiVersion: v1
kind: Pod
metadata:
name: nginx-test
namespace: default
spec:
containers:
- name: nginx
image: nginx:stable
ports:
- containerPort: 80kubectl apply -f nginx-test.yaml
kubectl get pods