aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhantwal <anamika.khantwal@accenture.com>2025-01-31 11:33:50 +0530
committerKhantwal <anamika.khantwal@accenture.com>2025-01-31 11:33:50 +0530
commita976b00d75d1210805fcebfff55c09a141be5244 (patch)
treed2f878e60913af8aab634db3228a3d93fc1ce261
parent8009e77c8cdc3e33a7063df176eb9d0f0b805014 (diff)
Integrate Scalability Changes in SDC for Community Contribution
- Add scalability changes to SDC components Issue-ID: SDC-4712 Change-Id: I3bf59b7cde36ce19a884552fdb9cf0ce10f5c327 Signed-off-by: Anamika Khantwal <anamika.khantwal@accenture.com>
-rw-r--r--kubernetes/sdc/components/sdc-be/templates/autoscaling.yaml32
-rw-r--r--kubernetes/sdc/components/sdc-be/templates/deployment.yaml10
-rw-r--r--kubernetes/sdc/components/sdc-be/values.yaml18
3 files changed, 59 insertions, 1 deletions
diff --git a/kubernetes/sdc/components/sdc-be/templates/autoscaling.yaml b/kubernetes/sdc/components/sdc-be/templates/autoscaling.yaml
new file mode 100644
index 0000000000..b7f265319b
--- /dev/null
+++ b/kubernetes/sdc/components/sdc-be/templates/autoscaling.yaml
@@ -0,0 +1,32 @@
+{{- if .Values.autoscaling.enabled }}
+apiVersion: autoscaling/v2
+kind: HorizontalPodAutoscaler
+metadata:
+ name: {{ include "common.fullname" . }}
+ namespace: {{ include "common.namespace" . }}
+ labels: {{- include "common.labels" . | nindent 4 }}
+spec:
+ scaleTargetRef:
+ apiVersion: apps/v1
+ kind: Deployment
+ name: {{ include "common.fullname" . }}
+ minReplicas: {{ .Values.autoscaling.minReplicas }}
+ maxReplicas: {{ .Values.autoscaling.maxReplicas }}
+ metrics:
+ {{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
+ - type: Resource
+ resource:
+ name: cpu
+ target:
+ type: Utilization
+ averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
+ {{- end }}
+ {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
+ - type: Resource
+ resource:
+ name: memory
+ target:
+ type: Utilization
+ averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
+ {{- end }}
+{{- end }}
diff --git a/kubernetes/sdc/components/sdc-be/templates/deployment.yaml b/kubernetes/sdc/components/sdc-be/templates/deployment.yaml
index f55f723f78..7854175623 100644
--- a/kubernetes/sdc/components/sdc-be/templates/deployment.yaml
+++ b/kubernetes/sdc/components/sdc-be/templates/deployment.yaml
@@ -20,7 +20,16 @@ kind: Deployment
metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
spec:
selector: {{- include "common.selectors" . | nindent 4 }}
+ {{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
+ {{- end }}
+ revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
+ minReadySeconds: {{ .Values.minReadySeconds }}
+ strategy:
+ type: {{ .Values.updateStrategy.type }}
+ rollingUpdate:
+ maxUnavailable: {{ .Values.updateStrategy.maxUnavailable }}
+ maxSurge: {{ .Values.updateStrategy.maxSurge }}
template:
metadata: {{- include "common.templateMetadata" . | nindent 6 }}
spec:
@@ -213,4 +222,3 @@ spec:
name: {{ include "common.release" . }}-sdc-be-ready-probe-configmap
defaultMode: 0755
{{- include "common.imagePullSecrets" . | nindent 6 }}
-
diff --git a/kubernetes/sdc/components/sdc-be/values.yaml b/kubernetes/sdc/components/sdc-be/values.yaml
index 7d41915102..3f82c98c98 100644
--- a/kubernetes/sdc/components/sdc-be/values.yaml
+++ b/kubernetes/sdc/components/sdc-be/values.yaml
@@ -296,4 +296,22 @@ be:
caCert: ""
truststorePath: ""
truststorePassword: ""
+
+autoscaling:
+ enabled: true
+ minReplicas: 1
+ maxReplicas: 3
+ targetCPUUtilizationPercentage: 75
+
+# number of ReplicaSets that should be retained for the Deployment
+revisionHistoryLimit: 1
+
+# the minimum number of seconds that a newly created Pod should be ready
+minReadySeconds: 30
+updateStrategy:
+ type: RollingUpdate
+ # The number of pods that can be unavailable during the update process
+ maxUnavailable: 0
+ # The number of pods that can be created above the desired amount of pods during an update
+ maxSurge: 1
#END