Skip to content

Commit

Permalink
feat: add variable for replicas (#40)
Browse files Browse the repository at this point in the history
* feat: add variable for replicas

* chore: move all chart values from values.yaml to locals.tf.

* docs(terraform-docs): generate docs and write to README.adoc

---------

Co-authored-by: ckaenzig <[email protected]>
Co-authored-by: Gonçalo Heleno <[email protected]>
  • Loading branch information
3 people authored May 15, 2023
1 parent f1b951e commit fdc0613
Show file tree
Hide file tree
Showing 10 changed files with 124 additions and 18 deletions.
20 changes: 17 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

The following providers are used by this module:

- [[provider_null]] <<provider_null,null>>

- [[provider_utils]] <<provider_utils,utils>>

- [[provider_argocd]] <<provider_argocd,argocd>>

- [[provider_null]] <<provider_null,null>>

=== Resources

The following resources are used by this module:
Expand Down Expand Up @@ -63,6 +63,14 @@ Type: `string`

Default: `"traefik"`

==== [[input_replicas]] <<input_replicas,replicas>>

Description: Number of Traefik pods to be deployed.

Type: `string`

Default: `"2"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Description: Helm values, passed as a list of HCL structures.
Expand Down Expand Up @@ -119,9 +127,9 @@ Description: n/a
[cols="a,a",options="header,autowidth"]
|===
|Name |Version
|[[provider_null]] <<provider_null,null>> |n/a
|[[provider_utils]] <<provider_utils,utils>> |n/a
|[[provider_argocd]] <<provider_argocd,argocd>> |n/a
|[[provider_null]] <<provider_null,null>> |n/a
|===

= Resources
Expand Down Expand Up @@ -171,6 +179,12 @@ Description: n/a
|`"traefik"`
|no

|[[input_replicas]] <<input_replicas,replicas>>
|Number of Traefik pods to be deployed.
|`string`
|`"2"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
|Helm values, passed as a list of HCL structures.
|`any`
Expand Down
14 changes: 14 additions & 0 deletions aks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ Type: `string`

Default: `"traefik"`

==== [[input_replicas]] <<input_replicas,replicas>>

Description: Number of Traefik pods to be deployed.

Type: `string`

Default: `"2"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Description: Helm values, passed as a list of HCL structures.
Expand Down Expand Up @@ -203,6 +211,12 @@ Description: n/a
|`"traefik"`
|no

|[[input_replicas]] <<input_replicas,replicas>>
|Number of Traefik pods to be deployed.
|`string`
|`"2"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
|Helm values, passed as a list of HCL structures.
|`any`
Expand Down
15 changes: 0 additions & 15 deletions charts/traefik/values.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1 @@
---
# -- Values passed to the Traefik chart
traefik:
deployment:
replicas: 2
additionalArguments:
- --metrics.prometheus=true
- --serversTransport.insecureSkipVerify=true
logs:
access:
enabled: true
tlsOptions:
default:
minVersion: VersionTLS12
middlewares:
redirections: {}
14 changes: 14 additions & 0 deletions eks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ Type: `string`

Default: `"traefik"`

==== [[input_replicas]] <<input_replicas,replicas>>

Description: Number of Traefik pods to be deployed.

Type: `string`

Default: `"2"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Description: Helm values, passed as a list of HCL structures.
Expand Down Expand Up @@ -147,6 +155,12 @@ Description: n/a
|`"traefik"`
|no

|[[input_replicas]] <<input_replicas,replicas>>
|Number of Traefik pods to be deployed.
|`string`
|`"2"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
|Helm values, passed as a list of HCL structures.
|`any`
Expand Down
14 changes: 14 additions & 0 deletions kind/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ Type: `string`

Default: `"traefik"`

==== [[input_replicas]] <<input_replicas,replicas>>

Description: Number of Traefik pods to be deployed.

Type: `string`

Default: `"2"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Description: Helm values, passed as a list of HCL structures.
Expand Down Expand Up @@ -179,6 +187,12 @@ Description: External IP address of Traefik LB service.
|`"traefik"`
|no

|[[input_replicas]] <<input_replicas,replicas>>
|Number of Traefik pods to be deployed.
|`string`
|`"2"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
|Helm values, passed as a list of HCL structures.
|`any`
Expand Down
17 changes: 17 additions & 0 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
locals {
helm_values = [{
traefik = {
deployment = {
replicas = var.replicas
}
additionalArguments = [
"--metrics.prometheus=true",
"--serversTransport.insecureSkipVerify=true"
]
logs = {
access = {
enabled = true
}
}
tlsOptions = {
default = {
minVersion = "VersionTLS12"
}
}
ressources = {
limits = {
cpu = "250m"
Expand Down
14 changes: 14 additions & 0 deletions nodeport/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ Type: `string`

Default: `"traefik"`

==== [[input_replicas]] <<input_replicas,replicas>>

Description: Number of Traefik pods to be deployed.

Type: `string`

Default: `"2"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Description: Helm values, passed as a list of HCL structures.
Expand Down Expand Up @@ -147,6 +155,12 @@ Description: n/a
|`"traefik"`
|no

|[[input_replicas]] <<input_replicas,replicas>>
|Number of Traefik pods to be deployed.
|`string`
|`"2"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
|Helm values, passed as a list of HCL structures.
|`any`
Expand Down
14 changes: 14 additions & 0 deletions scaleway/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ Type: `string`

Default: `"traefik"`

==== [[input_replicas]] <<input_replicas,replicas>>

Description: Number of Traefik pods to be deployed.

Type: `string`

Default: `"2"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Description: Helm values, passed as a list of HCL structures.
Expand Down Expand Up @@ -157,6 +165,12 @@ Description: n/a
|`"traefik"`
|no

|[[input_replicas]] <<input_replicas,replicas>>
|Number of Traefik pods to be deployed.
|`string`
|`"2"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
|Helm values, passed as a list of HCL structures.
|`any`
Expand Down
14 changes: 14 additions & 0 deletions sks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ Type: `string`

Default: `"traefik"`

==== [[input_replicas]] <<input_replicas,replicas>>

Description: Number of Traefik pods to be deployed.

Type: `string`

Default: `"2"`

==== [[input_helm_values]] <<input_helm_values,helm_values>>

Description: Helm values, passed as a list of HCL structures.
Expand Down Expand Up @@ -157,6 +165,12 @@ Description: n/a
|`"traefik"`
|no

|[[input_replicas]] <<input_replicas,replicas>>
|Number of Traefik pods to be deployed.
|`string`
|`"2"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
|Helm values, passed as a list of HCL structures.
|`any`
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ variable "namespace" {
default = "traefik"
}

variable "replicas" {
description = "Number of Traefik pods to be deployed."
type = string
default = "2"
}

variable "helm_values" {
description = "Helm values, passed as a list of HCL structures."
type = any
Expand Down

0 comments on commit fdc0613

Please sign in to comment.