Skip to content

Commit

Permalink
Move module to ec2 dir, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dkeightley authored and dkeightley committed Feb 10, 2025
1 parent 884d8b7 commit 56e49e1
Show file tree
Hide file tree
Showing 29 changed files with 65 additions and 41 deletions.
5 changes: 3 additions & 2 deletions modules/distribution/rke/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
| Name | Version |
|------|---------|
| <a name="requirement_local"></a> [local](#requirement\_local) | >= 2.1.0 |
| <a name="requirement_rke"></a> [rke](#requirement\_rke) | >= 1.4.3 |
| <a name="requirement_rke"></a> [rke](#requirement\_rke) | >= 1.7.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_local"></a> [local](#provider\_local) | >= 2.1.0 |
| <a name="provider_rke"></a> [rke](#provider\_rke) | >= 1.4.3 |
| <a name="provider_rke"></a> [rke](#provider\_rke) | >= 1.7.0 |

## Modules

Expand All @@ -28,6 +28,7 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_additional_hostnames"></a> [additional\_hostnames](#input\_additional\_hostnames) | List of additional hostnames and IPs to include in the api server PKI cert | `list(string)` | `null` | no |
| <a name="input_bastion_host"></a> [bastion\_host](#input\_bastion\_host) | Bastion host configuration to access the RKE nodes | <pre>object({<br> address = string<br> user = string<br> ssh_key = string<br> ssh_key_path = string<br> })</pre> | `null` | no |
| <a name="input_cloud_provider"></a> [cloud\_provider](#input\_cloud\_provider) | Specify the cloud provider name | `string` | `null` | no |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name for the RKE cluster | `string` | `"rke-demo"` | no |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Documentation can be found [here](./docs.md).

```terraform
module "upstream_cluster" {
source = "git::https://github.com/rancherlabs/tf-rancher-up.git//modules/infra/aws"
source = "git::https://github.com/rancherlabs/tf-rancher-up.git//modules/infra/aws/ec2"
aws_region = "us-east-1"
prefix = "example-rancher"
instance_count = 1
Expand All @@ -26,7 +26,7 @@ module "upstream_cluster" {

```terraform
module "upstream_cluster" {
source = "git::https://github.com/rancherlabs/tf-rancher-up.git//modules/infra/aws"
source = "git::https://github.com/rancherlabs/tf-rancher-up.git//modules/infra/aws/ec2"
aws_region = "us-east-1"
prefix = "example-rancher"
instance_count = 1
Expand All @@ -39,11 +39,11 @@ module "upstream_cluster" {

```terraform
module "upstream_cluster" {
source = "git::https://github.com/rancherlabs/tf-rancher-up.git//modules/infra/aws"
source = "git::https://github.com/rancherlabs/tf-rancher-up.git//modules/infra/aws/ec2"
aws_region = "us-east-1"
prefix = "example-rancher"
instance_count = 1
vpc_id = "vpc-xxxxx"
subnet_id = "subnet-xxxxxx"
}
```
```
File renamed without changes.
4 changes: 2 additions & 2 deletions modules/infra/aws/docs.md → modules/infra/aws/ec2/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ No modules.
| <a name="input_aws_secret_key"></a> [aws\_secret\_key](#input\_aws\_secret\_key) | AWS secret key used to create AWS infrastructure | `string` | `null` | no |
| <a name="input_bastion_host"></a> [bastion\_host](#input\_bastion\_host) | Bastion host configuration to access the instances | <pre>object({<br> address = string<br> user = string<br> ssh_key = string<br> ssh_key_path = string<br> })</pre> | `null` | no |
| <a name="input_create_security_group"></a> [create\_security\_group](#input\_create\_security\_group) | Should create the security group associated with the instance(s) | `bool` | `true` | no |
| <a name="input_create_ssh_key_pair"></a> [create\_ssh\_key\_pair](#input\_create\_ssh\_key\_pair) | Specify if a new SSH key pair needs to be created for the instances | `bool` | `false` | no |
| <a name="input_create_ssh_key_pair"></a> [create\_ssh\_key\_pair](#input\_create\_ssh\_key\_pair) | Specify if a new SSH key pair needs to be created for the instances | `bool` | `true` | no |
| <a name="input_iam_instance_profile"></a> [iam\_instance\_profile](#input\_iam\_instance\_profile) | Specify IAM Instance Profile to assign to the instances/nodes | `string` | `null` | no |
| <a name="input_instance_ami"></a> [instance\_ami](#input\_instance\_ami) | Override the default SLES or Ubuntu AMI | `string` | `null` | no |
| <a name="input_instance_count"></a> [instance\_count](#input\_instance\_count) | Number of EC2 instances to create | `number` | `3` | no |
| <a name="input_instance_count"></a> [instance\_count](#input\_instance\_count) | Number of EC2 instances to create | `number` | `1` | no |
| <a name="input_instance_disk_size"></a> [instance\_disk\_size](#input\_instance\_disk\_size) | Specify root disk size (GB) | `string` | `"80"` | no |
| <a name="input_instance_security_group"></a> [instance\_security\_group](#input\_instance\_security\_group) | Provide a pre-existing security group ID | `string` | `null` | no |
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | Instance type used for all EC2 instances | `string` | `"t3.medium"` | no |
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions modules/infra/digitalocean/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ No modules.
|------|------|
| [digitalocean_droplet.droplet](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/droplet) | resource |
| [digitalocean_firewall.k8s_cluster](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/firewall) | resource |
| [digitalocean_loadbalancer.https_loadbalancer](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/loadbalancer) | resource |
| [digitalocean_loadbalancer.k8s_api_loadbalancer](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/loadbalancer) | resource |
| [digitalocean_ssh_key.key_pair](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs/resources/ssh_key) | resource |
| [local_file.private_key_pem](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource |
| [tls_private_key.ssh_private_key](https://registry.terraform.io/providers/hashicorp/tls/latest/docs/resources/private_key) | resource |
Expand All @@ -32,9 +34,12 @@ No modules.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_create_https_loadbalancer"></a> [create\_https\_loadbalancer](#input\_create\_https\_loadbalancer) | Specify if a loadbalancer for port 443 needs to be created for the instances | `bool` | `false` | no |
| <a name="input_create_k8s_api_loadbalancer"></a> [create\_k8s\_api\_loadbalancer](#input\_create\_k8s\_api\_loadbalancer) | Specify if a loadbalancer for port 6443 needs to be created for the instances | `bool` | `false` | no |
| <a name="input_create_ssh_key_pair"></a> [create\_ssh\_key\_pair](#input\_create\_ssh\_key\_pair) | Specify if a new SSH key pair needs to be created for the instances | `bool` | `false` | no |
| <a name="input_do_token"></a> [do\_token](#input\_do\_token) | DigitalOcean Authentication Token | `string` | `null` | no |
| <a name="input_droplet_count"></a> [droplet\_count](#input\_droplet\_count) | Number of droplets to create | `number` | `3` | no |
| <a name="input_droplet_image"></a> [droplet\_image](#input\_droplet\_image) | Droplet OS Image. Run `doctl compute image list-distribution' for standard OS images or `doctl compute image list` for application images and use the value under the `Slug` header` | `string` | `"ubuntu-24-10-x64"` | no |
| <a name="input_droplet_size"></a> [droplet\_size](#input\_droplet\_size) | Size used for all droplets | `string` | `"s-2vcpu-4gb"` | no |
| <a name="input_prefix"></a> [prefix](#input\_prefix) | Prefix added to names of all resources | `string` | `"rancher-terraform"` | no |
| <a name="input_region"></a> [region](#input\_region) | Region that droplets will be deployed to | `string` | `"sfo3"` | no |
Expand All @@ -50,8 +55,11 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_dependency"></a> [dependency](#output\_dependency) | n/a |
| <a name="output_droplet_ids"></a> [droplet\_ids](#output\_droplet\_ids) | n/a |
| <a name="output_droplet_ips"></a> [droplet\_ips](#output\_droplet\_ips) | n/a |
| <a name="output_droplets_private_ip"></a> [droplets\_private\_ip](#output\_droplets\_private\_ip) | n/a |
| <a name="output_droplets_public_ip"></a> [droplets\_public\_ip](#output\_droplets\_public\_ip) | n/a |
| <a name="output_https_loadbalancer_ip"></a> [https\_loadbalancer\_ip](#output\_https\_loadbalancer\_ip) | n/a |
| <a name="output_k8s_api_loadbalancer_ip"></a> [k8s\_api\_loadbalancer\_ip](#output\_k8s\_api\_loadbalancer\_ip) | n/a |
| <a name="output_ssh_key_pair_name"></a> [ssh\_key\_pair\_name](#output\_ssh\_key\_pair\_name) | n/a |
| <a name="output_ssh_key_path"></a> [ssh\_key\_path](#output\_ssh\_key\_path) | n/a |
7 changes: 4 additions & 3 deletions modules/rancher/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ No modules.
| <a name="input_kubeconfig_file"></a> [kubeconfig\_file](#input\_kubeconfig\_file) | The kubeconfig to use to interact with the cluster | `string` | `"~/.kube/config"` | no |
| <a name="input_rancher_additional_helm_values"></a> [rancher\_additional\_helm\_values](#input\_rancher\_additional\_helm\_values) | Helm options to provide to the Rancher helm chart | `list(string)` | `[]` | no |
| <a name="input_rancher_antiaffinity"></a> [rancher\_antiaffinity](#input\_rancher\_antiaffinity) | Value for antiAffinity when installing the Rancher helm chart (required/preferred) | `string` | `"required"` | no |
| <a name="input_rancher_bootstrap_password"></a> [rancher\_bootstrap\_password](#input\_rancher\_bootstrap\_password) | Password to use for bootstrapping Rancher (min 12 characters) | `string` | `"initial-admin-password"` | no |
| <a name="input_rancher_bootstrap_password"></a> [rancher\_bootstrap\_password](#input\_rancher\_bootstrap\_password) | Password to use when bootstrapping Rancher (min 12 characters) | `string` | `"initial-bootstrap-password"` | no |
| <a name="input_rancher_helm_repository"></a> [rancher\_helm\_repository](#input\_rancher\_helm\_repository) | Helm repository for Rancher chart | `string` | `null` | no |
| <a name="input_rancher_helm_repository_password"></a> [rancher\_helm\_repository\_password](#input\_rancher\_helm\_repository\_password) | Private Rancher helm repository password | `string` | `null` | no |
| <a name="input_rancher_helm_repository_username"></a> [rancher\_helm\_repository\_username](#input\_rancher\_helm\_repository\_username) | Private Rancher helm repository username | `string` | `null` | no |
| <a name="input_rancher_hostname"></a> [rancher\_hostname](#input\_rancher\_hostname) | Value for hostname when installing the Rancher helm chart | `string` | n/a | yes |
| <a name="input_rancher_namespace"></a> [rancher\_namespace](#input\_rancher\_namespace) | The Rancher release will be deployed to this namespace | `string` | `"cattle-system"` | no |
| <a name="input_rancher_password"></a> [rancher\_password](#input\_rancher\_password) | Password to use for Rancher (min 12 characters) | `string` | `null` | no |
| <a name="input_rancher_password"></a> [rancher\_password](#input\_rancher\_password) | Password for the Rancher admin account (min 12 characters) | `string` | `null` | no |
| <a name="input_rancher_replicas"></a> [rancher\_replicas](#input\_rancher\_replicas) | Value for replicas when installing the Rancher helm chart | `number` | `3` | no |
| <a name="input_rancher_version"></a> [rancher\_version](#input\_rancher\_version) | Rancher version to install | `string` | `null` | no |
| <a name="input_registry_password"></a> [registry\_password](#input\_registry\_password) | Private container image registry password | `string` | `null` | no |
Expand All @@ -74,5 +74,6 @@ No modules.
| Name | Description |
|------|-------------|
| <a name="output_rancher_admin_token"></a> [rancher\_admin\_token](#output\_rancher\_admin\_token) | Rancher API token for the admin user |
| <a name="output_rancher_bootstrap_password"></a> [rancher\_bootstrap\_password](#output\_rancher\_bootstrap\_password) | Password for the Rancher admin account |
| <a name="output_rancher_bootstrap_password"></a> [rancher\_bootstrap\_password](#output\_rancher\_bootstrap\_password) | Password used to install Rancher |
| <a name="output_rancher_hostname"></a> [rancher\_hostname](#output\_rancher\_hostname) | Value for hostname when installing the Rancher helm chart |
| <a name="output_rancher_password"></a> [rancher\_password](#output\_rancher\_password) | Password for the Rancher admin account |
4 changes: 2 additions & 2 deletions recipes/rke/split-roles/aws/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_master_nodes"></a> [master\_nodes](#module\_master\_nodes) | ../../../../modules/infra/aws | n/a |
| <a name="module_master_nodes"></a> [master\_nodes](#module\_master\_nodes) | ../../../../modules/infra/aws/ec2 | n/a |
| <a name="module_rke"></a> [rke](#module\_rke) | ../../../../modules/distribution/rke | n/a |
| <a name="module_worker_nodes"></a> [worker\_nodes](#module\_worker\_nodes) | ../../../../modules/infra/aws | n/a |
| <a name="module_worker_nodes"></a> [worker\_nodes](#module\_worker\_nodes) | ../../../../modules/infra/aws/ec2 | n/a |

## Resources

Expand Down
4 changes: 2 additions & 2 deletions recipes/rke/split-roles/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ locals {
}

module "master_nodes" {
source = "../../../../modules/infra/aws"
source = "../../../../modules/infra/aws/ec2"

prefix = "${var.prefix}-m"
instance_count = var.master_nodes_count
Expand Down Expand Up @@ -33,7 +33,7 @@ module "master_nodes" {
}

module "worker_nodes" {
source = "../../../../modules/infra/aws"
source = "../../../../modules/infra/aws/ec2"

prefix = "${var.prefix}-w"
instance_count = var.worker_nodes_count
Expand Down
2 changes: 1 addition & 1 deletion recipes/standalone/aws/rke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This also updates the kube_config generated by RKE.
A log file for the RKE provisioning is written to `rke.log`

See full argument list for each module in use:
- [AWS](../../../../modules/infra/aws)
- [AWS](../../../../modules/infra/aws/ec2)
- [RKE](../../../../modules/distribution/rke)
- [Rancher](../../../../modules/rancher)

Expand Down
2 changes: 1 addition & 1 deletion recipes/standalone/aws/rke/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ No providers.

| Name | Source | Version |
|------|--------|---------|
| <a name="module_cluster-nodes"></a> [cluster-nodes](#module\_cluster-nodes) | ../../../../modules/infra/aws | n/a |
| <a name="module_cluster-nodes"></a> [cluster-nodes](#module\_cluster-nodes) | ../../../../modules/infra/aws/ec2 | n/a |
| <a name="module_rke"></a> [rke](#module\_rke) | ../../../../modules/distribution/rke | n/a |

## Resources
Expand Down
2 changes: 1 addition & 1 deletion recipes/standalone/aws/rke/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ locals {
}

module "cluster-nodes" {
source = "../../../../modules/infra/aws"
source = "../../../../modules/infra/aws/ec2"
prefix = var.prefix
instance_count = var.instance_count
instance_type = var.instance_type
Expand Down
2 changes: 1 addition & 1 deletion recipes/upstream/aws/k3s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ terraform destroy -var-file terraform.tfvars
The user data automatically sets up each node for use with kubectl (also alias to k) and crictl when logged in.

See full argument list for each module in use:
- [AWS](../../../../modules/infra/aws)
- [AWS](../../../../modules/infra/aws/ec2)
- [K3S](../../../../modules/distribution/k3s)
- [Rancher](../../../../modules/rancher)

Expand Down
8 changes: 4 additions & 4 deletions recipes/upstream/aws/k3s/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@

| Name | Version |
|------|---------|
| <a name="provider_local"></a> [local](#provider\_local) | 2.5.2 |
| <a name="provider_local"></a> [local](#provider\_local) | n/a |
| <a name="provider_ssh"></a> [ssh](#provider\_ssh) | 2.6.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_k3s_additional"></a> [k3s\_additional](#module\_k3s\_additional) | ../../../../modules/distribution/k3s | n/a |
| <a name="module_k3s_additional_servers"></a> [k3s\_additional\_servers](#module\_k3s\_additional\_servers) | ../../../../modules/infra/aws | n/a |
| <a name="module_k3s_additional_servers"></a> [k3s\_additional\_servers](#module\_k3s\_additional\_servers) | ../../../../modules/infra/aws/ec2 | n/a |
| <a name="module_k3s_first"></a> [k3s\_first](#module\_k3s\_first) | ../../../../modules/distribution/k3s | n/a |
| <a name="module_k3s_first_server"></a> [k3s\_first\_server](#module\_k3s\_first\_server) | ../../../../modules/infra/aws | n/a |
| <a name="module_k3s_workers"></a> [k3s\_workers](#module\_k3s\_workers) | ../../../../modules/infra/aws | n/a |
| <a name="module_k3s_first_server"></a> [k3s\_first\_server](#module\_k3s\_first\_server) | ../../../../modules/infra/aws/ec2 | n/a |
| <a name="module_k3s_workers"></a> [k3s\_workers](#module\_k3s\_workers) | ../../../../modules/infra/aws/ec2 | n/a |
| <a name="module_rancher_install"></a> [rancher\_install](#module\_rancher\_install) | ../../../../modules/rancher | n/a |

## Resources
Expand Down
6 changes: 3 additions & 3 deletions recipes/upstream/aws/k3s/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module "k3s_first" {
}

module "k3s_first_server" {
source = "../../../../modules/infra/aws"
source = "../../../../modules/infra/aws/ec2"
prefix = var.prefix
instance_count = 1
instance_type = var.instance_type
Expand Down Expand Up @@ -43,7 +43,7 @@ module "k3s_additional" {
}

module "k3s_additional_servers" {
source = "../../../../modules/infra/aws"
source = "../../../../modules/infra/aws/ec2"
prefix = var.prefix
instance_count = var.server_instance_count - 1
instance_type = var.instance_type
Expand All @@ -64,7 +64,7 @@ module "k3s_additional_servers" {
}

module "k3s_workers" {
source = "../../../../modules/infra/aws"
source = "../../../../modules/infra/aws/ec2"
prefix = var.prefix
instance_count = var.worker_instance_count
instance_type = var.instance_type
Expand Down
2 changes: 1 addition & 1 deletion recipes/upstream/aws/rke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This also updates the kube_config generated by RKE.
A log file for the RKE provisioning is written to `rke.log`

See full argument list for each module in use:
- [AWS](../../../../modules/infra/aws)
- [AWS](../../../../modules/infra/aws/ec2)
- [RKE](../../../../modules/distribution/rke)
- [Rancher](../../../../modules/rancher)

Expand Down
2 changes: 1 addition & 1 deletion recipes/upstream/aws/rke2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ terraform destroy
The user data automatically sets up each node for use with kubectl (also alias to k) and crictl when logged in.

See full argument list for each module in use:
- [AWS](../../../../modules/infra/aws)
- [AWS](../../../../modules/infra/aws/ec2)
- [RKE2](../../../../modules/distribution/rke2)
- [Rancher](../../../../modules/rancher)

Expand Down
6 changes: 3 additions & 3 deletions recipes/upstream/aws/rke2/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

| Name | Version |
|------|---------|
| <a name="provider_local"></a> [local](#provider\_local) | 2.5.2 |
| <a name="provider_local"></a> [local](#provider\_local) | n/a |
| <a name="provider_ssh"></a> [ssh](#provider\_ssh) | 2.6.0 |

## Modules
Expand All @@ -17,9 +17,9 @@
|------|--------|---------|
| <a name="module_rancher_install"></a> [rancher\_install](#module\_rancher\_install) | ../../../../modules/rancher | n/a |
| <a name="module_rke2_additional"></a> [rke2\_additional](#module\_rke2\_additional) | ../../../../modules/distribution/rke2 | n/a |
| <a name="module_rke2_additional_servers"></a> [rke2\_additional\_servers](#module\_rke2\_additional\_servers) | ../../../../modules/infra/aws | n/a |
| <a name="module_rke2_additional_servers"></a> [rke2\_additional\_servers](#module\_rke2\_additional\_servers) | ../../../../modules/infra/aws/ec2 | n/a |
| <a name="module_rke2_first"></a> [rke2\_first](#module\_rke2\_first) | ../../../../modules/distribution/rke2 | n/a |
| <a name="module_rke2_first_server"></a> [rke2\_first\_server](#module\_rke2\_first\_server) | ../../../../modules/infra/aws | n/a |
| <a name="module_rke2_first_server"></a> [rke2\_first\_server](#module\_rke2\_first\_server) | ../../../../modules/infra/aws/ec2 | n/a |

## Resources

Expand Down
Loading

0 comments on commit 56e49e1

Please sign in to comment.