Skip to content

Commit

Permalink
Add default resource requirements for init-containers
Browse files Browse the repository at this point in the history
  • Loading branch information
irajdeep committed Dec 29, 2023
1 parent 7746194 commit 8dbe40f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ spec:
requests:
cpu: "0.2"
memory: 200M
initContainers:
- name: mongodb-agent-readinessprobe
resources:
limits:
cpu: "2"
memory: 200M
requests:
cpu: "1"
memory: 100M
# the user credentials will be generated from this secret
# once the credentials are generated, this secret is no longer required
---
Expand Down
2 changes: 2 additions & 0 deletions controllers/construct/mongodbstatefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ func versionUpgradeHookInit(volumeMount []corev1.VolumeMount) container.Modifica
container.WithName(versionUpgradeHookName),
container.WithCommand([]string{"cp", "version-upgrade-hook", "/hooks/version-upgrade"}),
container.WithImage(os.Getenv(VersionUpgradeHookImageEnv)),
container.WithResourceRequirements(resourcerequirements.Defaults()),
container.WithImagePullPolicy(corev1.PullAlways),
container.WithVolumeMounts(volumeMount),
containerSecurityContext,
Expand Down Expand Up @@ -324,6 +325,7 @@ func readinessProbeInit(volumeMount []corev1.VolumeMount) container.Modification
container.WithImage(os.Getenv(ReadinessProbeImageEnv)),
container.WithImagePullPolicy(corev1.PullAlways),
container.WithVolumeMounts(volumeMount),
container.WithResourceRequirements(resourcerequirements.Defaults()),
containerSecurityContext,
)
}
Expand Down

0 comments on commit 8dbe40f

Please sign in to comment.