Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/components/versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ firmware:
libvirt: v10.9.0
edk2: stable202411
core:
3p-kubevirt: v1.6.2-v12n.21
3p-kubevirt: feat/vm/rootless-virt-launcher
3p-containerized-data-importer: v1.60.3-v12n.17
distribution: 2.8.3
package:
Expand Down
8 changes: 4 additions & 4 deletions images/dvcr-artifact/pkg/registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ func (p DataProcessor) inspectAndStreamSourceImage(
dirHeader := &tar.Header{
Name: "disk",
Mode: 0o755,
Uid: 107,
Gid: 107,
Uid: 64535,
Gid: 64535,
AccessTime: now,
ChangeTime: now,
Typeflag: tar.TypeDir,
Expand All @@ -217,8 +217,8 @@ func (p DataProcessor) inspectAndStreamSourceImage(
Name: imagePath,
Size: int64(sourceImageSize),
Mode: 0o644,
Uid: 107,
Gid: 107,
Uid: 64535,
Gid: 64535,
AccessTime: now,
ChangeTime: now,
Typeflag: tar.TypeReg,
Expand Down
1 change: 1 addition & 0 deletions images/dvcr-artifact/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ packages:

image: {{ .ModuleNamePrefix }}{{ .ImageName }}-builder
final: false
fromCacheVersion: "{{ now | date "Mon Jan 2 15:04:05 MST 2006" }}"
fromImage: {{ eq $.SVACE_ENABLED "false" | ternary "builder/golang-alt-1.25" "builder/golang-alt-svace-1.25" }}
secrets:
- id: GOPROXY
Expand Down
6 changes: 4 additions & 2 deletions images/virt-artifact/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
image: {{ .ModuleNamePrefix }}{{ .ImageName }}-src-artifact
final: false
fromImage: builder/src
fromCacheVersion: "{{ now | date "Mon Jan 2 15:04:05 MST 2006" }}"
secrets:
- id: SOURCE_REPO
value: {{ $.SOURCE_REPO }}
Expand Down Expand Up @@ -43,6 +44,7 @@ packages:

image: {{ .ModuleNamePrefix }}{{ .ImageName }}
final: false
fromCacheVersion: "{{ now | date "Mon Jan 2 15:04:05 MST 2006" }}"
fromImage: {{ eq $.SVACE_ENABLED "false" | ternary "builder/golang-alt-1.25" "builder/golang-alt-svace-1.25" }}
mount:
- fromPath: ~/go-pkg-cache
Expand Down Expand Up @@ -98,15 +100,15 @@ shell:
- echo "Create group file"
- |
GROUP_FILE=/kubevirt-config-files/group
echo "qemu:x:107:" > $GROUP_FILE
echo "deckhouse:x:64535:" > $GROUP_FILE
echo "root:x:0:" >> $GROUP_FILE
echo "nonroot-user:x:1001:" >> $GROUP_FILE
chmod 0644 $GROUP_FILE

- echo "Create passwd file"
- |
PASSWD_FILE=/kubevirt-config-files/passwd
echo "qemu:x:107:107:user:/home/qemu:/bin/bash" > $PASSWD_FILE
echo "deckhouse:x:64535:64535:deckhouse:/home/deckhouse:/sbin/nologin" > $PASSWD_FILE
echo "root:x:0:0:root:/root:/bin/bash" >> $PASSWD_FILE
echo "nonroot-user:x:1001:1001::/home/nonroot-user:/bin/bash" >> $PASSWD_FILE
chmod 0644 $PASSWD_FILE
Expand Down
10 changes: 6 additions & 4 deletions images/virt-handler/werf.inc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
image: {{ .ModuleNamePrefix }}{{ .ImageName }}
fromImage: {{ .ModuleNamePrefix }}distroless
fromCacheVersion: "{{ now | date "Mon Jan 2 15:04:05 MST 2006" }}"
git:
{{- include "image mount points" . }}
import:
Expand Down Expand Up @@ -81,6 +82,7 @@ packages:
image: {{ .ModuleNamePrefix }}{{ .ImageName }}-bins
final: false
fromImage: {{ .ModuleNamePrefix }}base-alt-p11-binaries
fromCacheVersion: "{{ now | date "Mon Jan 2 15:04:05 MST 2006" }}"
import:
- image: tools/util-linux
add: /
Expand Down Expand Up @@ -113,8 +115,8 @@ shell:
echo "root:x:0:" >> /relocate/etc/group
echo "root:x:::::::" >> /relocate/etc/shadow

echo "qemu:x:107:107::/home/qemu:/bin/bash" >> /relocate/etc/passwd
echo "qemu:x:107:" >> /relocate/etc/group
mkdir -p /relocate/home/qemu
chown -R 107:107 /relocate/home/qemu
echo "deckhouse:x:64535:64535:deckhouse:/home/deckhouse:/sbin/nologin" >> /relocate/etc/passwd
echo "deckhouse:x:64535:" >> /relocate/etc/group
mkdir -p /relocate/home/deckhouse
chown -R 64535:64535 /relocate/home/deckhouse

4 changes: 2 additions & 2 deletions images/virt-launcher/configs/qemu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ stdio_handler = "logd"
vnc_listen = "0.0.0.0"
vnc_tls = 0
vnc_sasl = 0
user = "qemu"
group = "qemu"
user = "deckhouse"
group = "deckhouse"
dynamic_ownership = 1
remember_owner = 0
namespaces = [ ]
Expand Down
22 changes: 14 additions & 8 deletions images/virt-launcher/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@
image: {{ .ModuleNamePrefix }}{{ .ImageName }}
final: true
fromImage: {{ .ModuleNamePrefix }}distroless
fromCacheVersion: "{{ now | date "Mon Jan 2 15:04:05 MST 2006" }}"
git:
{{- include "image mount points" . }}
import:
- image: {{ .ModuleNamePrefix }}{{ .ImageName }}-binaries
add: /relocate
to: /
after: install
- image: tools/tini-v0.19.0
add: /usr/bin/tini
to: /usr/bin/tini
after: install
imageSpec:
config:
user: 0
Expand Down Expand Up @@ -139,6 +136,7 @@ packages:
image: {{ .ModuleNamePrefix }}{{ .ImageName }}-binaries
final: false
fromImage: {{ .ModuleNamePrefix }}base-alt-p11-binaries
fromCacheVersion: "{{ now | date "Mon Jan 2 15:04:05 MST 2006" }}"
git:
# Add qemu and virtqemud configs
- add: {{ .ModuleDir }}/images/{{ .ImageName }}/configs
Expand All @@ -158,6 +156,10 @@ git:
includePaths:
- nsswitch.conf
import:
- image: tools/tini-v0.19.0
add: /usr/bin/tini
to: /relocate/usr/bin/tini
before: setup
# Libvirt and QEMU libraries and binaries
- image: {{ .ModuleNamePrefix }}packages/libvirt
add: /libvirt
Expand Down Expand Up @@ -325,10 +327,10 @@ shell:
echo "root:x:0:" >> /relocate/etc/group
echo "root:x:::::::" >> /relocate/etc/shadow

echo "qemu:x:107:107::/home/qemu:/bin/bash" >> /relocate/etc/passwd
echo "qemu:x:107:" >> /relocate/etc/group
mkdir -p /relocate/home/qemu
chown -R 107:107 /relocate/home/qemu
echo "deckhouse:x:64535:64535:deckhouse:/home/deckhouse:/sbin/nologin" >> /relocate/etc/passwd
echo "deckhouse:x:64535:" >> /relocate/etc/group
mkdir -p /relocate/home/deckhouse
chown -R 64535:64535 /relocate/home/deckhouse

- |
echo "Create symlinks for OVMF"
Expand Down Expand Up @@ -392,6 +394,10 @@ shell:
echo "Create symlink for run -> var/run "
ln -s var/run run

- |
setcap cap_net_bind_service=+ep /relocate/usr/bin/virt-launcher-monitor
setcap cap_net_bind_service=+ep /relocate/usr/bin/tini

# /etc/libvirt-init will be copied back into /etc/libvirt at runtime. This is necessary because we configure libvirt to mount /etc/libvirt and set readOnlyRootFilesystem for other directories.
# DO NOT REMOVE. node-labeler.sh uses /etc/libvirt.
- |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ const (
AnnUSBIPAddress = "usb.virtualization.deckhouse.io/usbip-address"

// DefaultUSBDeviceGroup is the default device group ID for USB devices.
DefaultUSBDeviceGroup = "107"
DefaultUSBDeviceGroup = "64535"
// DefaultUSBDeviceUser is the default device user ID for USB devices.
DefaultUSBDeviceUser = "107"
DefaultUSBDeviceUser = "64535"
)

// AddAnnotation adds an annotation to an object
Expand Down
4 changes: 2 additions & 2 deletions images/virtualization-artifact/pkg/common/pod/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ func IsPodComplete(pod *corev1.Pod) bool {
return pod != nil && pod.Status.Phase == corev1.PodSucceeded
}

// QemuSubGID is the gid used as the qemu group in fsGroup
const QemuSubGID = int64(107)
// QemuSubGID is the gid used as the deckhouse group in fsGroup
const QemuSubGID = int64(64535)

// SetRestrictedSecurityContext sets the pod security params to be compatible with restricted PSA
func SetRestrictedSecurityContext(podSpec *corev1.PodSpec) {
Expand Down
1 change: 0 additions & 1 deletion templates/kubevirt/kubevirt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ spec:
- HotplugVolumes
- Snapshot
- ExpandDisks
- Root
- CPUManager
- Sidecar
- VolumeSnapshotDataSource
Expand Down
Loading