Skip to content
This repository has been archived by the owner on Feb 19, 2024. It is now read-only.

Commit

Permalink
Merge pull request #49 from cabify/expose-resources
Browse files Browse the repository at this point in the history
Make prometheis resources configurable in prometheus
  • Loading branch information
dgonzalezruiz authored Dec 20, 2018
2 parents fb0fa00 + 4d7400a commit 5cc912b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
24 changes: 24 additions & 0 deletions apps/prometheus/inputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@ variable "prometheus_config" {
type = "string"
}

variable "prometheus_memory_limit" {
description = "Memory limit for the kubernetes prometheus pod"
type = "string"
default = "6Gi"
}

variable "prometheus_memory_request" {
description = "Memory request (minimum) for the kubernetes prometheus pod"
type = "string"
default = "3Gi"
}

variable "prometheus_cpu_limit" {
description = "CPU limit for the prometheus kubernetes pod"
type = "string"
default = "2"
}

variable "prometheus_cpu_request" {
description = "CPU request for the prometheus kubernetes pod"
type = "string"
default = "1"
}

variable "livenessprobe_delay" {
description = "Liveness probe delay for prometheus kubernetes pod"
type = "string"
Expand Down
12 changes: 12 additions & 0 deletions apps/prometheus/replication-controller.tf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ resource "kubernetes_replication_controller" "prometheus" {
image = "prom/prometheus:v2.5.0"
name = "prometheus"

resources {
requests {
memory = "${var.prometheus_memory_request}"
cpu = "${var.prometheus_cpu_request}"
}

limits {
memory = "${var.prometheus_memory_limit}"
cpu = "${var.prometheus_cpu_limit}"
}
}

port {
container_port = "${var.prometheus-port}"
}
Expand Down

0 comments on commit 5cc912b

Please sign in to comment.