Skip to content

Commit

Permalink
add extra values capability
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 19, 2024
1 parent 1100f5d commit 06db5f0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
10 changes: 10 additions & 0 deletions examples/extras/datadog-agent/additional_env.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
locals {
datadog_env = []
clusteragent_env = []
}

# each takes the foramt of
## {
## "name" = environment-varaible-name
## "value" = value
## }
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ datadog:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
%{ if length(datadog_env)>0 ~}
%{ for e in datadog_env ~}
- name: ${e.name}
value: "${e.value}"
%{ endfor ~}
%{ endif ~}

clusterAgent:
enabled: true
Expand Down Expand Up @@ -81,6 +87,13 @@ clusterAgent:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
%{ if length(clusteragent_env)>0 ~}
%{ for e in clusteragent_env ~}
- name: ${e.name}
value: "${e.value}"
%{ endfor ~}
%{ endif ~}


#agents:
# useConfigMap: true
Expand Down
9 changes: 4 additions & 5 deletions examples/extras/datadog-agent/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,10 @@ resource "helm_release" "datadog" {
depends_on = [module.images, kubernetes_namespace.namespace]

values = [
file("datadog.values.yml"),
# templatefile("${path.root}/templates/fluentbit.env.yml.tpl", {
# region = local.region
# cluster_name = var.cluster_name
# })
templatefile("datadog.values.yml.tpl", {
datadog_env = local.datadog_env
clusteragent_env = local.clusteragent_env
})
]

set_sensitive {
Expand Down

0 comments on commit 06db5f0

Please sign in to comment.