From 4b2a50036db72eb89841406f8ab9331bcc1b2417 Mon Sep 17 00:00:00 2001 From: MarkusNeuron <112179986+MarkusNeuron@users.noreply.github.com> Date: Thu, 21 Sep 2023 10:32:12 +0200 Subject: [PATCH 1/5] add resources templating option --- helm/kaap/templates/operator.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helm/kaap/templates/operator.yaml b/helm/kaap/templates/operator.yaml index 8b2ba748..5e5ff158 100644 --- a/helm/kaap/templates/operator.yaml +++ b/helm/kaap/templates/operator.yaml @@ -59,6 +59,10 @@ spec: name: {{ include "kaap.name" . }} image: {{ .Values.operator.image }} imagePullPolicy: {{ .Values.operator.imagePullPolicy }} + {{- if .Values.operator.resources }} + resources: + {{- toYaml .Values.operator.resources | nindent 12 }} + {{- end }} livenessProbe: failureThreshold: {{ .Values.operator.livenessProbe.failureThreshold }} httpGet: @@ -85,4 +89,4 @@ spec: successThreshold: {{ .Values.operator.readinessProbe.successThreshold }} timeoutSeconds: {{ .Values.operator.readinessProbe.timeoutSeconds }} serviceAccountName: {{ include "kaap.serviceAccountName" . }} -{{- end }} \ No newline at end of file +{{- end }} From 88c57e93601ccafee837e858c4231b308ecda3da Mon Sep 17 00:00:00 2001 From: MarkusNeuron <112179986+MarkusNeuron@users.noreply.github.com> Date: Thu, 21 Sep 2023 10:38:30 +0200 Subject: [PATCH 2/5] Add resources to values --- helm/kaap/values.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/helm/kaap/values.yaml b/helm/kaap/values.yaml index b141e6cb..a6c930d4 100644 --- a/helm/kaap/values.yaml +++ b/helm/kaap/values.yaml @@ -39,7 +39,9 @@ operator: enabled: true image: datastax/kaap:0.2.0 imagePullPolicy: IfNotPresent + resources: {} replicas: 1 + livenessProbe: failureThreshold: 3 periodSeconds: 30 @@ -68,4 +70,4 @@ cluster: name: pulsar image: datastax/lunastreaming-all:2.10_3.1 storage: - existingStorageClassName: default \ No newline at end of file + existingStorageClassName: default From 764855f67f065c378121b101c1381ad50d453545 Mon Sep 17 00:00:00 2001 From: MarkusNeuron <112179986+MarkusNeuron@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:28:53 +0200 Subject: [PATCH 3/5] Add new template variable operator.resources to test --- .../test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java b/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java index 74e1cbf6..4cd21f63 100644 --- a/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java +++ b/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java @@ -220,6 +220,7 @@ private String simulateHelmRendering(List allRbac) { vars.put(".Values.operator.replicas", "1"); vars.put(".Values.operator.image", OPERATOR_IMAGE); vars.put(".Values.operator.imagePullPolicy", "Never"); + vars.put(".Values.operator.resources.requests.cpu", "100m"); vars.put(".Values.operator.livenessProbe.failureThreshold", "3"); vars.put(".Values.operator.livenessProbe.initialDelaySeconds", "0"); vars.put(".Values.operator.livenessProbe.periodSeconds", "30"); From e126d2f52acab2631f987a19b85fe494d2e3bff8 Mon Sep 17 00:00:00 2001 From: MarkusNeuron <112179986+MarkusNeuron@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:29:15 +0200 Subject: [PATCH 4/5] Add new template variable operator.resources to test --- .../test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java b/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java index 74e1cbf6..4cd21f63 100644 --- a/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java +++ b/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java @@ -220,6 +220,7 @@ private String simulateHelmRendering(List allRbac) { vars.put(".Values.operator.replicas", "1"); vars.put(".Values.operator.image", OPERATOR_IMAGE); vars.put(".Values.operator.imagePullPolicy", "Never"); + vars.put(".Values.operator.resources.requests.cpu", "100m"); vars.put(".Values.operator.livenessProbe.failureThreshold", "3"); vars.put(".Values.operator.livenessProbe.initialDelaySeconds", "0"); vars.put(".Values.operator.livenessProbe.periodSeconds", "30"); From 8e770ebaec1acda56bc7a5449539515fc4b68a06 Mon Sep 17 00:00:00 2001 From: MarkusNeuron <112179986+MarkusNeuron@users.noreply.github.com> Date: Thu, 12 Oct 2023 12:45:32 +0200 Subject: [PATCH 5/5] Remove requests and changed to empty resource key --- .../test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java b/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java index 4cd21f63..de14498b 100644 --- a/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java +++ b/tests/src/test/java/com/datastax/oss/kaap/tests/BaseK8sEnvTest.java @@ -220,7 +220,7 @@ private String simulateHelmRendering(List allRbac) { vars.put(".Values.operator.replicas", "1"); vars.put(".Values.operator.image", OPERATOR_IMAGE); vars.put(".Values.operator.imagePullPolicy", "Never"); - vars.put(".Values.operator.resources.requests.cpu", "100m"); + vars.put(".Values.operator.resources.requests", "{}"); vars.put(".Values.operator.livenessProbe.failureThreshold", "3"); vars.put(".Values.operator.livenessProbe.initialDelaySeconds", "0"); vars.put(".Values.operator.livenessProbe.periodSeconds", "30");