-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlocals.tf
74 lines (62 loc) · 2.46 KB
/
locals.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# Copyright (c) Tetrate, Inc 2022 All Rights Reserved.
locals {
default_version = coalesce(var.distribution_version, "1.18.2")
default_helm_config = {
name = "undefined"
chart = "undefined"
repository = "https://istio-release.storage.googleapis.com/charts"
version = local.default_version
namespace = "istio-system"
timeout = "1200"
create_namespace = true
description = "Istio service mesh"
}
per_distribution_helm_configs = {
"TID" = local.tetrate_istio_distribution_helm_config
}
per_distribution_helm_values = {
"TID" = local.tetrate_istio_distribution_helm_values
}
distribution_helm_config = lookup(local.per_distribution_helm_configs, var.distribution, {})
distribution_helm_values = lookup(local.per_distribution_helm_values, var.distribution, {})
cni_helm_values = [yamlencode({
"istio_cni" : {
"enabled" : var.install_cni
}
})]
default_base_helm_values = lookup(local.distribution_helm_values, "base", [])
default_cni_helm_values = lookup(local.distribution_helm_values, "cni", [])
default_istiod_helm_values = concat(lookup(local.distribution_helm_values, "istiod", []), local.cni_helm_values)
default_gateway_helm_values = lookup(local.distribution_helm_values, "gateway", [])
base_helm_config = merge(
local.default_helm_config,
local.distribution_helm_config,
{ name = "istio-base", chart = "base" },
var.base_helm_config,
{ values = concat(local.default_base_helm_values, lookup(var.base_helm_config, "values", [])) }
)
cni_helm_config = merge(
local.default_helm_config,
local.distribution_helm_config,
{ name = "istio-cni", chart = "cni" },
var.cni_helm_config,
{ values = concat(local.default_cni_helm_values, lookup(var.cni_helm_config, "values", [])) }
)
istiod_helm_config = merge(
local.default_helm_config,
local.distribution_helm_config,
{ name = "istio-istiod", chart = "istiod" },
var.istiod_helm_config,
{ values = concat(local.default_istiod_helm_values, lookup(var.istiod_helm_config, "values", [])) }
)
gateway_helm_config = merge(
local.default_helm_config,
local.distribution_helm_config,
{ name = "istio-ingressgateway", chart = "gateway" },
var.gateway_helm_config,
{ values = concat(local.default_gateway_helm_values, lookup(var.gateway_helm_config, "values", [])) }
)
argocd_gitops_config = {
enable = true
}
}