Skip to content

Commit e2cb68c

Browse files
jaydelandZvikan
andauthored
fix: Enable argocd to manage kube-prometheus-stack (aws-ia#1295)
Co-authored-by: Zvika Nadav <[email protected]>
1 parent bcaa5c1 commit e2cb68c

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

docs/add-ons/kube-prometheus-stack.md

+10
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,13 @@ Be aware that it is likely necessary to update the CRDs when updating the Chart
4141

4242

4343
For complete project documentation, please visit the [kube-prometheus-stack Github repository](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack).
44+
45+
### GitOps Configuration
46+
47+
The following properties are made available for use when managing the add-on via GitOps.
48+
49+
```hcl
50+
kubePrometheusStack = {
51+
enable = true
52+
}
53+
```

modules/kubernetes-addons/kube-prometheus-stack/main.tf

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ module "helm_addon" {
2727
},
2828
var.helm_config
2929
)
30-
addon_context = var.addon_context
30+
manage_via_gitops = var.manage_via_gitops
31+
addon_context = var.addon_context
3132
}

modules/kubernetes-addons/kube-prometheus-stack/variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ variable "helm_config" {
44
default = {}
55
}
66

7+
variable "manage_via_gitops" {
8+
description = "Determines if the add-on should be managed via GitOps."
9+
type = bool
10+
default = false
11+
}
12+
713
variable "addon_context" {
814
description = "Input configuration for the addon"
915
type = object({

modules/kubernetes-addons/locals.tf

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ locals {
3333
argoWorkflows = var.enable_argo_workflows ? module.argo_workflows[0].argocd_gitops_config : null
3434
karpenter = var.enable_karpenter ? module.karpenter[0].argocd_gitops_config : null
3535
kubernetesDashboard = var.enable_kubernetes_dashboard ? module.kubernetes_dashboard[0].argocd_gitops_config : null
36+
kubePrometheusStack = var.enable_kube_prometheus_stack ? module.kube_prometheus_stack[0].argocd_gitops_config : null
3637
awsCloudWatchMetrics = var.enable_aws_cloudwatch_metrics ? module.aws_cloudwatch_metrics[0].argocd_gitops_config : null
3738
externalDns = var.enable_external_dns ? module.external_dns[0].argocd_gitops_config : null
3839
externalSecrets = var.enable_external_secrets ? module.external_secrets[0].argocd_gitops_config : null

modules/kubernetes-addons/main.tf

+5-4
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,11 @@ module "ondat" {
371371
}
372372

373373
module "kube_prometheus_stack" {
374-
count = var.enable_kube_prometheus_stack ? 1 : 0
375-
source = "./kube-prometheus-stack"
376-
helm_config = var.kube_prometheus_stack_helm_config
377-
addon_context = local.addon_context
374+
count = var.enable_kube_prometheus_stack ? 1 : 0
375+
source = "./kube-prometheus-stack"
376+
helm_config = var.kube_prometheus_stack_helm_config
377+
manage_via_gitops = var.argocd_manage_add_ons
378+
addon_context = local.addon_context
378379
}
379380

380381
module "portworx" {

0 commit comments

Comments
 (0)