You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I create template file based on the information from the document: https://docs.podman.io/en/v5.2.2/markdown/podman-systemd.unit.5.html#template-files. But when I put this template into a pod, then one extra container is automatically created where the pod name will be the instance name. I am not sure this is works as designed or a bug, but based on document it should not happen, if I understand correctly.
My use case would be to host multiple webapp/api with the same template but within same pod (for network simpilicity).
$ podman ps --pod --filter pod=systemd-test
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES POD ID PODNAME
166c5ed6a36c localhost/podman-pause:5.2.2-1738677241 9 minutes ago Up 9 minutes 483a8d6b0238-infra 483a8d6b0238 systemd-test
161dfe5a7819 docker.io/library/debian:latest tail -f /dev/null 9 minutes ago Up 9 minutes systemd-test-server_2 483a8d6b0238 systemd-test
818027e8dfdf docker.io/library/debian:latest tail -f /dev/null 9 minutes ago Up 9 minutes systemd-test-server_1 483a8d6b0238 systemd-test
6cd32478e587 docker.io/library/debian:latest tail -f /dev/null 9 minutes ago Up 9 minutes systemd-test-server_3 483a8d6b0238 systemd-test
a03475f748ce docker.io/library/debian:latest tail -f /dev/null 9 minutes ago Up 9 minutes systemd-test-server_test-pod 483a8d6b0238 systemd-test
Describe the results you expected
Since I did not define DefaultInstance= parameter, no default container should be started just the symlink ones. So [email protected] should not been started. It also seems, if I set something for DefaultInstance, it is ignored when template is in pod.
podman info output
host:
arch: amd64buildahVersion: 1.37.6cgroupControllers:
- memory
- pidscgroupManager: systemdcgroupVersion: v2conmon:
package: conmon-2.1.12-1.el9.x86_64path: /usr/bin/conmonversion: 'conmon version 2.1.12, commit: 5859d6167f22954414ce804d3f2ae9cf6208f929'cpuUtilization:
idlePercent: 97.48systemPercent: 1.11userPercent: 1.41cpus: 2databaseBackend: sqlitedistribution:
distribution: rockyversion: "9.5"eventLogger: journaldfreeLocks: 2023hostname: controller-01idMappings:
gidmap:
- container_id: 0host_id: 1000size: 1
- container_id: 1host_id: 100000size: 65536uidmap:
- container_id: 0host_id: 1000size: 1
- container_id: 1host_id: 100000size: 65536kernel: 5.14.0-503.26.1.el9_5.x86_64linkmode: dynamiclogDriver: journaldmemFree: 308297728memTotal: 3735650304networkBackend: netavarknetworkBackendInfo:
backend: netavarkdns:
package: aardvark-dns-1.12.2-1.el9_5.x86_64path: /usr/libexec/podman/aardvark-dnsversion: aardvark-dns 1.12.2package: netavark-1.12.2-1.el9.x86_64path: /usr/libexec/podman/netavarkversion: netavark 1.12.2ociRuntime:
name: crunpackage: crun-1.16.1-1.el9.x86_64path: /usr/bin/crunversion: |- crun version 1.16.1 commit: afa829ca0122bd5e1d67f1f38e6cc348027e3c32 rundir: /run/user/1000/crun spec: 1.0.0 +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJLos: linuxpasta:
executable: /usr/bin/pastapackage: passt-0^20240806.gee36266-6.el9_5.x86_64version: | pasta 0^20240806.gee36266-6.el9_5.x86_64 Copyright Red Hat GNU General Public License, version 2 or later <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.remoteSocket:
exists: falsepath: /run/user/1000/podman/podman.sockrootlessNetworkCmd: pastasecurity:
apparmorEnabled: falsecapabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOTrootless: trueseccompEnabled: trueseccompProfilePath: /usr/share/containers/seccomp.jsonselinuxEnabled: trueserviceIsRemote: falseslirp4netns:
executable: /usr/bin/slirp4netnspackage: slirp4netns-1.3.1-1.el9.x86_64version: |- slirp4netns version 1.3.1 commit: e5e368c4f5db6ae75c2fce786e31eef9da6bf236 libslirp: 4.4.0 SLIRP_CONFIG_VERSION_MAX: 3 libseccomp: 2.5.2swapFree: 0swapTotal: 0uptime: 90h 50m 32.00s (Approximately 3.75 days)variant: ""plugins:
authorization: nulllog:
- k8s-file
- none
- passthrough
- journaldnetwork:
- bridge
- macvlan
- ipvlanvolume:
- localregistries:
search:
- registry.access.redhat.com
- registry.redhat.io
- docker.iostore:
configFile: /home/ati/.config/containers/storage.confcontainerStore:
number: 18paused: 0running: 17stopped: 1graphDriverName: overlaygraphOptions: {}graphRoot: /home/ati/.local/share/containers/storagegraphRootAllocated: 40165670912graphRootUsed: 12203323392graphStatus:
Backing Filesystem: extfsNative Overlay Diff: "true"Supports d_type: "true"Supports shifting: "false"Supports volatile: "true"Using metacopy: "false"imageCopyTmpDir: /var/tmpimageStore:
number: 17runRoot: /run/user/1000/containerstransientStore: falsevolumePath: /home/ati/.local/share/containers/storage/volumesversion:
APIVersion: 5.2.2Built: 1738677241BuiltTime: Tue Feb 4 13:54:01 2025GitCommit: ""GoVersion: go1.22.9 (Red Hat 1.22.9-2.el9_5)Os: linuxOsArch: linux/amd64Version: 5.2.2
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
This data is gathered from 5.2.2 version, but I have tested on a test system with podman 5.4, produced the same issue.
Additional information
No response
The text was updated successfully, but these errors were encountered:
onlyati
changed the title
Container template, generate extra if it is in a pod
Container template, generate extra container if it is in a pod
Mar 8, 2025
Issue Description
I create template file based on the information from the document: https://docs.podman.io/en/v5.2.2/markdown/podman-systemd.unit.5.html#template-files. But when I put this template into a pod, then one extra container is automatically created where the pod name will be the instance name. I am not sure this is works as designed or a bug, but based on document it should not happen, if I understand correctly.
My use case would be to host multiple webapp/api with the same template but within same pod (for network simpilicity).
Steps to reproduce the issue
Create a pod file, for example
test.pod
:Create container teamplate, for example
[email protected]
:Then create some symlink:
Then reload the daemon
systemctl --user daemon-reload
and start the podsystemctl --user start test-pod
.Describe the results you received
Describe the results you expected
Since I did not define
DefaultInstance=
parameter, no default container should be started just the symlink ones. So [email protected] should not been started. It also seems, if I set something for DefaultInstance, it is ignored when template is in pod.podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
This data is gathered from 5.2.2 version, but I have tested on a test system with podman 5.4, produced the same issue.
Additional information
No response
The text was updated successfully, but these errors were encountered: