Skip to content

Commit da70aa5

Browse files
Yarboadougsland
authored andcommitted
Adding supported quadlet vars mappings
Remove PodmanArgs, since the following mappings supported: rpm -q podman podman-5.2.3-6.el9.x86_64 Unmask=ALL SecurityLabelNested=true SeccompProfile=/usr/share/qm/seccomp.json PidsLimit=-1 Adding Readme related to updating qm quadlet file It seems that currently there is usage in /etc/qm/containers/containers.conf Instead of extension of existing quadlet Signed-off-by: Yariv Rachmani <[email protected]>
1 parent 1b6a02a commit da70aa5

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed

Diff for: docs/devel/README.md

+39
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- [Copying files to QM partition](#copying-files-to-qm-partition)
1111
- [Listing QM service](#listing-qm-service)
1212
- [List QM container via podman](#list-qm-container-via-podman)
13+
- [Extend QM quadlet managed by podman](#extend-qm-quadlet-managed-by-podman)
1314
- [Connecting to QM container via podman](#connecting-to-qm-container-via-podman)
1415
- [SSH guest CentOS Automotive Stream Distro](#ssh-guest-centos-automotive-stream-distro)
1516
- [Check if HOST and Container are using different network namespace](#check-if-host-and-container-are-using-different-network-namespace)
@@ -179,6 +180,44 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
179180
a83253ae278d /sbin/init 38 seconds ago Up 38 seconds qm
180181
```
181182

183+
### Extend QM quadlet managed by podman
184+
185+
QM quadlet file is shipped through rpm, refer the following file.
186+
qm.container which is installed to /usr/share/containers/systemd/qm.container
187+
Please refer `man quadlet` for the supported value and how to.
188+
189+
In case a change needed in quadlet file, do not update systemd/qm.container file
190+
As per `man quadlet` do the following:
191+
192+
```console
193+
if ! test -e /etc/containers/systemd/qm.container.d ; then
194+
mkdir -p /etc/containers/systemd/qm.container.d
195+
fi
196+
cat > "/etc/containers/systemd/qm.container.d/expose-dev.conf" <<EOF
197+
[Container]
198+
# Expose host device /dev/net/tun
199+
AddDevice=-/dev/net/tun
200+
# In case parameter override needed, add empty value before the required key
201+
Unmask=
202+
Unmask=ALL
203+
EOF
204+
```
205+
206+
To verify the result use the following command:
207+
208+
```console
209+
/usr/lib/systemd/system-generators/podman-system-generator --dryrun
210+
```
211+
212+
Once the result is satisfied, apply the following
213+
214+
```console
215+
systemctl daemon-reload
216+
systemctl restart qm
217+
systemctl is-active qm
218+
active
219+
```
220+
182221
### Connecting to QM container via podman
183222

184223
```console

Diff for: qm.container

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ TasksMax=50%
3636

3737
[Container]
3838
AddCapability=all
39+
Unmask=ALL
40+
SecurityLabelNested=true
41+
SeccompProfile=/usr/share/qm/seccomp.json
42+
PidsLimit=-1
3943

4044
# Comment DropCapability this will allow FFI Tools to surpass their defaults.
4145
DropCapability=sys_resource
@@ -45,7 +49,6 @@ AddDevice=-/dev/fuse
4549
ContainerName=qm
4650
Exec=/sbin/init
4751
Network=private
48-
PodmanArgs=--pids-limit=-1 --security-opt seccomp=/usr/share/qm/seccomp.json --security-opt label=nested --security-opt unmask=all
4952
ReadOnly=true
5053
Rootfs=${ROOTFS}
5154

0 commit comments

Comments
 (0)