Skip to content

Commit

Permalink
[terraform-helm] Generate helm configuration from terraform (#981)
Browse files Browse the repository at this point in the history
  • Loading branch information
barroco authored Jan 4, 2024
1 parent 87da43c commit 1dc7cd5
Showing 1 changed file with 65 additions and 1 deletion.
66 changes: 65 additions & 1 deletion deploy/infrastructure/dependencies/terraform-commons-dss/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,68 @@ resource "local_file" "get_credentials" {
get_credentials_cmd = var.kubernetes_get_credentials_cmd
})
filename = "${local.workspace_location}/get-credentials.sh"
}
}

resource "local_file" "helm_chart_values" {
filename = "${local.workspace_location}/helm_values.yml"
content = yamlencode({
cockroachdb = {
fullnameOverride = "dss-cockroachdb"

conf = {
join = var.crdb_external_nodes
cluster-name = "dss-aws-1"
single-node = false
locality = "zone=${var.crdb_locality}"
}

statefulset = {
args = [
"--locality-advertise-addr=zone=${var.crdb_locality}@$(hostname -f)",
"--advertise-addr=$${HOSTNAME##*-}.${var.crdb_hostname_suffix}"
]
}

storage = {
persistentVolume = {
storageClass = var.kubernetes_storage_class
}
}
}

loadBalancers = {
cockroachdbNodes = [
for ip in var.crdb_internal_nodes[*].ip :
{
ip = ip
subnet = var.workload_subnet
}
]

dssGateway = {
ip = var.ip_gateway
subnet = var.workload_subnet
certName = var.gateway_cert_name
}
}

dss = {
image = local.image

conf = {
pubKeys = [
"/test-certs/auth2.pem"
]
jwksEndpoint = var.authorization.jwks != null ? var.authorization.jwks.endpoint : ""
jwksKeyIds = var.authorization.jwks != null ? [var.authorization.jwks.key_id] : []
hostname = var.app_hostname
enableScd = var.enable_scd
}
}

global = {
cloudProvider = var.kubernetes_cloud_provider_name
}
})
}

0 comments on commit 1dc7cd5

Please sign in to comment.