Skip to content

Commit

Permalink
Merge pull request #1448 from arooshap/modify_deploy.sh
Browse files Browse the repository at this point in the history
Increasing the resources for Production MongoDB.
  • Loading branch information
arooshap authored Jan 31, 2024
2 parents 3019f11 + 0d77c08 commit 468ee85
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 36 deletions.
4 changes: 2 additions & 2 deletions helm/mongodb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: mongodb
description: A Helm chart for launching a MongoDB ReplicaSet with 3 instances
type: application
version: 1.0.8
appVersion: 1.0.8
version: 1.0.9
appVersion: 1.0.9
79 changes: 54 additions & 25 deletions helm/mongodb/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,27 @@ spec:
- image: {{.Values.quickSetting.image.mongodb}}
name: {{.Values.db.instance0.podName}}
imagePullPolicy: Always
{{- if (eq (toString $environment) "prod") }}
resources:
requests:
ephemeral-storage: {{.Values.db.pod.prod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.prod.resources.requests.cpu}}
memory: {{.Values.db.pod.prod.resources.requests.memory}}
limits:
ephemeral-storage: {{.Values.db.pod.prod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.prod.resources.requests.cpu}}
memory: {{.Values.db.pod.prod.resources.limits.memory}}
{{- else }}
resources:
requests:
ephemeral-storage: {{.Values.db.pod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.resources.requests.cpu}}
memory: {{.Values.db.pod.resources.requests.memory}}
ephemeral-storage: {{.Values.db.pod.preprod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.preprod.resources.requests.cpu}}
memory: {{.Values.db.pod.preprod.resources.requests.memory}}
limits:
ephemeral-storage: {{.Values.db.pod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.resources.requests.cpu}}
memory: {{.Values.db.pod.resources.limits.memory}}
ephemeral-storage: {{.Values.db.pod.preprod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.preprod.resources.requests.cpu}}
memory: {{.Values.db.pod.preprod.resources.limits.memory}}
{{- end }}
env:
- name: "ENVIRONMENT"
value: {{ (toString $environment) }}
Expand Down Expand Up @@ -183,22 +195,27 @@ spec:
- image: {{.Values.quickSetting.image.mongodb}}
name: {{.Values.db.instance1.podName}}
imagePullPolicy: Always
{{- if (eq (toString $environment) "prod") }}
resources:
requests:
ephemeral-storage: {{.Values.db.pod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.resources.requests.cpu}}
memory: {{.Values.db.pod.resources.requests.memory}}
ephemeral-storage: {{.Values.db.pod.prod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.prod.resources.requests.cpu}}
memory: {{.Values.db.pod.prod.resources.requests.memory}}
limits:
ephemeral-storage: {{.Values.db.pod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.resources.requests.cpu}}
memory: {{.Values.db.pod.resources.limits.memory}}
env:
- name: "ENVIRONMENT"
value: {{ (toString $environment) }}
- name: "RS_NAME"
value: {{.Values.db.rsname}}
- name: "MONGODB_ID"
value: {{.Values.db.instance1.mongoId | quote}}
ephemeral-storage: {{.Values.db.pod.prod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.prod.resources.requests.cpu}}
memory: {{.Values.db.pod.prod.resources.limits.memory}}
{{- else }}
resources:
requests:
ephemeral-storage: {{.Values.db.pod.preprod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.preprod.resources.requests.cpu}}
memory: {{.Values.db.pod.preprod.resources.requests.memory}}
limits:
ephemeral-storage: {{.Values.db.pod.preprod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.preprod.resources.requests.cpu}}
memory: {{.Values.db.pod.preprod.resources.limits.memory}}
{{- end }}
livenessProbe:
exec:
command:
Expand Down Expand Up @@ -282,15 +299,27 @@ spec:
- image: {{.Values.quickSetting.image.mongodb}}
name: {{.Values.db.instance2.podName}}
imagePullPolicy: Always
{{- if (eq (toString $environment) "prod") }}
resources:
requests:
ephemeral-storage: {{.Values.db.pod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.resources.requests.cpu}}
memory: {{.Values.db.pod.resources.requests.memory}}
ephemeral-storage: {{.Values.db.pod.prod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.prod.resources.requests.cpu}}
memory: {{.Values.db.pod.prod.resources.requests.memory}}
limits:
ephemeral-storage: {{.Values.db.pod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.resources.requests.cpu}}
memory: {{.Values.db.pod.resources.limits.memory}}
ephemeral-storage: {{.Values.db.pod.prod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.prod.resources.requests.cpu}}
memory: {{.Values.db.pod.prod.resources.limits.memory}}
{{- else }}
resources:
requests:
ephemeral-storage: {{.Values.db.pod.preprod.resources.requests.ephemeralStorage}}
cpu: {{.Values.db.pod.preprod.resources.requests.cpu}}
memory: {{.Values.db.pod.preprod.resources.requests.memory}}
limits:
ephemeral-storage: {{.Values.db.pod.preprod.resources.limits.ephemeralStorage}}
cpu: {{.Values.db.pod.preprod.resources.requests.cpu}}
memory: {{.Values.db.pod.preprod.resources.limits.memory}}
{{- end }}
env:
- name: "ENVIRONMENT"
value: {{ (toString $environment) }}
Expand Down
29 changes: 20 additions & 9 deletions helm/mongodb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,26 @@ db:
service:
port: 27017
pod:
resources:
requests:
ephemeralStorage: "1Gi"
cpu: "100m"
memory: "1Gi"
limits:
ephemeralStorage: "2Gi"
cpu: "200m"
memory: "2Gi"
prod:
resources:
requests:
ephemeralStorage: "1Gi"
cpu: "1000m"
memory: "3Gi"
limits:
ephemeralStorage: "2Gi"
cpu: "3000m"
memory: "8Gi"
preprod:
resources:
requests:
ephemeralStorage: "1Gi"
cpu: "100m"
memory: "1Gi"
limits:
ephemeralStorage: "2Gi"
cpu: "200m"
memory: "2Gi"
probes:
livenessProbe:
initialDelaySeconds: 90
Expand Down

0 comments on commit 468ee85

Please sign in to comment.