From dfa52ee9ede4b8bd07f87076cad2faaee7c034b5 Mon Sep 17 00:00:00 2001
From: Colin Wilson <colin.wilson@protonmail.ch>
Date: Wed, 21 Apr 2021 04:16:00 +0100
Subject: [PATCH] =?UTF-8?q?=F0=9F=93=83=20add=20default=20example=20?=
 =?UTF-8?q?=F0=9F=93=84=20update=20readme?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 README.md                                | 14 +++++++-------
 examples/default_deployment/README.md    | 23 +++++++++++++++++++++++
 examples/default_deployment/main.tf      | 19 +++++++++++++++++++
 examples/default_deployment/outputs.tf   |  0
 examples/default_deployment/variables.tf |  2 ++
 5 files changed, 51 insertions(+), 7 deletions(-)
 create mode 100644 examples/default_deployment/README.md
 create mode 100644 examples/default_deployment/main.tf
 create mode 100644 examples/default_deployment/outputs.tf
 create mode 100644 examples/default_deployment/variables.tf

diff --git a/README.md b/README.md
index 7eb2ca9..7a44acd 100644
--- a/README.md
+++ b/README.md
@@ -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)
 
@@ -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 |
diff --git a/examples/default_deployment/README.md b/examples/default_deployment/README.md
new file mode 100644
index 0000000..345437a
--- /dev/null
+++ b/examples/default_deployment/README.md
@@ -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
diff --git a/examples/default_deployment/main.tf b/examples/default_deployment/main.tf
new file mode 100644
index 0000000..91aee5e
--- /dev/null
+++ b/examples/default_deployment/main.tf
@@ -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
+}
\ No newline at end of file
diff --git a/examples/default_deployment/outputs.tf b/examples/default_deployment/outputs.tf
new file mode 100644
index 0000000..e69de29
diff --git a/examples/default_deployment/variables.tf b/examples/default_deployment/variables.tf
new file mode 100644
index 0000000..cff19bb
--- /dev/null
+++ b/examples/default_deployment/variables.tf
@@ -0,0 +1,2 @@
+variable "ssh_key_fingerprints" {}
+variable "do_token" {}
\ No newline at end of file