-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Add support for specifying imagePullPolicy for initContainers in MongoDB ReplicaSet CRD #1626
Comments
Could you please advise if there's any known workaround to set the imagePullPolicy for initContainers when using the current CRD? We've attempted to manually patch the StatefulSet, but the MongoDB operator reverts the patch. If there’s any configuration we may have missed, or an interim approach before the feature can be implemented, that would be greatly appreciated. |
Would love to see that done. Facing the same issue |
You should be able to patch the InitContainers of the ReplicaSet via the wrapper, have you tried something similar like: apiVersion: mongodbcommunity.mongodb.com/v1
kind: MongoDBCommunity
metadata:
name: example-mongodb
spec:
members: 3
type: ReplicaSet
version: "6.0.5"
statefulSet:
spec:
template:
spec:
initContainers:
- name: mongod-posthook
imagePullPolicy: Never |
Hello @mahesh-kore |
@robinlieb @lucian-tosa Thanks for the workaround! I’ll give it a try and let you know if any issues come up |
I tried the override as recommended above, and it's working as expected. Thank you @robinlieb @lucian-tosa ! |
This issue is being marked stale because it has been open for 60 days with no activity. Please comment if this issue is still affecting you. If there is no change, this issue will be closed in 30 days. |
We are using the MongoDB Kubernetes Operator (version: 0.11.0) to deploy a MongoDB replica set. However, we have encountered an issue where it is not possible to specify the imagePullPolicy for initContainers via the current Custom Resource Definition (CRD) of mongodbcommunity.mongodb.com/v1.
When we manually patch the StatefulSet to set the imagePullPolicy for initContainers, the MongoDB operator reverts the changes. This behavior makes it difficult to ensure that the correct image pull policy is applied in our air-gapped environment where image downloads are restricted, and we rely on local copies.
Expected Behavior:
The MongoDB operator should allow users to specify imagePullPolicy for initContainers directly within the CRD definition, similar to how it's supported for main containers.
Actual Behavior:
There is currently no option to set imagePullPolicy for initContainers in the CRD. Manually patching the StatefulSet to set imagePullPolicy is reverted by the operator.
Use Case:
We are working in an air-gapped environment where images need to be pulled from local storage. Without the ability to configure imagePullPolicy for initContainers, the operator attempts to pull the image from an external source, leading to failed deployments.
Steps to Reproduce:
Deploy MongoDB replica set using the MongoDB Kubernetes Operator.
Attempt to patch the StatefulSet to set imagePullPolicy for initContainers.
Observe that the patch is reverted by the MongoDB operator.
Proposed Solution:
Add support for specifying imagePullPolicy for initContainers in the MongoDB replica set CRD.
Additional Context:
This feature would help users in air-gapped environments to ensure that local images are used for init containers, improving reliability in such setups.
Thank you!
The text was updated successfully, but these errors were encountered: