forked from AymenSegni/terraform-helm-linkerd2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
115 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
resource "helm_release" "linkerd-viz" { | ||
count = var.enable_linkerd_viz == true ? 1 : 0 | ||
|
||
name = "linkerd-viz" | ||
repository = "https://helm.linkerd.io/stable" | ||
chart = "linkerd-viz" | ||
values = [ | ||
var.helm_values_linkerd_viz | ||
] | ||
depends_on = [ | ||
helm_release.linkerd | ||
] | ||
|
||
set { | ||
name = "linkerdVersion" | ||
value = var.linkerd_version | ||
} | ||
|
||
set { | ||
name = "clusterDomain" | ||
value = var.cluster_dns_name | ||
} | ||
|
||
set { | ||
name = "prometheus.enabled" | ||
value = var.external_prometheus_url == "" ? true : false | ||
} | ||
|
||
set { | ||
name = "prometheusUrl" | ||
value = var.external_prometheus_url | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
locals { | ||
values = var.enable_linkerd_ha == true ? "values-ha.yaml" : "values.yaml" | ||
} | ||
|
||
resource "helm_release" "linkerd" { | ||
name = "linkerd" | ||
repository = "https://helm.linkerd.io/stable" | ||
chart = "linkerd2" | ||
values = [ | ||
file("${path.module}/${local.values}"), | ||
var.helm_values_linkerd | ||
] | ||
|
||
set { | ||
name = "linkerdVersion" | ||
value = var.linkerd_version | ||
} | ||
|
||
set { | ||
name = "clusterDomain" | ||
value = var.cluster_dns_name | ||
} | ||
|
||
set_sensitive { | ||
name = "identityTrustAnchorsPEM" | ||
value = var.external_trustanchor | ||
? var.trustanchor_cert.cert_pem | ||
: tls_self_signed_cert.trustanchor_cert[0].cert_pem | ||
} | ||
|
||
set_sensitive { | ||
name = "identity.issuer.crtExpiry" | ||
value = tls_locally_signed_cert.issuer_cert.validity_end_time | ||
} | ||
|
||
set_sensitive { | ||
name = "identity.issuer.tls.crtPEM" | ||
value = tls_locally_signed_cert.issuer_cert.cert_pem | ||
} | ||
|
||
set_sensitive { | ||
name = "identity.issuer.tls.keyPEM" | ||
value = tls_private_key.issuer_key.private_key_pem | ||
} | ||
} | ||
|
||
output "linkerd" { | ||
value = "If in HA-mode, please refer to https://linkerd.io/2.11/features/ha/ and set label on kube-system: config.linkerd.io/admission-webhooks=disabled" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# empty placeholder for enabling values-ha inject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
variable "external_trustanchor" { | ||
description = "enable the externally supplied trustanchor creation, implies setting trustanchor_* variables!" | ||
default = false | ||
} | ||
|
||
variable "trustanchor_key" { | ||
description = "external trustanchor key" | ||
default = false | ||
} | ||
|
||
variable "trustanchor_cert" { | ||
description = "external trustanchor cert" | ||
default = false | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
variable "enable_linkerd_viz" { | ||
description = "install linkerd viz" | ||
type = bool | ||
default = false | ||
} | ||
|
||
variable "helm_values_linkerd_viz" { | ||
description = "additional values for linked-viz release" | ||
type = string | ||
default = "" | ||
} |