-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor(Kind)!: rename module, change service config and output LB IP * docs(terraform-docs): generate docs and write to README.adoc * chore: terraform fmt * revert: restore nodeport variant * fix: nodeport doc * docs(terraform-docs): generate docs and write to README.adoc --------- Co-authored-by: modridi <[email protected]> Co-authored-by: Gonçalo Heleno <[email protected]> Release-As: v1.0.0-alpha.9
- Loading branch information
Showing
6 changed files
with
277 additions
and
1 deletion.
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
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,232 @@ | ||
// BEGIN_TF_DOCS | ||
=== Requirements | ||
|
||
No requirements. | ||
|
||
=== Providers | ||
|
||
The following providers are used by this module: | ||
|
||
- [[provider_kubernetes]] <<provider_kubernetes,kubernetes>> | ||
|
||
=== Modules | ||
|
||
The following Modules are called: | ||
|
||
==== [[module_traefik]] <<module_traefik,traefik>> | ||
|
||
Source: ../ | ||
|
||
Version: | ||
|
||
=== Resources | ||
|
||
The following resources are used by this module: | ||
|
||
- https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service[kubernetes_service.traefik] (data source) | ||
|
||
=== Required Inputs | ||
|
||
The following input variables are required: | ||
|
||
==== [[input_argocd_namespace]] <<input_argocd_namespace,argocd_namespace>> | ||
|
||
Description: n/a | ||
|
||
Type: `string` | ||
|
||
==== [[input_base_domain]] <<input_base_domain,base_domain>> | ||
|
||
Description: n/a | ||
|
||
Type: `string` | ||
|
||
==== [[input_cluster_name]] <<input_cluster_name,cluster_name>> | ||
|
||
Description: n/a | ||
|
||
Type: `string` | ||
|
||
=== Optional Inputs | ||
|
||
The following input variables are optional (have default values): | ||
|
||
==== [[input_app_autosync]] <<input_app_autosync,app_autosync>> | ||
|
||
Description: Automated sync options for the Argo CD Application resource. | ||
|
||
Type: | ||
[source,hcl] | ||
---- | ||
object({ | ||
allow_empty = optional(bool) | ||
prune = optional(bool) | ||
self_heal = optional(bool) | ||
}) | ||
---- | ||
|
||
Default: | ||
[source,json] | ||
---- | ||
{ | ||
"allow_empty": false, | ||
"prune": true, | ||
"self_heal": true | ||
} | ||
---- | ||
|
||
==== [[input_dependency_ids]] <<input_dependency_ids,dependency_ids>> | ||
|
||
Description: n/a | ||
|
||
Type: `map(string)` | ||
|
||
Default: `{}` | ||
|
||
==== [[input_helm_values]] <<input_helm_values,helm_values>> | ||
|
||
Description: Helm values, passed as a list of HCL structures. | ||
|
||
Type: `any` | ||
|
||
Default: `[]` | ||
|
||
==== [[input_namespace]] <<input_namespace,namespace>> | ||
|
||
Description: n/a | ||
|
||
Type: `string` | ||
|
||
Default: `"traefik"` | ||
|
||
==== [[input_target_revision]] <<input_target_revision,target_revision>> | ||
|
||
Description: Override of target revision of the application chart. | ||
|
||
Type: `string` | ||
|
||
Default: `"v1.0.0-alpha.6"` | ||
|
||
=== Outputs | ||
|
||
The following outputs are exported: | ||
|
||
==== [[output_external_ip]] <<output_external_ip,external_ip>> | ||
|
||
Description: External IP address of Traefik LB service. | ||
|
||
==== [[output_id]] <<output_id,id>> | ||
|
||
Description: n/a | ||
// END_TF_DOCS | ||
// BEGIN_TF_TABLES | ||
|
||
|
||
= Providers | ||
|
||
[cols="a,a",options="header,autowidth"] | ||
|=== | ||
|Name |Version | ||
|[[provider_kubernetes]] <<provider_kubernetes,kubernetes>> |n/a | ||
|=== | ||
|
||
= Modules | ||
|
||
[cols="a,a,a",options="header,autowidth"] | ||
|=== | ||
|Name |Source |Version | ||
|[[module_traefik]] <<module_traefik,traefik>> |../ | | ||
|=== | ||
|
||
= Resources | ||
|
||
[cols="a,a",options="header,autowidth"] | ||
|=== | ||
|Name |Type | ||
|https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/data-sources/service[kubernetes_service.traefik] |data source | ||
|=== | ||
|
||
= Inputs | ||
|
||
[cols="a,a,a,a,a",options="header,autowidth"] | ||
|=== | ||
|Name |Description |Type |Default |Required | ||
|[[input_app_autosync]] <<input_app_autosync,app_autosync>> | ||
|Automated sync options for the Argo CD Application resource. | ||
| | ||
|
||
[source] | ||
---- | ||
object({ | ||
allow_empty = optional(bool) | ||
prune = optional(bool) | ||
self_heal = optional(bool) | ||
}) | ||
---- | ||
|
||
| | ||
|
||
[source] | ||
---- | ||
{ | ||
"allow_empty": false, | ||
"prune": true, | ||
"self_heal": true | ||
} | ||
---- | ||
|
||
|no | ||
|
||
|[[input_argocd_namespace]] <<input_argocd_namespace,argocd_namespace>> | ||
|n/a | ||
|`string` | ||
|n/a | ||
|yes | ||
|
||
|[[input_base_domain]] <<input_base_domain,base_domain>> | ||
|n/a | ||
|`string` | ||
|n/a | ||
|yes | ||
|
||
|[[input_cluster_name]] <<input_cluster_name,cluster_name>> | ||
|n/a | ||
|`string` | ||
|n/a | ||
|yes | ||
|
||
|[[input_dependency_ids]] <<input_dependency_ids,dependency_ids>> | ||
|n/a | ||
|`map(string)` | ||
|`{}` | ||
|no | ||
|
||
|[[input_helm_values]] <<input_helm_values,helm_values>> | ||
|Helm values, passed as a list of HCL structures. | ||
|`any` | ||
|`[]` | ||
|no | ||
|
||
|[[input_namespace]] <<input_namespace,namespace>> | ||
|n/a | ||
|`string` | ||
|`"traefik"` | ||
|no | ||
|
||
|[[input_target_revision]] <<input_target_revision,target_revision>> | ||
|Override of target revision of the application chart. | ||
|`string` | ||
|`"v1.0.0-alpha.6"` | ||
|no | ||
|
||
|=== | ||
|
||
= Outputs | ||
|
||
[cols="a,a",options="header,autowidth"] | ||
|=== | ||
|Name |Description | ||
|[[output_external_ip]] <<output_external_ip,external_ip>> |External IP address of Traefik LB service. | ||
|[[output_id]] <<output_id,id>> |n/a | ||
|=== | ||
// END_TF_TABLES |
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,9 @@ | ||
locals { | ||
helm_values = [{ | ||
traefik = { | ||
# fullnameOverride is used to set the service name in traefik data source. | ||
# TODO check further if setting this value is necessary. | ||
fullnameOverride = "traefik" | ||
} | ||
}] | ||
} |
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,26 @@ | ||
module "traefik" { | ||
source = "../" | ||
|
||
cluster_name = var.cluster_name | ||
base_domain = var.base_domain | ||
argocd_namespace = var.argocd_namespace | ||
|
||
target_revision = var.target_revision | ||
namespace = var.namespace | ||
app_autosync = var.app_autosync | ||
|
||
helm_values = concat(local.helm_values, var.helm_values) | ||
|
||
dependency_ids = var.dependency_ids | ||
} | ||
|
||
data "kubernetes_service" "traefik" { | ||
metadata { | ||
name = local.helm_values.0.traefik.fullnameOverride | ||
namespace = var.namespace | ||
} | ||
|
||
depends_on = [ | ||
module.traefik | ||
] | ||
} |
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,8 @@ | ||
output "id" { | ||
value = module.traefik.id | ||
} | ||
|
||
output "external_ip" { | ||
description = "External IP address of Traefik LB service." | ||
value = data.kubernetes_service.traefik.status.0.load_balancer.0.ingress.0.ip | ||
} |
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 @@ | ||
../variables.tf |