Skip to content

terraform-rancher-modules/terraform-rke-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraform | RKE Cluster

Terraform module to create an RKE cluster. It supports single and HA cluster configurations.

Usage

Single node cluster

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"
}

HA cluster

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"
}

Requirements

Name Version
local >= 2.1.0
rke >= 1.2.4

Providers

Name Version
local >= 2.1.0
rke >= 1.2.4

Modules

No modules.

Resources

Name Type
local_file.kube_config_yaml resource
rke_cluster.this resource

Inputs

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({
public_ip = string
private_ip = string
roles = list(string)
}))
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

Outputs

Name Description
rke_kubeconfig_filename Kubeconfig file location

About

Terraform module to create and manage an RKE Kubernetes cluster

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages