Rancher Kubernetes Engine

The RKE provider for Pulumi can be used to provision Kubernetes clusters using the Rancher Kubernetes Engine.

See the full API documentation for complete details of the available RKE provider APIs.

Example

const rke = require("@pulumi/rke")

const cluster = new rke.Cluster('my-cluster', {
  cloudProvider: {
    name: "aws"
  },
  nodes: [{
    address: "<public ip address of host machine>",
    internalAddress: "<private ip address of host machine>",
    user: "<ssh username of host machine>",
    sshKey: "<private key to use when sshing to the host machine>",
    roles: [ "controlplane", "etcd", "worker" ],
  }],
  clusterName: "nodejs-test-cluster",
})
import * as rke from "@pulumi/rancher2";

const cluster = new rke.Cluster('my-cluster', {
  cloudProvider: {
    name: "aws"
  },
  nodes: [{
    address: "<public ip address of host machine>",
    internalAddress: "<private ip address of host machine>",
    user: "<ssh username of host machine>",
    sshKey: "<private key to use when sshing to the host machine>",
    roles: [ "controlplane", "etcd", "worker" ],
  }],
  clusterName: "nodejs-test-cluster",
})
import pulumi_rke as rke

rke_cluster = rke.Cluster("my-cluster", cloud_provider=rke.ClusterCloudProviderArgs(name="aws"),
                          nodes=[
                            rke.ClusterNodeArgs(address="<public ip address of host machine>",
                                                internal_address="<private ip address of host machine>",
                                                user="<ssh username of host machine>",
                                                ssh_key="<private key to use when sshing to the host machine>",
                                                roles=["controlplane", "etcd", "worker"])
                          ],
                          cluster_name="python-test-cluster")
import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	rke "github.com/pulumi/pulumi-rke/sdk/go/rke"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		user, err := rke.NewCluster(ctx, "my-cluster", &rke.ClusterArgs{
			CloudProvider: &rke.CloudProviderArgs{
				Name: pulumi.String("aws"),
            },
            Nodes: &rke.ClusterNodeArray{
				&rke.ClusterNode{
				    Address:         pulumi.String("<public ip address of host machine>"),
				    InternalAddress: pulumi.String("<private ip address of host machine>"),
				    User:            pulumi.String("<ssh username of host machine>"),
				    SshKey:          pulumi.String("<private key to use when sshing to the host machine>"),
				    Roles:           pulumi.StringArray{
				        &pulumi.String("controlplane"),
				        &pulumi.String("etcd"),
				        &pulumi.String("worker")
                    },
                },
            },
			ClusterName: pulumi.String("go-test-cluster"),
		})
		if err != nil {
			return err
		}

		return nil
	})
}
using System.Collections.Generic;
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Rke;

class Program
{
    static Task Main() =>
        Deployment.Run(() => {
            var cluster = new Cluster("my-cluster", new ClusterArgs
            {
                CloudProvider =
                {
                    Name = "aws",
                },
                ClusterName = "dotnet-test-cluster",
                Nodes =
                {
                  new ClusterNodeArgs
                  {
                    Address = "<public ip address of host machine>",
                    InternalAddress = "<private ip address of host machine>",
                    User = "<ssh username of host machine>",
                    SshKey = "<private key to use when sshing to the host machine>",
                    Roles =  { "controlplan", "etcd", "worker" },
                  },
                },
                Password = "initialPassw0rd",
                Enabled = true,
            });
        });
}

Libraries

The following packages are available in packager managers:

The RKE provider is open source and available in the pulumi/pulumi-rke repo.