Skip to content

Commit

Permalink
add the option to deploy k8s metrics server
Browse files Browse the repository at this point in the history
  • Loading branch information
baixiac committed May 30, 2024
1 parent 5283eee commit 53145aa
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
20 changes: 20 additions & 0 deletions config/metrics.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
resource "helm_release" "metrics_server" {
count = var.enable_metrics ? 1 : 0

name = "metrics-server"
repository = "https://kubernetes-sigs.github.io/metrics-server/"
chart = "metrics-server"
namespace = "kube-system"
version = var.metrics_server_version

set {
name = "apiService.insecureSkipTLSVerify"
value = "true"
}

wait = true
}

output "metrics_server_metadata" {
value = var.enable_metrics ? helm_release.metrics_server[0].metadata : null
}
1 change: 1 addition & 0 deletions config/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ AWS_REGION = "eu-west-2"
environment = "dev"
domain_name = {} # Pair of top level domain and hosted zone ID for deployed applications
with_dmz_pods = false
enable_metrics = false
enable_karpenter = false
enable_msk = false
enable_rds = false
Expand Down
10 changes: 10 additions & 0 deletions config/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ variable "instance_capacity_type" {
}
}

variable "metrics_server_version" {
type = string
default = "3.12.1"
}

variable "kafka_version" {
type = string
default = "3.2.0"
Expand Down Expand Up @@ -100,6 +105,11 @@ variable "with_dmz_pods" {
default = false
}

variable "enable_metrics" {
type = bool
description = "Do you need Metrics Server? [true, false]"
}

variable "enable_karpenter" {
type = bool
description = "Do you need Karpenter? [true, false]"
Expand Down

0 comments on commit 53145aa

Please sign in to comment.