From 74a8384b20810d6060f82356a12a15e983f2584c Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Mon, 2 Aug 2021 15:29:56 -0400 Subject: [PATCH 01/12] add resource template for twistlock --- chart/templates/console/_common.tpl | 0 chart/templates/console/deployment.yaml | 1 + 2 files changed, 1 insertion(+) create mode 100644 chart/templates/console/_common.tpl diff --git a/chart/templates/console/_common.tpl b/chart/templates/console/_common.tpl new file mode 100644 index 0000000..e69de29 diff --git a/chart/templates/console/deployment.yaml b/chart/templates/console/deployment.yaml index 0df696b..ed7485d 100644 --- a/chart/templates/console/deployment.yaml +++ b/chart/templates/console/deployment.yaml @@ -87,3 +87,4 @@ spec: - name: syslog-socket hostPath: path: "/dev/log" +{{- include "twistlock.resources" .Values.resources | indent 10 }} -- GitLab From 50510534a780aa60fe5af7ee8792714f5bd51c69 Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Mon, 2 Aug 2021 18:18:03 -0400 Subject: [PATCH 02/12] add resource and limit --- chart/templates/_common.tpl | 27 +++++++++++++++++++++++++ chart/templates/console/_common.tpl | 0 chart/templates/console/deployment.yaml | 4 +++- chart/values.yaml | 12 +++++------ 4 files changed, 36 insertions(+), 7 deletions(-) create mode 100644 chart/templates/_common.tpl delete mode 100644 chart/templates/console/_common.tpl diff --git a/chart/templates/_common.tpl b/chart/templates/_common.tpl new file mode 100644 index 0000000..0c1c0db --- /dev/null +++ b/chart/templates/_common.tpl @@ -0,0 +1,27 @@ +{{/* + twistlock.resources accepts a resource stanza as its scope and returns + resource configuration if any of the values are set. +*/}} +{{- define "twistlock.resources" -}} +{{- if . }} +resources: + {{- if .requests }} + requests: + {{- if .requests.cpu }} + cpu: {{ .requests.cpu | quote }} + {{- end }} + {{- if .requests.memory }} + memory: {{ .requests.memory | quote }} + {{- end }} + {{- end }} + {{- if .limits }} + limits: + {{- if .limits.cpu }} + cpu: {{ .limits.cpu | quote }} + {{- end }} + {{- if .limits.memory }} + memory: {{ .limits.memory | quote }} + {{- end }} + {{- end }} +{{- end }} +{{- end }} diff --git a/chart/templates/console/_common.tpl b/chart/templates/console/_common.tpl deleted file mode 100644 index e69de29..0000000 diff --git a/chart/templates/console/deployment.yaml b/chart/templates/console/deployment.yaml index ed7485d..26d18de 100644 --- a/chart/templates/console/deployment.yaml +++ b/chart/templates/console/deployment.yaml @@ -40,6 +40,8 @@ spec: containers: - name: twistlock-console image: {{ .Values.console.image.repository }}:{{ .Values.console.image.tag }} + resources: +{{ toYaml .Values.resources | indent 12 }} ports: - name: mgmt-https containerPort: 8083 @@ -87,4 +89,4 @@ spec: - name: syslog-socket hostPath: path: "/dev/log" -{{- include "twistlock.resources" .Values.resources | indent 10 }} + diff --git a/chart/values.yaml b/chart/values.yaml index 23bad32..3a7b667 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -63,11 +63,11 @@ tolerations: # effect: "NoSchedule" resources: - limits: {} - # memory: 256Mi - # cpu: 100m - requests: {} - # memory: 256Mi - # cpu: 100m + limits: + memory: 256Mi + cpu: 100m + requests: + memory: 256Mi + cpu: 100m openshift: false -- GitLab From b8f9e4c54010e0d29398e6dd8122cb27ef510bd6 Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Mon, 2 Aug 2021 19:19:45 -0400 Subject: [PATCH 03/12] add resource and limit --- chart/templates/_common.tpl | 27 --------------------------- chart/values.yaml | 4 ++-- 2 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 chart/templates/_common.tpl diff --git a/chart/templates/_common.tpl b/chart/templates/_common.tpl deleted file mode 100644 index 0c1c0db..0000000 --- a/chart/templates/_common.tpl +++ /dev/null @@ -1,27 +0,0 @@ -{{/* - twistlock.resources accepts a resource stanza as its scope and returns - resource configuration if any of the values are set. -*/}} -{{- define "twistlock.resources" -}} -{{- if . }} -resources: - {{- if .requests }} - requests: - {{- if .requests.cpu }} - cpu: {{ .requests.cpu | quote }} - {{- end }} - {{- if .requests.memory }} - memory: {{ .requests.memory | quote }} - {{- end }} - {{- end }} - {{- if .limits }} - limits: - {{- if .limits.cpu }} - cpu: {{ .limits.cpu | quote }} - {{- end }} - {{- if .limits.memory }} - memory: {{ .limits.memory | quote }} - {{- end }} - {{- end }} -{{- end }} -{{- end }} diff --git a/chart/values.yaml b/chart/values.yaml index 3a7b667..803afc5 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -64,10 +64,10 @@ tolerations: resources: limits: - memory: 256Mi + memory: 512Mi cpu: 100m requests: - memory: 256Mi + memory: 512Mi cpu: 100m openshift: false -- GitLab From 49417303f283c6410bf2cdca8ac2bb741bdf7d12 Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Tue, 3 Aug 2021 09:08:43 -0400 Subject: [PATCH 04/12] add changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eef171e..80f87e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). --- +## [0.0.6-bb.2] - 2021-08-03 + +### Added + +- Add Resource limit and request. + ## [0.0.6-bb.1] - 2021-07-21 ### Added -- GitLab From db8fbf1411b5f83b5f299fefbf6a15adfe5f10e6 Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Tue, 3 Aug 2021 11:28:05 -0400 Subject: [PATCH 05/12] fix duplicate issues --- chart/templates/console/deployment.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chart/templates/console/deployment.yaml b/chart/templates/console/deployment.yaml index 26d18de..ef48809 100644 --- a/chart/templates/console/deployment.yaml +++ b/chart/templates/console/deployment.yaml @@ -49,8 +49,7 @@ spec: containerPort: 8084 - name: mgmt-http containerPort: 8081 - resources: - {{ toYaml .Values.resources | nindent 10 }} + env: - name: HIGH_AVAILABILITY_ENABLED value: "false" -- GitLab From 3e3ac8918beca337b33688591d63c69b52f6df65 Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Thu, 5 Aug 2021 13:36:49 +0000 Subject: [PATCH 06/12] Update deployment.yaml --- chart/templates/console/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/templates/console/deployment.yaml b/chart/templates/console/deployment.yaml index ef48809..40890d6 100644 --- a/chart/templates/console/deployment.yaml +++ b/chart/templates/console/deployment.yaml @@ -41,7 +41,7 @@ spec: - name: twistlock-console image: {{ .Values.console.image.repository }}:{{ .Values.console.image.tag }} resources: -{{ toYaml .Values.resources | indent 12 }} + {{ toYaml .Values.resources | nindent 10 }} ports: - name: mgmt-https containerPort: 8083 -- GitLab From 9c5b1e2f3cca03cdb414a0cff0fcb785a638a876 Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Thu, 5 Aug 2021 14:19:35 +0000 Subject: [PATCH 07/12] Update values.yaml --- chart/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/values.yaml b/chart/values.yaml index 803afc5..dba39f4 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -65,9 +65,9 @@ tolerations: resources: limits: memory: 512Mi - cpu: 100m + cpu: 250m requests: memory: 512Mi - cpu: 100m + cpu: 250m openshift: false -- GitLab From 2f090de7b4736ce744f73bc2ca0eb0a79497dbcc Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Thu, 5 Aug 2021 14:21:28 +0000 Subject: [PATCH 08/12] Update Chart.yaml --- chart/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/Chart.yaml b/chart/Chart.yaml index a6616c5..9f112b0 100644 --- a/chart/Chart.yaml +++ b/chart/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: twistlock -version: 0.0.6-bb.1 +version: 0.0.6-bb.2 appVersion: 21.04.412 dependencies: - name: gluon -- GitLab From 42b6b76ee864bae721fa33586b8d68d30ac79a5f Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Fri, 6 Aug 2021 17:45:40 +0000 Subject: [PATCH 09/12] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80f87e0..8d10b2a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). --- -## [0.0.6-bb.2] - 2021-08-03 +## [0.0.6-bb.2] - 2021-08-06 ### Added -- GitLab From f848b87457e8a6ea9d8bfdef78c3282d90e13ac4 Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Fri, 6 Aug 2021 19:26:19 +0000 Subject: [PATCH 10/12] Update values.yaml --- chart/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/values.yaml b/chart/values.yaml index dba39f4..4d7b1df 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -64,10 +64,10 @@ tolerations: resources: limits: - memory: 512Mi + memory: 1Gi cpu: 250m requests: - memory: 512Mi + memory: 1Gi cpu: 250m openshift: false -- GitLab From be4727199b33894adfb6f51d586d8214d38d8b29 Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Fri, 6 Aug 2021 19:44:02 +0000 Subject: [PATCH 11/12] Update values.yaml --- chart/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart/values.yaml b/chart/values.yaml index 4d7b1df..a9ba446 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -64,7 +64,7 @@ tolerations: resources: limits: - memory: 1Gi + memory: 512Mi cpu: 250m requests: memory: 1Gi -- GitLab From 4b6afe1ee0630d76842bd294ccce33ff2c3a33af Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Fri, 6 Aug 2021 20:21:40 +0000 Subject: [PATCH 12/12] Update values.yaml --- chart/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chart/values.yaml b/chart/values.yaml index a9ba446..2854551 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -64,10 +64,10 @@ tolerations: resources: limits: - memory: 512Mi + memory: 1Gi cpu: 250m requests: - memory: 1Gi + memory: 512Mi cpu: 250m openshift: false -- GitLab