Skip to content

Commit

Permalink
add cluster DNS name variable
Browse files Browse the repository at this point in the history
  • Loading branch information
huehnerhose committed May 16, 2022
1 parent 2658f6b commit 212b749
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions anchor-cert.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "tls_self_signed_cert" "trustanchor_cert" {
is_ca_certificate = true

subject {
common_name = "identity.linkerd.cluster.local"
common_name = var.cluster_dns_name
}

allowed_uses = [
Expand All @@ -33,7 +33,7 @@ resource "tls_cert_request" "issuer_req" {
private_key_pem = tls_private_key.issuer_key.private_key_pem

subject {
common_name = "identity.linkerd.cluster.local"
common_name = var.cluster_dns_name
}
}

Expand Down
6 changes: 6 additions & 0 deletions install.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ resource "helm_release" "linkerd" {
file("${path.module}/${local.values}"),
var.helm_values_linkerd
]

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
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
variable "cluster_dns_name" {
description = "DNS Domainname for the cluster"
type = string
default = "cluster.local"
}

variable "enable_linkerd_ha" {
description = "Enable Linkerd HA Mode for production cluster if true"
type = bool
Expand Down

0 comments on commit 212b749

Please sign in to comment.