Skip to content

Commit

Permalink
[tf][aptos-node] logging and monitoring consistency across clouds (ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
rustielin authored May 13, 2022
1 parent 0421f96 commit 405a662
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 4 deletions.
4 changes: 2 additions & 2 deletions terraform/aptos-node/aws/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ variable "workspace_name_override" {
}

variable "enable_logger" {
description = "Enable logger pod"
description = "Enable logger helm chart"
default = false
}

Expand All @@ -168,7 +168,7 @@ variable "logger_helm_values" {
}

variable "enable_monitoring" {
description = "Enable logger pod"
description = "Enable monitoring helm chart"
default = false
}

Expand Down
61 changes: 61 additions & 0 deletions terraform/aptos-node/azure/kubernetes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,64 @@ resource "helm_release" "validator" {
value = var.helm_force_update ? timestamp() : ""
}
}

resource "helm_release" "logger" {
count = var.enable_logger ? 1 : 0
name = "${terraform.workspace}-log"
chart = "${path.module}/../../helm/logger"
max_history = 10
wait = false

values = [
jsonencode({
logger = {
name = "aptos-logger"
}
chain = {
name = var.chain_name
}
serviceAccount = {
create = false
name = "${terraform.workspace}-aptos-node-validator"
}
}),
jsonencode(var.logger_helm_values),
]

set {
name = "timestamp"
value = timestamp()
}
}

resource "helm_release" "monitoring" {
count = var.enable_monitoring ? 1 : 0
name = "${terraform.workspace}-mon"
chart = "${path.module}/../../helm/monitoring"
max_history = 10
wait = false

values = [
jsonencode({
chain = {
name = var.chain_name
}
validator = {
name = var.validator_name
}
monitoring = {
prometheus = {
storage = {
class = "default"
}
}
}
}),
jsonencode(var.monitoring_helm_values),
]

set {
name = "timestamp"
value = timestamp()
}
}
22 changes: 22 additions & 0 deletions terraform/aptos-node/azure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,25 @@ variable "validator_instance_num" {
description = "Number of instances used for validator and fullnodes"
default = 2
}

variable "enable_logger" {
description = "Enable logger helm chart"
default = false
}

variable "logger_helm_values" {
description = "Map of values to pass to logger Helm"
type = any
default = {}
}

variable "enable_monitoring" {
description = "Enable monitoring helm chart"
default = false
}

variable "monitoring_helm_values" {
description = "Map of values to pass to monitoring Helm"
type = any
default = {}
}
4 changes: 2 additions & 2 deletions terraform/aptos-node/gcp/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ variable "validator_instance_num" {
}

variable "enable_logger" {
description = "Enable logger pod"
description = "Enable logger helm chart"
default = false
}

Expand All @@ -117,7 +117,7 @@ variable "logger_helm_values" {
}

variable "enable_monitoring" {
description = "Enable logger pod"
description = "Enable monitoring helm chart"
default = false
}

Expand Down

0 comments on commit 405a662

Please sign in to comment.