-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(core, kubevirt): add patch for hotplug container-disk #564
Merged
yaroslavborbat
merged 1 commit into
main
from
feat/kubevirt/add-hotplug-container-image
Jan 20, 2025
Merged
feat(core, kubevirt): add patch for hotplug container-disk #564
yaroslavborbat
merged 1 commit into
main
from
feat/kubevirt/add-hotplug-container-image
Jan 20, 2025
Conversation
This file contains 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
yaroslavborbat
changed the title
add
feat(core, kubevirt): add patch for hotplug container-disk
Dec 10, 2024
yaroslavborbat
force-pushed
the
feat/kubevirt/add-hotplug-container-image
branch
from
December 19, 2024 09:12
5133be7
to
a78c659
Compare
yaroslavborbat
force-pushed
the
feat/kubevirt/add-hotplug-container-image
branch
3 times, most recently
from
December 19, 2024 09:53
96ee51e
to
dffb2f7
Compare
diafour
reviewed
Dec 20, 2024
diafour
reviewed
Dec 23, 2024
diafour
reviewed
Dec 23, 2024
diafour
reviewed
Dec 23, 2024
diafour
reviewed
Dec 23, 2024
Resolved: there is no code from upstream. |
yaroslavborbat
force-pushed
the
feat/kubevirt/add-hotplug-container-image
branch
2 times, most recently
from
December 23, 2024 09:45
48ccceb
to
5b6e7d0
Compare
yaroslavborbat
force-pushed
the
feat/kubevirt/add-hotplug-container-image
branch
from
January 9, 2025 13:41
5b6e7d0
to
2bfd1b7
Compare
diafour
reviewed
Jan 13, 2025
yaroslavborbat
force-pushed
the
feat/kubevirt/add-hotplug-container-image
branch
4 times, most recently
from
January 15, 2025 01:41
8612ac0
to
27a1aa0
Compare
yaroslavborbat
force-pushed
the
feat/kubevirt/add-hotplug-container-image
branch
4 times, most recently
from
January 18, 2025 20:00
13c8da2
to
e0dc596
Compare
yaroslavborbat
force-pushed
the
feat/kubevirt/add-hotplug-container-image
branch
from
January 20, 2025 15:24
94e3bb4
to
01ca237
Compare
Signed-off-by: yaroslavborbat <[email protected]>
yaroslavborbat
force-pushed
the
feat/kubevirt/add-hotplug-container-image
branch
from
January 20, 2025 15:25
01ca237
to
9861407
Compare
fl64
approved these changes
Jan 20, 2025
Isteb4k
approved these changes
Jan 20, 2025
hardcoretime
pushed a commit
that referenced
this pull request
Jan 23, 2025
Add patch for hotplug container-disk Signed-off-by: yaroslavborbat <[email protected]>
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.
Description
Add patch for hotplug container-disk
container-disk
The
container-disk
is a program written in C used within KubeVirt to facilitate the mounting of container-based disk images into virtual machines. Its core function is to start up and create a UNIX socket within a specific directory. The program terminates when the socket is removed or upon receiving aSIGTERM
signal.Key Workflow:
container-disk
Initialization
container-disk
image, is created alongside thevirt-launcher
pod.virt-launcher
pod copies thecontainer-disk
program to a sharedemptyDir
volume. This setup allows the sidecar to execute the program.Socket Creation
container-disk
program creates a socket in theemptyDir
volume.virt-handler
to locate the socket on the host machine at:/var/lib/kubelet/pods/.../volumes/kubernetes.io~empty-dir/
.Socket Detection and Mounting
virt-handler
identifies it as acontainer-disk
volume and retrieves its parent mount point.containerd
, the mount point resolves to the root filesystem of the pulled image, typically at:/run/containerd/io.containerd.runtime.v2.task/k8s.io/<uid>/rootfs/
.disk/disk.img
within this filesystem and is mounted into the VM.HotPlug in KubeVirt
The HotPlug mechanism allows dynamic attachment of PVCs and
container-disk
volumes to a running VM by leveraging a separatehotplug
pod.HotPlug Pod Setup
hotplug
pod is created with the target PVCs mounted into anemptyDir
volume under the/hp
directory.container-disk
program runs in thehotplug
pod to create the necessary sockets for these volumes.Volume Detection and Mounting
virt-handler
locates the sockets on the host system at:/var/lib/kubelet/pods/<uid-hotplug-pod>/volumes/empty-dir/hp-disks/...
.virt-handler
creates a block device on the VM usingmknodat
.Unmounting
hotplug PVCs
.emptyDir
resources are retained and cleaned up later by Kubernetes.Why do we need it, and what problem does it solve?
What is the expected result?
Checklist