From 77c848a8b4fcfd1e6ffeed4b177eedca36d3207e Mon Sep 17 00:00:00 2001 From: Sylvain Desbureaux Date: Wed, 23 Sep 2020 14:21:30 +0200 Subject: [COMMON] Add limits to cassandra statefulsets. Having limits is important in order to have safe deployment. cassandra didn't had one so let's add them. Issue-ID: OOM-2230 Signed-off-by: Sylvain Desbureaux Change-Id: Id3fef8c351f1be977eab49abd111304b9edd9151 --- kubernetes/common/cassandra/templates/statefulset.yaml | 9 +++------ kubernetes/common/cassandra/values.yaml | 16 ++++++++-------- 2 files changed, 11 insertions(+), 14 deletions(-) (limited to 'kubernetes/common/cassandra') diff --git a/kubernetes/common/cassandra/templates/statefulset.yaml b/kubernetes/common/cassandra/templates/statefulset.yaml index 2bcafd9ade..8c49b697e6 100644 --- a/kubernetes/common/cassandra/templates/statefulset.yaml +++ b/kubernetes/common/cassandra/templates/statefulset.yaml @@ -112,15 +112,12 @@ spec: {{- else }} command: ["/bin/sh", "-c", "PID=$(pidof java) && kill $PID && while ps -p $PID > /dev/null; do sleep 1; done"] {{- end }} - resources: -{{ toYaml .Values.resources | indent 10 }} + resources: {{ toYaml .Values.resources | nindent 10 }} {{- if .Values.nodeSelector }} - nodeSelector: -{{ toYaml .Values.nodeSelector | indent 8 }} + nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} {{- end -}} {{- if .Values.affinity }} - affinity: -{{ toYaml .Values.affinity | indent 8 }} + affinity: {{ toYaml .Values.affinity | nindent 8 }} {{- end }} volumes: - name: localtime diff --git a/kubernetes/common/cassandra/values.yaml b/kubernetes/common/cassandra/values.yaml index 959e243638..d0ada59061 100644 --- a/kubernetes/common/cassandra/values.yaml +++ b/kubernetes/common/cassandra/values.yaml @@ -131,7 +131,7 @@ persistence: configOverrides: {} -resources: {} +# resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little # resources, such as Minikube. If you do want to specify resources, uncomment the following @@ -142,13 +142,13 @@ resources: {} # ref: http://kubernetes.io/docs/user-guide/compute-resources/ # Minimum memory for development is 2 CPU cores and 4GB memory # Minimum memory for production is 4 CPU cores and 8GB memory -#resources: -# limits: -# cpu: 2 -# memory: 4Gi -# requests: -# cpu: 2 -# memory: 4Gi +resources: + limits: + cpu: 0.8 + memory: 4Gi + requests: + cpu: 0.2 + memory: 2.5Gi backup: enabled: false cron: "00 00 * * *" -- cgit 1.2.3-korg