Skip to content

Commit

Permalink
fix!: remove the Helm diff (#94)
Browse files Browse the repository at this point in the history
* fix!: remove the Helm diff

This feature was controversial within the team and for that reason a variable to activate was added before. However, this feature was not propagated to the other modules, so we decided as a team to remove it altogether for consistency between modules.

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

---------

Co-authored-by: lentidas <[email protected]>
  • Loading branch information
lentidas and lentidas authored Nov 3, 2023
1 parent 79ad8de commit 65fb62b
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 122 deletions.
34 changes: 5 additions & 29 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,16 @@ The following requirements are needed by this module:

The following providers are used by this module:

- [[provider_random]] <<provider_random,random>> (>= 3)

- [[provider_null]] <<provider_null,null>> (>= 3)

- [[provider_argocd]] <<provider_argocd,argocd>> (>= 5)

- [[provider_kubernetes]] <<provider_kubernetes,kubernetes>> (>= 2)

- [[provider_random]] <<provider_random,random>> (>= 3)

- [[provider_utils]] <<provider_utils,utils>> (>= 1)

- [[provider_helm]] <<provider_helm,helm>>

- [[provider_null]] <<provider_null,null>> (>= 3)

=== Resources

The following resources are used by this module:
Expand All @@ -59,11 +57,9 @@ The following resources are used by this module:
- https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace[kubernetes_namespace.kube_prometheus_stack_namespace] (resource)
- https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret[kubernetes_secret.thanos_object_storage_secret] (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.dependencies] (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.k8s_resources] (resource)
- https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.this] (resource)
- https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password[random_password.grafana_admin_password] (resource)
- https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password[random_password.oauth2_cookie_secret] (resource)
- https://registry.terraform.io/providers/hashicorp/helm/latest/docs/data-sources/template[helm_template.this] (data source)
- https://registry.terraform.io/providers/cloudposse/utils/latest/docs/data-sources/deep_merge_yaml[utils_deep_merge_yaml.values] (data source)

=== Required Inputs
Expand Down Expand Up @@ -158,15 +154,6 @@ Type: `bool`

Default: `false`

