-
Notifications
You must be signed in to change notification settings - Fork 107
feat: add mfe-k8s-volume-mounts patch #267
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
changelog.d/20250901_141842_andres.giraldo_volume_mounts_patch.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - [Feature] Add `mfe-k8s-volume-mounts` patch to mount volumes in the MFE Kubernetes Deployment, complementing `mfe-k8s-volumes`. (by @andres.giraldo) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can mfe-k8s-volume-mounts and mfe-k8s-volumes be merged in a single patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DawoudSheraz, thanks for your quick review!
I don’t think it’s really possible to unify them, since the
volumesandvolumeMountsblocks live in different parts of the Deployment spec. Each patch hook only injects into a single position, so combining them wouldn’t work. Also, they cover two different concerns, so keeping them separate helps maintain a clear separation of responsibilities.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. If you look at deployments.yml template in tutor, it has a k8s-deployments patch applied at the end of file (https://github.com/overhangio/tutor/blob/release/tutor/templates/k8s/deployments.yml#L483). The idea is that if one wants to customize the deployment, they can do so using this patch. Won't a similar pattern work here? In the new patch, we can define the volume and volume mount. Sorry if I am missing some k8s technical context here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DawoudSheraz The pattern you mentioned is designed for injecting complete resources through patches like
k8s-deployments. That works when we’re defining entire Deployments or sections of the spec, but here, our goal is simply to add to the MFE deployment.The two patches target different parts of the Deployment spec:
mfe-k8s-volumesinjects volume definitions underspec.template.spec.volumesmfe-k8s-volume-mountsinjects mounts underspec.template.spec.containers[].volumeMountsA merge could theoretically work if the sections were adjacent but we have the
configvolume defined in between.Even if they were next to each other, they still require different indentation and context (one at the pod level, the other inside a container).
It would be ideal to declare volumes and mount them together, but given Kubernetes’s structure, it’s necessary to keep them separated.
Let me know if I’ve captured your idea correctly, or if there’s anything else you’d like to comment on!