Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

rancher/terraform-rancher-server

Repository files navigation

Rancher server Terraform module

Terraform module which creates servers to host Rancher and installs Rancher on them.

To use this module, you must install the RKE provider.

Terraform versions

Terraform 0.12

Usage

module "rancher_server" {
  rancher_password           = var.rancher_password
  use_default_vpc            = false
  vpc_id                     = "vpc-foobar"
  aws_region                 = "us-east-1"
  aws_profile                = null
  aws_elb_subnet_ids         = ["subnet-1", "subnet-2"]
  domain                     = "foo.domain"
  r53_domain                 = "rancher.foo.domain"
  rancher2_master_subnet_ids = ["subnet-1", "subnet-2"]
  rancher2_worker_subnet_ids = ["subnet-1", "subnet-2"]

  providers = {
    aws     = "aws"
    aws.r53 = "aws.r53"
  }
}

Inputs

Name Description Type Default Required
aws_elb_subnet_ids List of subnet ids in which to place the AWS ELB list [] no
aws_profile string "rancher-eng" no
aws_region string "us-west-2" no
certmanager_chart Helm chart to use for cert-manager install string "jetstack/cert-manager" no
certmanager_version Version of cert-manager to install string "0.10.0" no
creds_output_path Where to save the id_rsa config file. Should end in a forward slash / . string "./" no
domain string "eng.rancher.space" no
extra_ssh_keys Extra ssh keys to inject into Rancher instances list [] no
github_client_id GitHub client ID for Rancher to use, if using GH auth string "" no
github_client_secret GitHub client secret for Rancher to use, if using GH auth string "" no
instance_ssh_user Username for sshing into instances string "ubuntu" no
instance_type string "t3.large" no
le_email LetsEncrypt email address to use string "[email protected]" no
master_node_count Number of master nodes to launch number "3" no
name Name for deployment string "rancher-demo" no
r53_domain DNS domain for Route53 zone (defaults to domain if unset) string "" no
rancher2_custom_tags Custom tags for Rancher resources map { "DoNotDelete": "true", "Owner": "EIO_Demo" } no
rancher2_extra_allowed_gh_principals List of principals in form github_user://IDNUM to be given Rancher access list [] no
rancher2_github_auth_enabled Whether to use GitHub authentication for Rancher bool "false" no
rancher2_github_auth_org GitHub numerical ID of organization to grant Rancher access to string "53273206" no
rancher2_github_auth_team GitHub numerical ID of team to grant Rancher access to string "3414845" no
rancher2_github_auth_user GitHub numerical ID of user to grant Rancher access to string "3430214" no
rancher2_master_custom_tags Custom tags for Rancher master nodes map {} no
rancher2_master_subnet_ids List of subnet ids for Rancher master nodes list [] no
rancher2_worker_custom_tags Custom tags for Rancher worker nodes map {} no
rancher2_worker_subnet_ids List of subnet ids for Rancher worker nodes list [] no
rancher_chart Helm chart to use for Rancher install string "rancher-stable/rancher" no
rancher_current_password Rancher admin user current password string "null" no
rancher_nodes_in_asgs Control whether to put Rancher nodes in ASGs bool "true" no
rancher_password Password to set for Rancher root user string n/a yes
rancher_version Version of Rancher to install string "2.2.9" no
rke_backups_region Region to perform backups to S3 in. Defaults to aws_region string "" no
rke_backups_s3_endpoint Override for S3 endpoint to use for backups string "" no
use_default_vpc Should the default VPC for the region selected be used for Rancher bool "true" no
vpc_id If use_default_vpc is false, the vpc id that Rancher should use string "null" no
worker_node_count Number of worker nodes to launch number "3" no

Outputs

Name Description
etcd_backup_s3_bucket_id S3 bucket ID for etcd backups
etcd_backup_user_key AWS IAM access key id for etcd backup user
etcd_backup_user_secret AWS IAM secret access key for etcd backup user
master_addresses IP addresses of Rancher master nodes
rancher_admin_password Password set for Rancher local admin user
rancher_api_url FQDN of Rancher's Kubernetes API endpoint
rancher_token Admin token for Rancher cluster use
rancher_url URL at which to reach Rancher
worker_addresses IP addresses of Rancher worker nodes

License

Copyright (c) 2014-2019 Rancher Labs, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.