==== [[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>

Description: A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*

Type: `bool`

Default: `false`

==== [[input_app_autosync]] <<input_app_autosync,app_autosync>>

Description: Automated sync options for the Argo CD Application resource.
Expand Down Expand Up @@ -277,11 +264,10 @@ Description: The admin password for Grafana.
[cols="a,a",options="header,autowidth"]
|===
|Name |Version
|[[provider_random]] <<provider_random,random>> |>= 3
|[[provider_null]] <<provider_null,null>> |>= 3
|[[provider_kubernetes]] <<provider_kubernetes,kubernetes>> |>= 2
|[[provider_random]] <<provider_random,random>> |>= 3
|[[provider_utils]] <<provider_utils,utils>> |>= 1
|[[provider_helm]] <<provider_helm,helm>> |n/a
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 5
|===
Expand All @@ -295,11 +281,9 @@ Description: The admin password for Grafana.
|https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace[kubernetes_namespace.kube_prometheus_stack_namespace] |resource
|https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/secret[kubernetes_secret.thanos_object_storage_secret] |resource
|https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.dependencies] |resource
|https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.k8s_resources] |resource
|https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource[null_resource.this] |resource
|https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password[random_password.grafana_admin_password] |resource
|https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/password[random_password.oauth2_cookie_secret] |resource
|https://registry.terraform.io/providers/hashicorp/helm/latest/docs/data-sources/template[helm_template.this] |data source
|https://registry.terraform.io/providers/cloudposse/utils/latest/docs/data-sources/deep_merge_yaml[utils_deep_merge_yaml.values] |data source
|===
Expand Down Expand Up @@ -374,14 +358,6 @@ Description: The admin password for Grafana.
|`false`
|no
|[[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>
|A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*
|`bool`
|`false`
|no
|[[input_app_autosync]] <<input_app_autosync,app_autosync>>
|Automated sync options for the Argo CD Application resource.
|
Expand Down
17 changes: 0 additions & 17 deletions aks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,6 @@ Type: `bool`

Default: `false`

==== [[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>

Description: A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*

Type: `bool`

Default: `false`

==== [[input_app_autosync]] <<input_app_autosync,app_autosync>>

Description: Automated sync options for the Argo CD Application resource.
Expand Down Expand Up @@ -370,14 +361,6 @@ object({
|`false`
|no

|[[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>
|A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*

|`bool`
|`false`
|no

|[[input_app_autosync]] <<input_app_autosync,app_autosync>>
|Automated sync options for the Argo CD Application resource.
|
Expand Down
17 changes: 0 additions & 17 deletions eks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,6 @@ Type: `bool`

Default: `false`

==== [[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>

Description: A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*

Type: `bool`

Default: `false`

==== [[input_app_autosync]] <<input_app_autosync,app_autosync>>

Description: Automated sync options for the Argo CD Application resource.
Expand Down Expand Up @@ -334,14 +325,6 @@ object({
|`false`
|no

|[[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>
|A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*

|`bool`
|`false`
|no

|[[input_app_autosync]] <<input_app_autosync,app_autosync>>
|Automated sync options for the Argo CD Application resource.
|
Expand Down
17 changes: 0 additions & 17 deletions kind/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,6 @@ Type: `bool`

Default: `false`

==== [[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>

Description: A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*

Type: `bool`

Default: `false`

==== [[input_app_autosync]] <<input_app_autosync,app_autosync>>

Description: Automated sync options for the Argo CD Application resource.
Expand Down Expand Up @@ -338,14 +329,6 @@ object({
|`false`
|no

|[[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>
|A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*

|`bool`
|`false`
|no

|[[input_app_autosync]] <<input_app_autosync,app_autosync>>
|Automated sync options for the Argo CD Application resource.
|
Expand Down
16 changes: 0 additions & 16 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,6 @@ data "utils_deep_merge_yaml" "values" {
append_list = var.deep_merge_append_list
}

data "helm_template" "this" {
count = var.show_manifest_diff ? 1 : 0

name = "kube-prometheus-stack"
namespace = var.namespace
chart = "${path.module}/charts/kube-prometheus-stack"
values = [sensitive(data.utils_deep_merge_yaml.values.output)]
}

resource "null_resource" "k8s_resources" {
count = var.show_manifest_diff ? 1 : 0

triggers = data.helm_template.this[0].manifests
}

resource "argocd_application" "this" {
metadata {
name = var.destination_cluster != "in-cluster" ? "kube-prometheus-stack-${var.destination_cluster}" : "kube-prometheus-stack"
Expand Down Expand Up @@ -166,4 +151,3 @@ resource "null_resource" "this" {
resource.argocd_application.this,
]
}

17 changes: 0 additions & 17 deletions sks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -274,15 +274,6 @@ Type: `bool`

Default: `false`

==== [[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>

Description: A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*

Type: `bool`

Default: `false`

==== [[input_app_autosync]] <<input_app_autosync,app_autosync>>

Description: Automated sync options for the Argo CD Application resource.
Expand Down Expand Up @@ -484,14 +475,6 @@ object({
|`false`
|no
|[[input_show_manifest_diff]] <<input_show_manifest_diff,show_manifest_diff>>
|A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*
|`bool`
|`false`
|no
|[[input_app_autosync]] <<input_app_autosync,app_autosync>>
|Automated sync options for the Argo CD Application resource.
|
Expand Down
9 changes: 0 additions & 9 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ variable "deep_merge_append_list" {
default = false
}

variable "show_manifest_diff" {
description = <<-EOT
A boolean to enable/disable outputting Helm templates on the Terraform plan.
This is useful for debugging purposes only. *Make sure no secrets appear in the Kubernetes manifests before setting this flag, otherwise they will be exposed in your Terraform plan.*
EOT
type = bool
default = false
}

variable "app_autosync" {
description = "Automated sync options for the Argo CD Application resource."
type = object({
Expand Down

0 comments on commit 65fb62b

Please sign in to comment.