Terraform module to install Rancher using helm to complete an HA installation.
Reference the module in a terraform file.
For example, rancher.tf
:
module "rancher_install" {
source = "github.com/terraform-rancher-modules/terraform-rancher-install"
rancher_hostname = "rancher.example.com"
}
terraform init
terraform apply
module "rancher_install" {
source = "github.com/terraform-rancher-modules/terraform-rancher-install"
rancher_hostname = "rancher.example.com"
tls_source = "secret"
cacerts_path = "certs/ca.pem"
tls_crt_path = "certs/cert.pem"
tls_key_path = "certs/key.pem"
}
module "rancher_install" {
source = "github.com/terraform-rancher-modules/terraform-rancher-install"
rancher_hostname = "rancher.example.com"
kubeconfig_file = "/path/to/kubeconfig"
}
module "rancher_install" {
source = "github.com/terraform-rancher-modules/terraform-rancher-install"
rancher_hostname = "rancher.example.com"
rancher_replicas = 1
rancher_version = "2.6.2"
}
module "rancher_install" {
source = "github.com/terraform-rancher-modules/terraform-rancher-install"
rancher_hostname = "rancher.example.com"
rancher_additional_helm_values = [
"bootstrapPassword: secret-string",
"auditLog.level: 1"
]
}
module "rancher_install" {
source = "github.com/terraform-rancher-modules/terraform-rancher-install"
rancher_hostname = "rancher.example.com"
airgap = true
default_registry = "registry.example.com:5000"
helm_repository = "https://helm.example.com/rancher-charts/"
}
Name | Version |
---|---|
helm | >= 2.4.1 |
kubernetes | >= 2.6.1 |
Name | Version |
---|---|
helm | 2.4.1 |
kubernetes | 2.6.1 |
No modules.
Name | Type |
---|---|
helm_release.cert_manager | resource |
helm_release.rancher | resource |
kubernetes_secret.image_pull_secret | resource |
kubernetes_secret.tls_ca | resource |
kubernetes_secret.tls_rancher_ingress | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
airgap | Enable airgap options for the Rancher environment, requires default_registry to be set | bool |
false |
no |
cacerts_path | Private CA certificate to use for Rancher UI/API connectivity | string |
null |
no |
cert_manager_enable | Install cert-manager even if not needed for Rancher, useful if migrating to certificates | string |
false |
no |
cert_manager_namespace | Namesapce to install cert-manager | string |
"cert-manager" |
no |
cert_manager_version | Version of cert-manager to install | string |
"v1.5.1" |
no |
default_registry | Default container image registry to pull images in the format of registry.domain.com:port (systemDefaultRegistry helm value) | string |
null |
no |
helm_password | Private helm repository password | string |
null |
no |
helm_repository | Helm repository for Rancher and cert-manager charts | string |
null |
no |
helm_username | Private helm repository username | string |
null |
no |
kubeconfig_file | The kubeconfig to use to interact with the cluster | string |
"~/.kube/config" |
no |
rancher_additional_helm_values | Helm options to provide to the Rancher helm chart | list(string) |
[] |
no |
rancher_antiaffinity | Value for antiAffinity when installing the Rancher helm chart (required/preferred) | string |
"required" |
no |
rancher_bootstrap_password | Password to use for bootstrapping Rancher | string |
"admin" |
no |
rancher_hostname | Value for hostname when installing the Rancher helm chart | string |
n/a | yes |
rancher_replicas | Value for replicas when installing the Rancher helm chart | number |
3 |
no |
rancher_version | Rancher version to install | string |
null |
no |
registry_password | Private container image registry password | string |
null |
no |
registry_username | Private container image registry username | string |
null |
no |
tls_crt_path | TLS certificate to use for Rancher UI/API connectivity | string |
null |
no |
tls_key_path | TLS key to use for Rancher UI/API connectivity | string |
null |
no |
tls_source | Value for ingress.tls.source when installing the Rancher helm chart | string |
"rancher" |
no |
Name | Description |
---|---|
rancher_bootstrap_password | Password to use for bootstrapping Rancher |
rancher_hostname | Value for hostname when installing the Rancher helm chart |