From c23aa42a3c3f7c864544be41837f8601d264f1a5 Mon Sep 17 00:00:00 2001 From: Sylvain Desbureaux Date: Mon, 15 Feb 2021 15:28:19 +0100 Subject: [PORTAL] Fix Heap config generation When tried to apply heap configuration for small flavors, weird side effects have appeared. This patch solves them by doing a more generic way of configuring heap variables for cassandra. Issue-ID: PORTAL-1037 Signed-off-by: Sylvain Desbureaux Change-Id: Iebe2edd5281213580d9e1d4d86f9ca0b2abd2601 --- .../portal-cassandra/templates/deployment.yaml | 10 +++++++--- .../portal/components/portal-cassandra/values.yaml | 20 ++++++++++++-------- 2 files changed, 19 insertions(+), 11 deletions(-) (limited to 'kubernetes/portal/components/portal-cassandra') diff --git a/kubernetes/portal/components/portal-cassandra/templates/deployment.yaml b/kubernetes/portal/components/portal-cassandra/templates/deployment.yaml index 39cd0294c8..20c396fa42 100644 --- a/kubernetes/portal/components/portal-cassandra/templates/deployment.yaml +++ b/kubernetes/portal/components/portal-cassandra/templates/deployment.yaml @@ -108,11 +108,15 @@ spec: value: rack1 - name: CASSANDRA_ENABLE_RPC value: "true" - {{- if eq "small" .Values.flavor }} + {{- $flavor := include "common.flavor" . }} + {{- $heap := pluck $flavor .Values.heap | first }} + {{- if (hasKey $heap "max") }} - name: MAX_HEAP_SIZE - value: {{ .Values.resources.small.heap.max }} + value: {{ $heap.max }} + {{- end }} + {{- if (hasKey $heap "new") }} - name: HEAP_NEWSIZE - value: {{ .Values.resources.small.heap.new }} + value: {{ $heap.new }} {{- end }} volumeMounts: - mountPath: /etc/localtime diff --git a/kubernetes/portal/components/portal-cassandra/values.yaml b/kubernetes/portal/components/portal-cassandra/values.yaml index c185155f09..b06761a870 100644 --- a/kubernetes/portal/components/portal-cassandra/values.yaml +++ b/kubernetes/portal/components/portal-cassandra/values.yaml @@ -112,14 +112,6 @@ flavor: small # Segregation for Different environment (Small and Large) resources: small: - # Heap size is tightly correlated to RAM limits. - # If limit > 8G, Cassandra should define itself the best value. - # If not, you must set up it in a coherent way with limits set - # Refer to https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/operations/opsTuneJVM.html#Determiningtheheapsize - # for more informations. - heap: - max: 3G - new: 100M limits: cpu: 500m memory: 3.75Gi @@ -134,3 +126,15 @@ resources: cpu: 2 memory: 6Gi unlimited: {} + +heap: + # Heap size is tightly correlated to RAM limits. + # If limit > 8G, Cassandra should define itself the best value. + # If not, you must set up it in a coherent way with limits set + # Refer to https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/operations/opsTuneJVM.html#Determiningtheheapsize + # for more informations. + small: + max: 3G + new: 100M + large: {} + unlimited: {} \ No newline at end of file -- cgit 1.2.3-korg