Skip to content

Commit 61c6020

Browse files
authored
Vars improvements (#5)
* feta: improve variables * fix: fmt * fix: workflows * chores: vars improvement * Revert "Merge branch 'main' into variables-improvements" This reverts commit 989b0ad, reversing changes made to 652d4a0. * Revert "chores: vars improvement" This reverts commit 652d4a0. * Reapply "chores: vars improvement" This reverts commit 8640cc3.
1 parent 698e565 commit 61c6020

File tree

7 files changed

+128
-21
lines changed

7 files changed

+128
-21
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,24 @@ No modules.
7777
| <a name="input_control_plane_ca_validity"></a> [control\_plane\_ca\_validity](#input\_control\_plane\_ca\_validity) | Control plane Issuer CA validity in hours eg: 175200 for 20 years | `string` | `"175200"` | no |
7878
| <a name="input_control_plane_cert_duration"></a> [control\_plane\_cert\_duration](#input\_control\_plane\_cert\_duration) | Control plane TLS cert duration eg: 24h0m0s | `string` | `"72h0m0s"` | no |
7979
| <a name="input_control_plane_cert_renew_before"></a> [control\_plane\_cert\_renew\_before](#input\_control\_plane\_cert\_renew\_before) | Control plane TLS cert renew before eg: 1h0m0s | `string` | `"24h0m0s"` | no |
80-
| <a name="input_control_plane_helm_version"></a> [control\_plane\_helm\_version](#input\_control\_plane\_helm\_version) | Control plane helm version | `string` | `"1.16.11"` | no |
80+
| <a name="input_control_plane_enable_pod_anti_affinity"></a> [control\_plane\_enable\_pod\_anti\_affinity](#input\_control\_plane\_enable\_pod\_anti\_affinity) | Control plane enable podAntiAffinity | `bool` | `false` | no |
81+
| <a name="input_control_plane_enable_pod_distruption_budget"></a> [control\_plane\_enable\_pod\_distruption\_budget](#input\_control\_plane\_enable\_pod\_distruption\_budget) | Control plane enable podDisruptionBudget | `bool` | `false` | no |
82+
| <a name="input_control_plane_helm_version"></a> [control\_plane\_helm\_version](#input\_control\_plane\_helm\_version) | Control plane helm version | `string` | `"1.16.10"` | no |
8183
| <a name="input_control_plane_namespace"></a> [control\_plane\_namespace](#input\_control\_plane\_namespace) | Control plane namespace | `string` | `"linkerd"` | no |
84+
| <a name="input_control_plane_replica_count"></a> [control\_plane\_replica\_count](#input\_control\_plane\_replica\_count) | Control plane replica count | `number` | `1` | no |
8285
| <a name="input_crds_helm_vesion"></a> [crds\_helm\_vesion](#input\_crds\_helm\_vesion) | Crds helm version | `string` | `"1.8.0"` | no |
83-
| <a name="input_kubernetes"></a> [kubernetes](#input\_kubernetes) | Kubernetes connection configuration | <pre>object({<br> host : string,<br> cluster_ca_certificate : string,<br> token : string,<br> })</pre> | n/a | yes |
86+
| <a name="input_dashboard_replica_count"></a> [dashboard\_replica\_count](#input\_dashboard\_replica\_count) | Dashboard replica count | `number` | `1` | no |
87+
| <a name="input_kubernetes"></a> [kubernetes](#input\_kubernetes) | Kubernetes config | `map(string)` | <pre>{<br> "config_context": "my-context",<br> "config_path": "~/.kube/config"<br>}</pre> | no |
8488
| <a name="input_linkerd_repository"></a> [linkerd\_repository](#input\_linkerd\_repository) | stable \| edge \| enterprise | `string` | `"stable"` | no |
89+
| <a name="input_metrics_replica_count"></a> [metrics\_replica\_count](#input\_metrics\_replica\_count) | Metrics api replica count | `number` | `1` | no |
90+
| <a name="input_tap_injector_replica_count"></a> [tap\_injector\_replica\_count](#input\_tap\_injector\_replica\_count) | Tap injector replica count | `number` | `1` | no |
91+
| <a name="input_tap_replica_count"></a> [tap\_replica\_count](#input\_tap\_replica\_count) | Tap replica count | `number` | `1` | no |
8592
| <a name="input_viz_ca_validity"></a> [viz\_ca\_validity](#input\_viz\_ca\_validity) | Viz Issuer CA validity in hours eg: 175200 for 20 years | `string` | `"175200"` | no |
8693
| <a name="input_viz_cert_duration"></a> [viz\_cert\_duration](#input\_viz\_cert\_duration) | Viz TLS cert duration eg: 24h0m0s | `string` | `"48h0m0s"` | no |
8794
| <a name="input_viz_cert_renew_before"></a> [viz\_cert\_renew\_before](#input\_viz\_cert\_renew\_before) | Viz TLS cert renew before eg: 1h0m0s | `string` | `"24h0m0s"` | no |
88-
| <a name="input_viz_helm_version"></a> [viz\_helm\_version](#input\_viz\_helm\_version) | Viz helm version | `string` | `"30.12.11"` | no |
95+
| <a name="input_viz_enable_pod_anti_affinity"></a> [viz\_enable\_pod\_anti\_affinity](#input\_viz\_enable\_pod\_anti\_affinity) | Viz enable podAntiAffinity | `bool` | `false` | no |
96+
| <a name="input_viz_enable_pod_distruption_budget"></a> [viz\_enable\_pod\_distruption\_budget](#input\_viz\_enable\_pod\_distruption\_budget) | Viz enable podDisruptionBudget | `bool` | `false` | no |
97+
| <a name="input_viz_helm_version"></a> [viz\_helm\_version](#input\_viz\_helm\_version) | Viz helm version | `string` | `"30.12.10"` | no |
8998
| <a name="input_viz_namespace"></a> [viz\_namespace](#input\_viz\_namespace) | Viz namespace | `string` | `"linkerd-viz"` | no |
9099
| <a name="input_webhook_ca_validity"></a> [webhook\_ca\_validity](#input\_webhook\_ca\_validity) | Webhook Issuer CA validity in hours eg: 175200 for 20 years | `string` | `"175200"` | no |
91100
| <a name="input_webhook_cert_duration"></a> [webhook\_cert\_duration](#input\_webhook\_cert\_duration) | Webhook TLS cert duration eg: 24h0m0s | `string` | `"48h0m0s"` | no |

charts/linkerd-control-plane/values-ha.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ controlPlaneTracing: false
2424
# -- namespace to send control plane traces to
2525
controlPlaneTracingNamespace: linkerd-jaeger
2626
# -- control plane version. See Proxy section for proxy version
27-
linkerdVersion: linkerdVersionValue
27+
linkerdVersion: stable-2.14.10
2828
# -- default kubernetes deployment strategy
2929
deploymentStrategy:
3030
rollingUpdate:

charts/linkerd-viz/values-ha.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Usage:
33
# helm install -f values.yaml -f values-ha.yaml
44

5-
enablePodAntiAffinity: true
5+
enablePodAntiAffinity: false
66
enablePodDisruptionBudget: true
77

88
# nodeAffinity:
@@ -18,7 +18,7 @@ resources: &ha_resources
1818

1919
# tap configuration
2020
tap:
21-
replicas: 3
21+
replicas: 1
2222
resources: *ha_resources
2323

2424
# web configuration

charts/linkerd-viz/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Fields that should be common with the core control plane
66

77
# -- control plane version. See Proxy section for proxy version
8-
linkerdVersion: linkerdVersionValue
8+
linkerdVersion: stable-2.14.10
99
# -- Kubernetes DNS Domain name to use
1010
clusterDomain: cluster.local
1111
# -- Additional labels to add to all pods

main.tf

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ resource "helm_release" "linkerd_control_plane" {
8787
value = "true"
8888
}
8989

90+
set {
91+
name = "controllerReplicas"
92+
value = var.control_plane_replica_count
93+
}
94+
9095
set_sensitive {
9196
name = "identityTrustAnchorsPEM"
9297
value = data.kubernetes_secret.linkerd_identity_issuer_certificate.data["ca.crt"]
@@ -122,6 +127,16 @@ resource "helm_release" "linkerd_control_plane" {
122127
value = data.kubernetes_secret.linkerd_sp_validator_certificate.data["ca.crt"]
123128
}
124129

130+
set {
131+
name = "enablePodAntiAffinity"
132+
value = var.control_plane_enable_pod_anti_affinity
133+
}
134+
135+
set {
136+
name = "enablePodDisruptionBudget"
137+
value = var.control_plane_enable_pod_distruption_budget
138+
}
139+
125140
set_sensitive {
126141
name = "policyValidator.caBundle"
127142
value = data.kubernetes_secret.linkerd_policy_validator_certificate.data["ca.crt"]
@@ -155,11 +170,21 @@ resource "helm_release" "linkerd_viz" {
155170
value = "true"
156171
}
157172

173+
set {
174+
name = "tap.replicas"
175+
value = var.tap_replica_count
176+
}
177+
158178
set {
159179
name = "tapInjector.externalSecret"
160180
value = "true"
161181
}
162182

183+
set {
184+
name = "tapInjector.replicas"
185+
value = var.tap_replica_count
186+
}
187+
163188
set_sensitive {
164189
name = "tap.caBundle"
165190
value = data.kubernetes_secret.linkerd_viz_certificate.data["ca.crt"]
@@ -170,6 +195,26 @@ resource "helm_release" "linkerd_viz" {
170195
value = data.kubernetes_secret.linkerd_tap_injector_certificate.data["ca.crt"]
171196
}
172197

198+
set {
199+
name = "dashboard.replicas"
200+
value = var.dashboard_replica_count
201+
}
202+
203+
set {
204+
name = "metricsAPI.replicas"
205+
value = var.metrics_replica_count
206+
}
207+
208+
set {
209+
name = "enablePodAntiAffinity"
210+
value = var.viz_enable_pod_anti_affinity
211+
}
212+
213+
set {
214+
name = "enablePodDisruptionBudget"
215+
value = var.viz_enable_pod_distruption_budget
216+
}
217+
173218
depends_on = [
174219
data.kubernetes_secret.linkerd_viz_certificate,
175220
data.kubernetes_secret.linkerd_tap_injector_certificate,

providers.tf

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ terraform {
1818
provider "time" {}
1919

2020
provider "kubernetes" {
21-
host = var.kubernetes.host
22-
cluster_ca_certificate = var.kubernetes.cluster_ca_certificate
23-
token = var.kubernetes.token
21+
config_path = var.kubernetes.config_path
22+
config_context = var.kubernetes.config_context
2423
}
2524

2625
provider "helm" {
2726
kubernetes {
28-
host = var.kubernetes.host
29-
cluster_ca_certificate = var.kubernetes.cluster_ca_certificate
30-
token = var.kubernetes.token
27+
config_path = var.kubernetes.config_path
28+
config_context = var.kubernetes.config_context
3129
}
3230
}

variables.tf

Lines changed: 63 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
variable "kubernetes" {
2-
description = "Kubernetes connection configuration"
3-
type = object({
4-
host : string,
5-
cluster_ca_certificate : string,
6-
token : string,
7-
})
2+
description = "Kubernetes config"
3+
type = map(string)
4+
default = {
5+
"config_path" = "~/.kube/config"
6+
"config_context" = "my-context"
7+
}
88
}
99

1010
variable "linkerd_repository" {
@@ -16,8 +16,9 @@ variable "linkerd_repository" {
1616
variable "control_plane_helm_version" {
1717
description = "Control plane helm version"
1818
type = string
19-
default = "1.16.11"
19+
default = "1.16.10"
2020
}
21+
2122
variable "control_plane_namespace" {
2223
description = "Control plane namespace"
2324
type = string
@@ -42,6 +43,60 @@ variable "control_plane_cert_renew_before" {
4243
default = "24h0m0s"
4344
}
4445

46+
variable "control_plane_replica_count" {
47+
description = "Control plane replica count"
48+
type = number
49+
default = 1
50+
}
51+
52+
variable "tap_replica_count" {
53+
description = "Tap replica count"
54+
type = number
55+
default = 1
56+
}
57+
58+
variable "tap_injector_replica_count" {
59+
description = "Tap injector replica count"
60+
type = number
61+
default = 1
62+
}
63+
64+
variable "dashboard_replica_count" {
65+
description = "Dashboard replica count"
66+
type = number
67+
default = 1
68+
}
69+
70+
variable "metrics_replica_count" {
71+
description = "Metrics api replica count"
72+
type = number
73+
default = 1
74+
}
75+
76+
variable "viz_enable_pod_anti_affinity" {
77+
description = "Viz enable podAntiAffinity"
78+
type = bool
79+
default = false
80+
}
81+
82+
variable "viz_enable_pod_distruption_budget" {
83+
description = "Viz enable podDisruptionBudget"
84+
type = bool
85+
default = false
86+
}
87+
88+
variable "control_plane_enable_pod_anti_affinity" {
89+
description = "Control plane enable podAntiAffinity"
90+
type = bool
91+
default = false
92+
}
93+
94+
variable "control_plane_enable_pod_distruption_budget" {
95+
description = "Control plane enable podDisruptionBudget"
96+
type = bool
97+
default = false
98+
}
99+
45100
variable "webhook_ca_validity" {
46101
description = "Webhook Issuer CA validity in hours eg: 175200 for 20 years"
47102
type = string
@@ -62,7 +117,7 @@ variable "webhook_cert_renew_before" {
62117
variable "viz_helm_version" {
63118
description = "Viz helm version"
64119
type = string
65-
default = "30.12.11"
120+
default = "30.12.10"
66121
}
67122

68123
variable "viz_namespace" {

0 commit comments

Comments
 (0)