Skip to content

Commit

Permalink
Fix issues
Browse files Browse the repository at this point in the history
  • Loading branch information
voatsap committed Feb 17, 2021
1 parent ab702a9 commit 6ec3a70
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 71 deletions.
72 changes: 2 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,10 @@
# AWS K3s Terraform Module

Terraform module that creates a HA [K3s Cluster](https://k3s.io/) in AWS cloud and deploys a set of core addons.
Terraform module that creates a HA [K3s Cluster](https://k3s.io/) in AWS cloud.

## Prerequisites


### Key Features

- [Embedded etcd](https://rancher.com/docs/k3s/latest/en/installation/ha-embedded/#embedded-etcd-experimental) cluster with autoheal capabilities.
- Cluster [Disaster Recovery](docs/RECOVERY.md) procedures.

## Principal Diagram

![k3s diagram](docs/k3s-module-diagram.png)

## Structure

```bash
module
├── files - cloud-config user-data
├── infra.tf - masters and workers ASG definition
├── init.tf - Terraform requirements
├── locals.tf - local values and helpers
├── nlb.tf - Load-balancer definition
├── outputs.tf - Module outputs
├── security_groups.tf - AWS SG list
├── variables.tf - Terraform variables
└── iam.tf - IAM policies
```

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Requirements

Expand Down Expand Up @@ -87,7 +63,7 @@ module

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

## Worker node groups configuration options
## Worker nodes groups configuration options

`worker_node_groups` is a list of maps, each element of which describes one k3s worker nodes group and must correspond to the options described below.

Expand All @@ -103,47 +79,3 @@ module
| node\_taints | A list of additional taints to be added to the k3s nodes | `list(string)` | `[]` | no |
| additional\_security\_group\_ids | A list of additional security groups to be attached to node group instances | `list(string)` | `[]` | no |
| tags | A list of additional tags to be attached to node group instances | `map(string)` | `{}` | no |

Example of full and minimal worker group configs:

```HCL
module "k3s" {
source = "git::ssh://[email protected]/shalb/terraform-aws-k3s.git"
... skipped for the brevity
worker_node_groups = [
# Full node group config.
{
name = "node_pool1"
min_size = 2
max_size = 5
desired_capacity = 2
root_volume_size = 50
instance_type = "t3.medium"
additional_security_group_ids = [
"SG-EXAMPLE1",
"SG-EXAMPLE2"
]
tags = {
tag-key1 = "value"
tag-key2 = "value2"
}
node_labels = [
"label_key=some_value",
"foo=bar"
]
node_taints = [
"key=value:NoExecute"
"key2=value2:NoExecute"
]
},
# Minimal node group config.
{
name = "node_pool2"
min_size = 1
max_size = 1
}
]
}
```
1 change: 0 additions & 1 deletion files/k3s.tpl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ software_install() {

%{ if instance_role == "worker" }
START_ARGS="agent --node-name $(curl http://169.254.169.254/latest/meta-data/local-hostname) \
--disable-cloud-controller \
--kubelet-arg="cloud-provider=external" \
--kubelet-arg="provider-id=aws:///$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone)/$(curl -s http://169.254.169.254/latest/meta-data/instance-id)" \
"
Expand Down

0 comments on commit 6ec3a70

Please sign in to comment.