Skip to content

Commit

Permalink
Merge pull request #9 from sailthru/statsd-resource-limits
Browse files Browse the repository at this point in the history
Set resource requests/limits for statsd sidecar
  • Loading branch information
dylannz-sailthru authored Jun 16, 2020
2 parents 22108fd + c195fb5 commit bd7fbe6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
12 changes: 12 additions & 0 deletions daemonset.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ resource "kubernetes_daemonset" "this" {
"-statsd.mapping-config=/statsd-exporter/mapping-config.yaml",
]

resources {
requests {
memory = var.resources_statsd_requests_memory
cpu = var.resources_statsd_requests_cpu
}

limits {
memory = var.resources_statsd_limits_memory
cpu = var.resources_statsd_limits_cpu
}
}

port {
container_port = 9102
name = "metrics"
Expand Down
20 changes: 20 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,26 @@ variable "resources_limits_memory" {
default = "1Gi"
}

variable "resources_statsd_requests_cpu" {
description = "CPU requests for statsd sidecar container"
default = "50m"
}

variable "resources_statsd_requests_memory" {
description = "memory requests for statsd sidecar container"
default = "100Mi"
}

variable "resources_statsd_limits_cpu" {
description = "CPU limit for statsd sidecar container"
default = "50m"
}

variable "resources_statsd_limits_memory" {
description = "memory limit for statsd sidecar container"
default = "100Mi"
}

variable "rbac_create" {
default = true
description = "If true, create and use RBAC resources"
Expand Down

0 comments on commit bd7fbe6

Please sign in to comment.