-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cannot set hostname when running in the host UTS namespace with podman in container #11969
Comments
The Podman container automatically runs containers in the container namespace. cat /etc/containers/containers.conf[containers] This allows us to eliminate some confusion but in this case you hit an issue.
|
You can also edit |
yup. But we decided to not have two layers of namespaces by default in this container. The goal of the podman container is to be an example. |
Thanks a lot to you both for your response! Using the quay.io/podman/stable container was intended to be a minimal example, I was trying to use a fedora34 based image to run kind on it using the podman provider, and found this issue. So, would it be possible to fix it by setting the |
Yes if you just modify the containers.conf file that is inside of the podman/stable container, to remove the uts and network line, it would fix that issue. |
@rhatdan The solution seem to not work for me. Here are my steps from centos 9. [root@localhost solr]# podman run -it quay.io/podman/stable bash
Trying to pull quay.io/podman/stable:latest...
Getting image source signatures
Copying blob 4545346f2a49 done
Copying blob 884182ae429e done
Copying blob 642718c75eb2 done
Copying blob 4196a7d27b7f done
Copying blob 01a72c2bf633 done
Copying blob 4964ea151cb9 done
Copying blob 192ff3030185 done
Copying blob b102fcb27ff6 done
Copying config dd66aa89f1 done
Writing manifest to image destination
Storing signatures
[root@5c117e8ededa /]# yum install -y go podman-docker
Fedora 35 - x86_64 6.1 MB/s | 79 MB 00:12
...
Complete!
[root@5c117e8ededa /]# go install sigs.k8s.io/kind@main
go: downloading sigs.k8s.io/kind v0.11.2-0.20220208072853-80a6a355a206
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/spf13/cobra v1.2.1
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/alessio/shellescape v1.4.1
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c
go: downloading github.com/pelletier/go-toml v1.9.4
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading sigs.k8s.io/yaml v1.3.0
go: downloading github.com/BurntSushi/toml v0.4.1
go: downloading github.com/evanphx/json-patch/v5 v5.6.0
go: downloading gopkg.in/yaml.v2 v2.4.0
[root@5c117e8ededa /]#
[root@5c117e8ededa /]# $(go env GOPATH)/bin/kind create cluster
enabling experimental podman provider
Cgroup controller detection is not implemented for Podman. If you see cgroup-related errors, you might need to set systemd property "Delegate=yes", see https://kind.sigs.k8s.io/docs/user/rootless/
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.23.1) 🖼
✗ Preparing nodes 📦
ERROR: failed to create cluster: command "podman run --name kind-control-plane --hostname kind-control-plane --label io.x-k8s.kind.role=control-plane --privileged --tmpfs /tmp --tmpfs /run --volume fdb3dc7a649b2ead3a46fe9765cf41570ae0aec0b37a7a99bbdfd293ba6c7b34:/var:suid,exec,dev --volume /lib/modules:/lib/modules:ro -e KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER --detach --tty --net kind --label io.x-k8s.kind.cluster=kind -e container=podman --volume /dev/mapper:/dev/mapper --device /dev/fuse --publish=127.0.0.1:33989:6443/tcp -e KUBECONFIG=/etc/kubernetes/admin.conf docker.io/kindest/node@sha256:377370274d04f4976a40f0498e47ebbdec672b951cb7b8212a1897465ddd1e9a" failed with error: exit status 125
Command Output: Error: invalid config provided: cannot set hostname when running in the host UTS namespace: invalid configuration
[root@5c117e8ededa /]# vi /etc/containers/containers.conf
[root@5c117e8ededa /]# $(go env GOPATH)/bin/kind create cluster
enabling experimental podman provider
Cgroup controller detection is not implemented for Podman. If you see cgroup-related errors, you might need to set systemd property "Delegate=yes", see https://kind.sigs.k8s.io/docs/user/rootless/
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.23.1) 🖼
✗ Preparing nodes 📦
ERROR: failed to create cluster: command "podman run --name kind-control-plane --hostname kind-control-plane --label io.x-k8s.kind.role=control-plane --privileged --tmpfs /tmp --tmpfs /run --volume 4f0ac038b205d9537fd3c3679a344d79aceb2e8f793ebfaf06b5de21a161a959:/var:suid,exec,dev --volume /lib/modules:/lib/modules:ro -e KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER --detach --tty --net kind --label io.x-k8s.kind.cluster=kind -e container=podman --volume /dev/mapper:/dev/mapper --device /dev/fuse --publish=127.0.0.1:43801:6443/tcp -e KUBECONFIG=/etc/kubernetes/admin.conf docker.io/kindest/node@sha256:377370274d04f4976a40f0498e47ebbdec672b951cb7b8212a1897465ddd1e9a" failed with error: exit status 125
Command Output: Error: statfs /dev/mapper: no such file or directory
[root@5c117e8ededa /]# head /etc/containers/containers.conf
[containers]
netns="private"
userns="host"
ipcns="host"
utsns="private"
cgroupns="host"
cgroups="disabled"
log_driver = "k8s-file"
[engine]
cgroup_manager = "cgroupfs"
[root@5c117e8ededa /]# $(go env GOPATH)/bin/kind create cluster
enabling experimental podman provider
Cgroup controller detection is not implemented for Podman. If you see cgroup-related errors, you might need to set systemd property "Delegate=yes", see https://kind.sigs.k8s.io/docs/user/rootless/
Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.23.1) 🖼
✗ Preparing nodes 📦
ERROR: failed to create cluster: command "podman run --name kind-control-plane --hostname kind-control-plane --label io.x-k8s.kind.role=control-plane --privileged --tmpfs /tmp --tmpfs /run --volume 5076509487e0352ec1a8181708f7c38448da0d8286ecf9edf0b48895636e6d38:/var:suid,exec,dev --volume /lib/modules:/lib/modules:ro -e KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER --detach --tty --net kind --label io.x-k8s.kind.cluster=kind -e container=podman --volume /dev/mapper:/dev/mapper --device /dev/fuse --publish=127.0.0.1:44779:6443/tcp -e KUBECONFIG=/etc/kubernetes/admin.conf docker.io/kindest/node@sha256:377370274d04f4976a40f0498e47ebbdec672b951cb7b8212a1897465ddd1e9a" failed with error: exit status 125
Command Output: Error: statfs /dev/mapper: no such file or directory
[root@5c117e8ededa /]# |
Please open a new discussion and do not pile onto old issues. |
sorry, I wasn`t aware.... |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
When running podman inside a container and setting hostname I get the following error:
Error: invalid config provided: cannot set hostname when running in the host UTS namespace: invalid configuration
Steps to reproduce the issue:
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)
Yes
The text was updated successfully, but these errors were encountered: