Skip to content

Commit

Permalink
increase k8s memory limit to 120% memory request to prevent k8s from …
Browse files Browse the repository at this point in the history
…killing container (#80)

* disable k8s memory limits

* increase memory limit to 120%

* update changelog

Co-authored-by: Raj Poluri <[email protected]>
  • Loading branch information
rpoluri and Raj Poluri authored Jan 27, 2021
1 parent 9883770 commit 6b110cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [3.2.2] - 2021-01-27
### Changed
- Update k8s memory limit to 120% memory request to prevent k8s from killing waggle-dance containers.

## [3.2.1] - 2021-01-27
### Changed
- Update terraform required version to include 0.13.x.
Expand Down
5 changes: 3 additions & 2 deletions k8s.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
*/

locals {
heapsize = ceil((var.memory * 85) / 100)
heapsize = ceil((var.memory * 85) / 100)
memory_limit = ceil((var.memory * 120) / 100)
}
resource "kubernetes_deployment" "waggle_dance" {
count = var.wd_instance_type == "k8s" ? 1 : 0
Expand Down Expand Up @@ -55,7 +56,7 @@ resource "kubernetes_deployment" "waggle_dance" {
}
resources {
limits {
memory = "${var.memory}Mi"
memory = "${local.memory_limit}Mi"
}
requests {
memory = "${var.memory}Mi"
Expand Down

0 comments on commit 6b110cc

Please sign in to comment.