Skip to content

Commit

Permalink
Merge pull request #5 from aigisuk/develop
Browse files Browse the repository at this point in the history
Add default example; Update readme
  • Loading branch information
colinwilson authored Apr 21, 2021
2 parents 2913801 + dfa52ee commit e2cfe09
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TBC

## Architecture

A default deployment of this module provisions an architecture similar to that illustrated below (minus the external traffic Load Balancer). 2x Servers, 1x Agent and a load balancer in front of the servers providing a fixed registration address for the Kubernetes API.
A default deployment of this module provisions an architecture similar to that illustrated below (minus the external traffic Load Balancer). **2x** Servers, **1x** Agent and a load balancer in front of the servers providing a fixed registration address for the Kubernetes API. Additional Servers or Agents can be provisioned via the `server_count` and `agent_count` variables respectively.

![](https://res.cloudinary.com/qunux/image/upload/v1618680903/k3s-architecture-ha-server_border_rjwhll.png)

Expand All @@ -44,24 +44,24 @@ module "do-ha-k3s" {
}
```

A Functional example is included in the
Functional examples are included in the
[examples](./examples/) directory.

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| do_token | DigitalOcean Personal Access Token | string | `N/A` | yes |
| ssh_key_fingerprints | List of SSH Key fingerprints | list(string) | `N/A` | yes |
| do_token | DigitalOcean Personal Access Token | string | N/A | yes |
| ssh_key_fingerprints | List of SSH Key fingerprints | list(string) | N/A | yes |
| region | Region in which to deploy cluster | string | `fra1` | no |
| k3s_channel | K3s release channel. `stable`, `latest`, `testing` or a specific channel or version e.g. `v1.20`, `v1.19.8+k3s1` | string | `"stable"` | no |
| database_user | Database username | string | `"k3s_default_user"` | no |
| database_engine | Database engine. PostgreSQL (13) or MySQL (8) | string | `"postgres"` | no |
| database_size | Database Droplet size associated with the cluster (ex. db-s-1vcpu-1gb) | string |`"db-s-1vcpu-1gb"` | no |
| database_size | Database Droplet size associated with the cluster e.g. `db-s-1vcpu-1gb` | string |`"db-s-1vcpu-1gb"` | no |
| database_node_count | Number of nodes that comprise the database cluster | number | `1`| no |
| flannel_backend | Flannel Backend Type. Valid options include `vxlan`, `host-gw`, `ipsec` (default) or `wireguard` | string | `ipsec`| no |
| server_size | Server droplet size. e.g. s-1vcpu-2gb | string | `s-1vcpu-2gb`| no |
| agent_size | Agent droplet size. e.g. s-1vcpu-2gb | string | `s-1vcpu-2gb`| no |
| server_size | Server droplet size. e.g. `s-1vcpu-2gb` | string | `s-1vcpu-2gb`| no |
| agent_size | Agent droplet size. e.g. `s-1vcpu-2gb` | string | `s-1vcpu-2gb`| no |
| server_count | Number of server (master) nodes to provision | number | `2`| no |
| agent_count | Number of agent (worker) nodes to provision | number | `1`| no |
| server_taint_criticalonly | Allow only critical addons to be scheduled on servers? (thus preventing workloads from being launched on them) | bool | `true`| no |
Expand Down
23 changes: 23 additions & 0 deletions examples/default_deployment/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Default Deployment Example

This example illustrates how to use the `terraform-digitalocean-ha-k3s` module.

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

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| do_token | DigitalOcean Personal Access Token | string | N/A | yes |
| ssh_key_fingerprints | List of SSH Key fingerprints | list(string) | N/A | yes |

## Outputs

TBC

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

To provision this example, replace the values in the `terraform.tfvars` file with your own and run the following commands from within this directory:
- `terraform init` to get the plugins
- `terraform plan` to see the infrastructure plan
- `terraform apply` to apply the infrastructure build
- `terraform destroy` to destroy the built infrastructure
19 changes: 19 additions & 0 deletions examples/default_deployment/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
terraform {
required_providers {
digitalocean = {
source = "digitalocean/digitalocean"
}
}
required_version = ">= 0.13"
}

provider "digitalocean" {
token = var.do_token
}

module "ha-k3s" {
source = "github.com/aigisuk/terraform-digitalocean-ha-k3s"

do_token = var.do_token
ssh_key_fingerprints = var.ssh_key_fingerprints
}
Empty file.
2 changes: 2 additions & 0 deletions examples/default_deployment/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
variable "ssh_key_fingerprints" {}
variable "do_token" {}

0 comments on commit e2cfe09

Please sign in to comment.