Terraform module to create an RKE cluster. It supports single and HA cluster configurations.
module "rke" {
source = "github.com/terraform-rancher-modules/terraform-rke-cluster"
node_public_ip = "192.168.236.121"
node_username = "ubuntu"
ssh_private_key_pem = "~/.ssh/id_rsa"
}
module "rke" {
source = "github.com/terraform-rancher-modules/terraform-rke-cluster"
rancher_nodes = [
{
public_ip = "192.168.236.121",
private_ip = "192.168.236.121",
roles = ["etcd", "controlplane", "worker"]
},
{
public_ip = "192.168.236.122",
private_ip = "192.168.236.122",
roles = ["etcd", "controlplane", "worker"]
},
{
public_ip = "192.168.236.123",
private_ip = "192.168.236.123",
roles = ["etcd", "controlplane", "worker"]
}
]
cluster_yaml = "./cluster.yaml"
}
Name | Version |
---|---|
local | >= 2.1.0 |
rke | >= 1.2.4 |
Name | Version |
---|---|
local | >= 2.1.0 |
rke | >= 1.2.4 |
No modules.
Name | Type |
---|---|
local_file.kube_config_yaml | resource |
rke_cluster.this | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
cluster_name | Name for the RKE cluster | string |
"rke-demo" |
no |
cluster_yaml | cluster.yaml configuration file to apply to the cluster | string |
null |
no |
kubernetes_version | Kubernetes version to use for the RKE cluster | string |
"v1.20.11-rancher1-1" |
no |
node_internal_ip | Internal IP address for single node RKE cluster | string |
null |
no |
node_public_ip | Public IP address for single node RKE cluster | string |
null |
no |
node_username | Username used for SSH access to the Rancher server cluster node | string |
n/a | yes |
private_registry_password | Specify private registry's password | string |
null |
no |
private_registry_url | Specify the private registry where kubernetes images are hosted. Ex: artifactory.company.com/docker | string |
null |
no |
private_registry_username | Specify private registry's username | string |
null |
no |
rancher_nodes | List of compute nodes for Rancher cluster | list(object({ |
null |
no |
rke_kubeconfig_filename | Kubeconfig output filename to use | string |
"kube_config_cluster.yml" |
no |
ssh_agent_auth | Enable SSH agent authentication | bool |
true |
no |
ssh_private_key_pem | Private key used for SSH access to the Rancher server cluster node(s) | string |
null |
no |
Name | Description |
---|---|
rke_kubeconfig_filename | Kubeconfig file location |