feat: add spec.additionalVolumeMounts for the main container - #565
Open
IgorOhrimenko wants to merge 1 commit into
Open
feat: add spec.additionalVolumeMounts for the main container#565IgorOhrimenko wants to merge 1 commit into
IgorOhrimenko wants to merge 1 commit into
Conversation
Complements spec.additionalVolumes, which only adds volumes to the pod without mounting them. additionalVolumeMounts mounts them into the Dragonfly main container, so users can e.g. back the snapshot dir (spec.snapshot.dir) with an emptyDir — surviving in-place container restarts without pinning the pod to a node like a local-path PVC does. Mounts are merged into the main container before additionalContainers are merged in, since that merge can prepend sidecars and shift the main container off index 0. Merged by name (user mount replaces default on collision), mirroring additionalVolumes/additionalContainers. Adds a config/samples example and unit tests, including one asserting the mounts land on the main container only, never on additional containers. Signed-off-by: Igor Ohrimenko <igor.ohrimenko@travelata.ru>
IgorOhrimenko
force-pushed
the
feat/additional-volume-mounts
branch
from
July 18, 2026 07:50
be445b4 to
2a2b906
Compare
Author
|
The build-operator failure looks like pre-existing e2e flakiness, not related to this change. The 3 failing specs (PVC single-replica, lifecycle connectivity, readiness-gate) don't use additionalVolumeMounts, and the new merge is a no-op when the field is unset (mergeNamedSlices(base, nil) returns the mounts unchanged), so the generated StatefulSet is identical to main for those tests. Failures are timing/infra (System should be stable … Timed out 60s, redis connection refused …, 4 flaked). The same suite intermittently fails on main too. |
Abhra303
self-requested a review
August 12, 2026 08:05
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds
spec.additionalVolumeMounts— extra volume mounts for the Dragonfly main container. It is the counterpart to the existingspec.additionalVolumes, which adds volumes to the pod but does not mount them anywhere.Why
additionalVolumeson its own is half a feature: you can add a volume to the pod but cannot mount it into the Dragonfly container. Pairing the two lets users compose several patterns without any snapshot-specific API, e.g.:spec.snapshot.dir) with anemptyDir. Dragonfly saves on SIGTERM and reloads on start, so an emptyDir snapshot survives in-place container restarts (e.g. a kubelet minor upgrade that changes the container hash) without pinning the pod to a node the way a local-path PVC does.emptyDirfor warm-up + crash protection.Usage examples (all validated end-to-end on a cluster): https://gist.github.com/IgorOhrimenko/d679e593637e0fbe62525f165fd17d78
Implementation
additionalVolumes/additionalContainersalready merge.additionalContainersmerge, since that merge prepends additional containers and would otherwise shift the main container off index 0.Testing
internal/resources, including one asserting mounts land on the main container only and never onadditionalContainers.config/samplesexample (v1alpha1_dragonfly_emptydir_snapshot.yaml).Backward compatible — the field is optional and existing specs are unaffected.