The Oxide Rancher node driver is used to provision Oxide instances that Rancher uses to launch and manage Kubernetes clusters.
This guide describes how to use the Oxide Rancher node driver to deploy a Kubernetes cluster on Oxide.
Requirements
To follow this guide you’ll need the following.
- An Oxide project. We’ll create the Rancher instance and the Kubernetes cluster within this project using the project’s - defaultVPC.
- Oxide API credentials. Refer to Authentication for instructions on generating and using API credentials. 
- An Oxide image within the Oxide project using a Rancher RKE2 supported operating system. We’ll use this image to run Rancher and the Kubernetes nodes. 
Install Rancher
We’ll run a development installation of Rancher on a single Oxide instance using Docker for the purpose of this guide. If you have access to a production installation of Rancher you can use that instead.
- Create an Oxide instance to run Rancher. Any operating system that’s supported by Rancher will work, but we’ll use Ubuntu 24.04 LTS in this guide. Allocate 4 vCPUs, 16 GiB of memory, and a 20 GiB disk to this instance. 
- Update the instance’s VPC firewall rules to allow inbound connections to ports 80/TCP and 443/TCP. We’ll connect to Rancher using the instance’s IP address using these ports. 
- Install Docker on the instance and run a single-node Rancher server. Modify the - CATTLE_BOOTSTRAP_PASSWORDas desired.- docker run \
 --detach \
 --restart=unless-stopped \
 --env CATTLE_BOOTSTRAP_PASSWORD=oxide \
 --publish 80:80 \
 --publish 443:443 \
 --privileged \
 docker.io/rancher/rancher:latest
- Open a browser and connect to Rancher using the instance’s IP address. Log in with username - adminand the password from- CATTLE_BOOTSTRAP_PASSWORD.
Configure Kubernetes Access
Here’s how you can configure kubectl access to a Rancher-managed Kubernetes
cluster. Rancher itself runs within a Rancher-managed Kubernetes cluster
named local, which is the cluster we’ll connect to in order to interact with
Rancher.
- Open Rancher in your browser and click the desired Kubernetes cluster in the sidebar. Alternatively, access the cluster directly at the URL - https://${RANCHER_HOST}/dashboard/c/${CLUSTER_NAME}/explorer.
- In the top navigation bar, click Download KubeConfig download the kubeconfig file for the desired Kubernetes cluster. 
- Configure - kubectlto use the downloaded kubeconfig file.
- Verify - kubectlaccess to the desired Kubernetes cluster.- kubectl get node
Install the Oxide Rancher Node Driver
- Create the following - oxide-nodedriver.yamlKubernetes manifest. Update the- urland- checksumto use the latest stable Oxide Rancher node driver, which can be found on GitHub releases.- # NodeDriver defines the Oxide Rancher node driver.
 ---
 apiVersion: management.cattle.io/v3
 kind: NodeDriver
 metadata:
 name: oxide
 annotations:
 privateCredentialFields: token
 publicCredentialFields: host
 finalizers:
 - controller.cattle.io/node-driver-controller
 spec:
 active: true
 addCloudCredential: true
 builtin: false
 checksum: f68726fd27312a669ccd01bdc84d568babc24d53496a542ea401670176f97cad
 description: "Oxide Rancher node driver."
 displayName: oxide
 externalId: ""
 uiUrl: ""
 url: "https://github.com/oxidecomputer/rancher-machine-driver-oxide/releases/download/v0.7.2/docker-machine-driver-oxide"
- Apply the Kubernetes manifest to create the Oxide Rancher node driver. - $ kubectl apply -f oxide-nodedriver.yaml
 nodedriver.management.cattle.io/oxide created
- Verify the Oxide Rancher node driver was successfully created. - $ kubectl get nodedriver oxide
 NAME AGE
 oxide 75s
Create the Oxide Kubernetes Cluster
- Create an Oxide cloud credential. The Oxide node driver uses this cloud credential to communicate with Oxide. Replace - $OXIDE_HOSTand- $OXIDE_TOKENwith values appropriate for your environment.- $ kubectl create secret generic oxide-cloud-credential \
 --namespace cattle-global-data \
 --type Opaque \
 --from-literal=oxidecredentialConfig-host=$OXIDE_HOST \
 --from-literal=oxidecredentialConfig-token=$OXIDE_TOKEN
 $ kubectl annotate secret oxide-cloud-credential \
 --namespace cattle-global-data \
 field.cattle.io/name=oxide-cloud-credential \
 provisioning.cattle.io/driver=oxide
- Create the following - oxide-k8s.yamlKubernetes manifest describing the Oxide machine configuration and the Oxide Kubernetes cluster. Change- $OXIDE_PROJECT,- $BOOT_DISK_IMAGE_ID, and- $SSH_USERto values appropriate for your environment. We’ll use an Ubuntu 24.04 LTS image and the- ubuntuusername in this guide.- # OxideConfig contains configuration for the Oxide Rancher node driver.
 ---
 apiVersion: rke-machine-config.cattle.io/v1
 kind: OxideConfig
 metadata:
 name: oxide-machine-config
 namespace: fleet-default
 bootDiskImageId: "$BOOT_DISK_IMAGE_ID"
 project: "$OXIDE_PROJECT"
 sshUser: "$SSH_USER"
 # Cluster defines the Oxide Kubernetes cluster.
 ---
 apiVersion: provisioning.cattle.io/v1
 kind: Cluster
 metadata:
 name: oxide-k8s-cluster
 namespace: fleet-default
 spec:
 cloudCredentialSecretName: cattle-global-data:oxide-cloud-credential
 kubernetesVersion: v1.31.9+rke2r1
 rkeConfig:
 machinePools:
 - name: oxide-k8s-pool
 quantity: 1
 machineConfigRef:
 kind: OxideConfig
 name: oxide-machine-config
 etcdRole: true
 workerRole: true
 controlPlaneRole: true
- Apply the Kubernetes manifest to create the Oxide Kubernetes cluster. - $ kubectl apply -f oxide-k8s.yaml
 oxideconfig.rke-machine-config.cattle.io/oxide-machine-config created
 cluster.provisioning.cattle.io/oxide-k8s-cluster created
- Verify the Oxide Kubernetes cluster is successfully provisioned. - $ kubectl get cluster --namespace fleet-default oxide-k8s-cluster
 NAME CLUSTERCLASS PHASE AGE VERSION
 oxide-k8s-cluster Provisioned 4m45s
Run a Workload on the Oxide Kubernetes Cluster
- Follow Configure Kubernetes Access to connect to the - oxide-k8s-clusterKubernetes cluster.
- Run an example workload on the Oxide Kubernetes cluster. - $ kubectl apply -f https://k8s.io/examples/application/deployment.yaml
 deployment.apps/nginx-deployment created
- Verify the example workload returns ready. - $ kubectl get deployment
 NAME READY UP-TO-DATE AVAILABLE AGE
 nginx-deployment 2/2 2 2 85s
Delete the Oxide Kubernetes Cluster
- Follow Configure Kubernetes Access to connect to the - localKubernetes cluster.
- Delete the Oxide Kubernetes cluster. - $ kubectl delete clusters.provisioning.cattle.io --namespace fleet-default oxide-k8s-cluster
 cluster.provisioning.cattle.io "oxide-k8s-cluster" deleted
- Delete the Oxide instance running Rancher.