-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(readme): use tf-docs to generate README automatically from TF co…
…nfig
- Loading branch information
Showing
2 changed files
with
196 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
version: ">= 0.14" | ||
formatter: markdown table | ||
|
||
sections: | ||
show: | ||
- inputs | ||
- outputs | ||
- providers | ||
- requirements | ||
|
||
sort: | ||
enabled: true | ||
by: required | ||
|
||
settings: | ||
indent: 2 | ||
anchor: true | ||
escape: true | ||
html: true | ||
color: true | ||
|
||
type: true | ||
default: true | ||
description: true | ||
required: true | ||
sensitive: true | ||
|
||
content: | | ||
# terraform-module-k3s | ||
![Terraform Version](https://img.shields.io/badge/terraform-≥_0.13-blueviolet) | ||
[![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/xunleii/terraform-module-k3s?label=registry)](https://registry.terraform.io/modules/xunleii/k3s) | ||
[![GitHub issues](https://img.shields.io/github/issues/xunleii/terraform-module-k3s)](https://github.com/xunleii/terraform-module-k3s/issues) | ||
[![Open Source Helpers](https://www.codetriage.com/xunleii/terraform-module-k3s/badges/users.svg)](https://www.codetriage.com/xunleii/terraform-module-k3s) | ||
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license) | ||
Terraform module which creates a [k3s](https://k3s.io/) cluster, with multi-server | ||
and annotations/labels/taints management features. | ||
## Usage | ||
``` hcl-terraform | ||
module "k3s" { | ||
source = "xunleii/k3s/module" | ||
k3s_version = "v1.0.0" | ||
name = "my.k3s.local" | ||
cidr = { | ||
pods = "10.0.0.0/16" | ||
services = "10.1.0.0/16" | ||
} | ||
drain_timeout = "30s" | ||
managed_fields = ["label", "taint"] | ||
global_flags = [ | ||
"--tls-san k3s.my.domain.com" | ||
] | ||
servers = { | ||
# The node name will be automatically provided by | ||
# the module using the field name... any usage of | ||
# --node-name in additional_flags will be ignored | ||
server-one = { | ||
ip = "10.123.45.67" // internal node IP | ||
connection = { | ||
host = "203.123.45.67" // public node IP | ||
user = "ubuntu" | ||
} | ||
flags = ["--flannel-backend=none"] | ||
labels = {"node.kubernetes.io/type" = "master"} | ||
taints = {"node.k3s.io/type" = "server:NoSchedule"} | ||
} | ||
server-two = { | ||
ip = "10.123.45.68" | ||
connection = { | ||
host = "203.123.45.68" // bastion node | ||
user = "ubuntu" | ||
} | ||
flags = ["--flannel-backend=none"] | ||
labels = {"node.kubernetes.io/type" = "master"} | ||
taints = {"node.k3s.io/type" = "server:NoSchedule"} | ||
} | ||
server-three = { | ||
ip = "10.123.45.69" | ||
connection = { | ||
host = "203.123.45.69" // bastion node | ||
user = "ubuntu" | ||
} | ||
flags = ["--flannel-backend=none"] | ||
labels = {"node.kubernetes.io/type" = "master"} | ||
taints = {"node.k3s.io/type" = "server:NoSchedule"} | ||
} | ||
} | ||
agents = { | ||
# The node name will be automatically provided by | ||
# the module using the field name... any usage of | ||
# --node-name in additional_flags will be ignored | ||
agent-one = { | ||
ip = "10.123.45.70" | ||
connection = { | ||
user = "root" | ||
bastion_host = "203.123.45.67" // server_one node used as bastion | ||
bastion_user = "ubuntu" | ||
} | ||
labels = {"node.kubernetes.io/pool" = "service-pool"} | ||
}, | ||
agent-two = { | ||
ip = "10.123.45.71" | ||
connection = { | ||
user = "root" | ||
bastion_host = "203.123.45.67" | ||
bastion_user = "ubuntu" | ||
} | ||
labels = {"node.kubernetes.io/pool" = "service-pool"} | ||
}, | ||
agent-three = { | ||
name = "gpu-agent-one" | ||
ip = "10.123.45.72" | ||
connection = { | ||
user = "root" | ||
bastion_host = "203.123.45.67" | ||
bastion_user = "ubuntu" | ||
} | ||
labels = {"node.kubernetes.io/pool" = "gpu-pool"} | ||
taints = {dedicated = "gpu:NoSchedule"} | ||
}, | ||
} | ||
} | ||
``` | ||
{{ .Inputs }} | ||
> NOTES: <br/> | ||
> servers must have an odd number of nodes <br/> | ||
> use the first server node to configure the cluster <br/> | ||
> if `name` is not specified, the key in the map will be used as name <br/> | ||
> **only one** taint can be applied per taint name and per node <br/> | ||
{{ .Outputs }} | ||
{{ .Requirements }} | ||
## Security warning | ||
Because using external references on `destroy` provisionner is deprecated by Terraform, storing information | ||
inside each resources will be mandatory in order to manage several features like auto-draining node | ||
and fields management. So, several fields like `connection` block will be available in your TF state. | ||
This means that used password or private key will be **clearly readable** in this TF state. | ||
**Please do not use | ||
this module if you need to pass private key or password in the connection block, even if your TF state is | ||
securely stored**. | ||
## License | ||
terraform-module-k3s is released under the **MIT License**. See the bundled [LICENSE](LICENSE) file for details. | ||
# | ||
*Generated with :heart: by [terraform-docs](https://github.com/terraform-docs/terraform-docs)* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters