Skip to content

Commit

Permalink
feat: diff k8s manifests (#66)
Browse files Browse the repository at this point in the history
* feat: diff k8s manifests

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

---------

Co-authored-by: modridi <modridi@users.noreply.github.com>
  • Loading branch information
modridi and modridi authored Jun 15, 2023
1 parent a737b10 commit 96c7f50
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 11 deletions.
17 changes: 12 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,18 @@ The following requirements are needed by this module:

The following providers are used by this module:

- [[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>>

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

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

=== Resources

The following resources are used by this module:
Expand All @@ -57,9 +59,11 @@ 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 @@ -96,7 +100,7 @@ Description: Override of target revision of the application chart.

Type: `string`

Default: `"v3.0.0"`
Default: `"v3.1.0"`

==== [[input_cluster_issuer]] <<input_cluster_issuer,cluster_issuer>>

Expand Down Expand Up @@ -231,9 +235,10 @@ Description: The admin password for Grafana.
|===
|Name |Version
|[[provider_random]] <<provider_random,random>> |>= 3
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 4
|[[provider_kubernetes]] <<provider_kubernetes,kubernetes>> |>= 2
|[[provider_utils]] <<provider_utils,utils>> |>= 1
|[[provider_argocd]] <<provider_argocd,argocd>> |>= 4
|[[provider_helm]] <<provider_helm,helm>> |n/a
|[[provider_null]] <<provider_null,null>> |>= 3
|===
Expand All @@ -247,9 +252,11 @@ 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 @@ -279,7 +286,7 @@ Description: The admin password for Grafana.
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v3.0.0"`
|`"v3.1.0"`
|no
|[[input_cluster_issuer]] <<input_cluster_issuer,cluster_issuer>>
Expand Down
4 changes: 2 additions & 2 deletions aks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Description: Override of target revision of the application chart.

Type: `string`

Default: `"v3.0.0"`
Default: `"v3.1.0"`

==== [[input_cluster_issuer]] <<input_cluster_issuer,cluster_issuer>>

Expand Down Expand Up @@ -282,7 +282,7 @@ object({
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v3.0.0"`
|`"v3.1.0"`
|no

|[[input_cluster_issuer]] <<input_cluster_issuer,cluster_issuer>>
Expand Down
4 changes: 2 additions & 2 deletions eks/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Description: Override of target revision of the application chart.

Type: `string`

Default: `"v3.0.0"`
Default: `"v3.1.0"`

==== [[input_cluster_issuer]] <<input_cluster_issuer,cluster_issuer>>

Expand Down Expand Up @@ -246,7 +246,7 @@ object({
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v3.0.0"`
|`"v3.1.0"`
|no

|[[input_cluster_issuer]] <<input_cluster_issuer,cluster_issuer>>
Expand Down
4 changes: 2 additions & 2 deletions kind/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Description: Override of target revision of the application chart.

Type: `string`

Default: `"v3.0.0"`
Default: `"v3.1.0"`

==== [[input_cluster_issuer]] <<input_cluster_issuer,cluster_issuer>>

Expand Down Expand Up @@ -250,7 +250,7 @@ object({
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v3.0.0"`
|`"v3.1.0"`
|no

|[[input_cluster_issuer]] <<input_cluster_issuer,cluster_issuer>>
Expand Down
11 changes: 11 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ data "utils_deep_merge_yaml" "values" {
append_list = var.deep_merge_append_list
}

data "helm_template" "this" {
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" {
triggers = data.helm_template.this.manifests
}

resource "argocd_application" "this" {
metadata {
name = "kube-prometheus-stack"
Expand Down

0 comments on commit 96c7f50

Please sign in to comment.