Skip to content
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

Error Starting Control Plane w/ Podman on Fedora 33 #2213

Closed
archcloudlabs opened this issue Apr 25, 2021 · 29 comments
Closed

Error Starting Control Plane w/ Podman on Fedora 33 #2213

archcloudlabs opened this issue Apr 25, 2021 · 29 comments
Assignees
Labels
area/provider/podman Issues or PRs related to podman kind/bug Categorizes issue or PR as related to a bug.

Comments

@archcloudlabs
Copy link

What happened:
Hello, when trying to create a kind cluster via kind create cluster on Fedora 33 w/ podman resulted in an error deploying the control plane.

What you expected to happen:
I was hoping for a cluster to be created.

How to reproduce it (as minimally and precisely as possible):

  1. Fedora 33 w/ podman as underlying OS
  2. Execute kind create cluster

Anything Else
Here are further log details

➜  kind kind create cluster                                                                                                   
enabling experimental podman provider                                                                                         
Creating cluster "kind" ...                                                                                                   
 ✓ Ensuring node image (kindest/node:v1.20.2) 🖼                                                                               
 ✓ Preparing nodes 📦                                                                                                         
 ✓ Writing configuration 📜                                                                                                   
 ✗ Starting control-plane 🕹️             
                                                                                      
ERROR: failed to create cluster: failed to init node with kubeadm: command "podman exec --privileged kind-control-plane kubead
m init --skip-phases=preflight --config=/kind/kubeadm.conf --skip-token-print --v=6" failed with error: exit status 1         
Command Output: I0425 20:27:13.948213      98 initconfiguration.go:201] loading configuration from "/kind/kubeadm.conf"       
[config] WARNING: Ignored YAML document with GroupVersionKind kubeadm.k8s.io/v1beta2, Kind=JoinConfiguration                  

 ...

[kubelet-check] It seems like the kubelet isn't running or healthy.          
[kubelet-check] The HTTP call equal to 'curl -sSL http://localhost:10248/healthz' failed with error: Get "http://localhost:102
48/healthz": dial tcp [::1]:10248: connect: connection refused. 
                               
        Unfortunately, an error has occurred:     
                timed out waiting for the condition

Environment:

  • kind version: (use kind version): kind v0.11.0-alpha go1.15.8 linux/amd64
  • Kubernetes version: (use kubectl version): 1.21
  • Docker version: (use docker info):N/A
  • Podman version: (use podman info):3.1.2
  • OS (e.g. from /etc/os-release): Fedora 33
@archcloudlabs archcloudlabs added the kind/bug Categorizes issue or PR as related to a bug. label Apr 25, 2021
@tao12345666333
Copy link
Member

you can try to use kind export logs export all logs.

@BenTheElder
Copy link
Member

probably:

/assign @aojea

@archcloudlabs
Copy link
Author

you can try to use kind export logs export all logs.

This results in the following:

➜  ~ kind export logs
enabling experimental podman provider
ERROR: unknown cluster "kind"

probably:

* https://kind.sigs.k8s.io/docs/user/known-issues/#fedora32-firewalld

* #1939

/assign @aojea

I completely uninstalled and removed firewalld and installed iptables + iptables-service. Unfortunately, the problem still persists.

@aojea
Copy link
Contributor

aojea commented Apr 27, 2021

kind create cluster --retain
kind export logs

you need the retain flag so the cluster is not deleted on failure

@archcloudlabs
Copy link
Author

Here's where things appear to go wrong

    6 Apr 30 00:59:12 kind-control-plane kubelet[230]: I0430 00:59:12.276618     230 server.go:416] Version: v1.20.2
    5 Apr 30 00:59:12 kind-control-plane kubelet[230]: I0430 00:59:12.276785     230 server.go:837] Client rotation is on, will bootstrap in background
    4 Apr 30 00:59:12 kind-control-plane kubelet[230]: I0430 00:59:12.280322     230 dynamic_cafile_content.go:167] Starting client-ca-bundle::/etc/kubernetes/pki/ca.crt
    3 Apr 30 00:59:12 kind-control-plane kubelet[230]: W0430 00:59:12.280392     230 manager.go:159] Cannot detect current cgroup on cgroup v2
    2 Apr 30 00:59:12 kind-control-plane kubelet[230]: E0430 00:59:12.285950     230 certificate_manager.go:437] Failed while requesting a signed certificate from the master: cannot create certificate signing request: Post "https://kind-control-plane:6443/apis/certificates.k8s.io/v1/certificatesigningrequests": dial tcp [fc00:f853:ccd:e793::3]:6443: connect: connection refused
    1 Apr 30 00:59:14 kind-control-plane kubelet[230]: E0430 00:59:14.457350     230 certificate_manager.go:437] Failed while requesting a signed certificate from the master: cannot create certificate signing request: Post "https://kind-control-plane:6443/apis/certificates.k8s.io/v1/certificatesigningrequests": dial tcp [fc00:f853:ccd:e793::3]:6443: connect: connection refused
19    Apr 30 00:59:17 kind-control-plane kubelet[230]: W0430 00:59:17.282707     230 fs.go:208] stat failed on /dev/nvme0n1p3 with error: no such file or directory
    1 Apr 30 00:59:17 kind-control-plane kubelet[230]: I0430 00:59:17.310267     230 container_manager_linux.go:274] container manager verified user specified cgroup-root exists: [kubelet]
    2 Apr 30 00:59:17 kind-control-plane kubelet[230]: I0430 00:59:17.310288     230 container_manager_linux.go:279] Creating Container Manager object based on Node Config: {RuntimeCgroupsName: SystemCgroupsName: KubeletCgroupsName: ContainerRuntime:remote CgroupsPerQOS:true CgroupRoot:/kubelet CgroupDriver:cgroupfs KubeletRootDir:/var/lib/kubelet ProtectKernelDefaults:false NodeAllocatableConfig:{KubeReservedCgroupName: Sy
    3 Apr 30 00:59:17 kind-control-plane kubelet[230]: I0430 00:59:17.310377     230 topology_manager.go:120] [topologymanager] Creating topology manager with none policy per container scope
    4 Apr 30 00:59:17 kind-control-plane kubelet[230]: I0430 00:59:17.310387     230 container_manager_linux.go:310] [topologymanager] Initializing Topology Manager with none policy and container-level scope

and then a stack trace starts.

   21 Apr 30 00:59:23 kind-control-plane kubelet[230]: goroutine 382 [running]:       
   20 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/vendor/k8s.io/klog/v2.stacks(0xc000010001, 0xc0006e3800, 0xe4, 0x200)
   19 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1026 +0xb9
   18 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/vendor/k8s.io/klog/v2.(*loggingT).output(0x70cb4c0, 0xc000000003, 0x0, 0x0, 0xc0009f2070, 0x6f3ce48, 0xa, 0x546, 0x0)
   17 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:975 +0x19b
   16 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/vendor/k8s.io/klog/v2.(*loggingT).printf(0x70cb4c0, 0xc000000003, 0x0, 0x0, 0x0, 0x0, 0x4935d79, 0x23, 0xc0013a41e0, 0x1, ...)
   15 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:750 +0x191
   14 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/vendor/k8s.io/klog/v2.Fatalf(...)
   13 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/klog/v2/klog.go:1502
   12 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/pkg/kubelet.(*Kubelet).initializeRuntimeDependentModules(0xc001058a80)
   11 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go:1350 +0x446
   10 Apr 30 00:59:23 kind-control-plane kubelet[230]: sync.(*Once).doSlow(0xc0010592c8, 0xc000873de8)
    9 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /usr/local/go/src/sync/once.go:66 +0xec
    8 Apr 30 00:59:23 kind-control-plane kubelet[230]: sync.(*Once).Do(...)           
    7 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /usr/local/go/src/sync/once.go:57
    6 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/pkg/kubelet.(*Kubelet).updateRuntimeUp(0xc001058a80)
    5 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go:2179 +0x672
    4 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1(0xc001287610)
    3 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:155 +0x5f
    2 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.BackoffUntil(0xc001287610, 0x4f11e00, 0xc0013a6120, 0x1, 0xc0000ee0c0)
    1 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:156 +0xad
91    Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.JitterUntil(0xc001287610, 0x12a05f200, 0x0, 0x1, 0xc0000ee0c0)
    1 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:133 +0x98
    2 Apr 30 00:59:23 kind-control-plane kubelet[230]: k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait.Until(0xc001287610, 0x12a05f200, 0xc0000ee0c0)
    3 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/util/wait/wait.go:90 +0x4d
    4 Apr 30 00:59:23 kind-control-plane kubelet[230]: created by k8s.io/kubernetes/pkg/kubelet.(*Kubelet).Run
    5 Apr 30 00:59:23 kind-control-plane kubelet[230]:         /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go:1403 +0x16a
    6 Apr 30 00:59:23 kind-control-plane kubelet[230]: goroutine 1 [select]:          

@aojea
Copy link
Contributor

aojea commented Apr 30, 2021

v1/certificatesigningrequests": dial tcp [fc00:f853:ccd:e793::3]:6443: connect: connection refused

Have a you done the iptables save working and nonworking that I mentioned previously?

@kleini
Copy link

kleini commented May 7, 2021

Have a you done the iptables save working and nonworking that I mentioned previously?

Where was that mentioned? Maybe I am stumbling over a similar issue on Manjaro Linux with podman 3.1.2.

@aojea
Copy link
Contributor

aojea commented May 7, 2021

ups, sorry, I think I mixed issues.
Can you check #1939 @kleini ?

@kleini
Copy link

kleini commented May 7, 2021

@aojea I can not get the control plane working and error messages in kindest/node journalctl look similar to the one mentioned here. Will try to provide full logs as described above.

@archcloudlabs
Copy link
Author

Just following up here, I still was unable to get podman to work. I had no issues with docker though.

@alanjholiveira
Copy link

Same problem with Fedora 34.

@BenTheElder BenTheElder added the area/provider/podman Issues or PRs related to podman label May 28, 2021
@mriedmann
Copy link

same here with Fedora 34. Fedora 32+ uses nftables per default instead of iptables, so maybe it is related this: #2271 (there is a PR pending, that adapts the iptables wrapper)

@BenTheElder
Copy link
Member

I don't think that will change anything for podman because podman historically does not inject any iptables rules so we will not have anything to detect. That PR would change behavior an unlikely edge case where both type rules are in the node ns from the runtime which seems incredibly unlikely, but it's one of the few possible explanations for a different issue with rootless podman.

For local podman we could maybe try to run some detection on the host as well but even then we also still need podman/docker + firewalld etc to be configured to work together with the same nft | iptables, which we've seen not be the case in the past on fedora.

@bagnaram
Copy link
Contributor

After ugrading podman recently I have run into problems myself. When using the v1.21.2 kind node image that contains the proper iptables wrapper script I appear to be reverting to having similar issues.

$ podman run --hostname kind-control-plane --name kind-control-plane --label io.x-k8s.kind.role=control-plane --privileged --tmpfs /tmp --tmpfs /run --volume bf9ca67764a451fd098017594578ea5b2e35808047316865ed43bcbf89c649ba:/var:suid,exec,dev --volume /lib/modules:/lib/modules:ro --detach --tty --net kind --label io.x-k8s.kind.cluster=kind -e container=podman --publish=127.0.0.1:34813:6443/tcp -e KUBECONFIG=/etc/kubernetes/admin.conf kindest/node:v1.21.2
ERRO[0002] error loading cached network config: network "kind" not found in CNI cache
WARN[0002] falling back to loading from existing plugins on disk
ERRO[0003] Error tearing down partially created network namespace for container 8779c1e9e30e664da84cc7d40537a104b44f99cffa07c44ed4354ce2d9644f34: error removing pod kind-control-plane_kind-control-plane from CNI network "kind": running [/usr/bin/iptables -t nat -D POSTROUTING -s 10.88.2.13 -j CNI-60d270dcc022372e968c855b -m comment --comment name: "kind" id: "8779c1e9e30e664da84cc7d40537a104b44f99cffa07c44ed4354ce2d9644f34" --wait]: exit status 2: iptables v1.8.7 (legacy): Couldn't load target `CNI-60d270dcc022372e968c855b':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
Error: error configuring network namespace for container 8779c1e9e30e664da84cc7d40537a104b44f99cffa07c44ed4354ce2d9644f34: error adding pod kind-control-plane_kind-control-plane to CNI network "kind": failed to list chains: running [/usr/bin/ip6tables -t nat -S --wait]: exit status 3: modprobe: ERROR: could not insert 'ip6_tables': Operation not permitted
ip6tables v1.8.7 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.

@BenTheElder
Copy link
Member

Above comment #2213 (comment) still applies, there's not a good way to reliably detect this without podman either explicitly providing an API to detect this or injecting a rule into the container.

We'd probably accept (cc @aojea) PRs like:

  1. [WIP] Support remote podman #2235 but resolve the issues outlined regarding checking the podman version and gracefully supporting older versions
  2. If podman is not detected to be remote, probe the local host iptables (highly privileged but so is running rootful podman, for rootless .... unclear)
  3. Inject a special env to the node for podman based on 2., select binaries in the node bootup based on this.

But even that would only work at best for non-remote + rootful podman. Rootless and remote are still problematic.

The podman driver could start an image (... which then becomes problematic as a dependency e.g. for offline ...) to probe the host network perhaps but rootless probably doesn't support this, and it would affect cluster creation time by adding another serial bottleneck before getting nodes booted.

What would probably be most ideal is if podman info could expose if iptables or iptables nft should be used, but this seems like a bit of an oddly specific feature request for them.

@BenTheElder
Copy link
Member

Alternatively in the specific case that the legacy iptables modules literally do not exist, we can maybe try to probe for that case and assume the other mode should be used, that said we see real failures where the user e.g. requested an ipv6 cluster but their host doesn't have the ipv6 modules and it would probably be even more confusing if we switched to nftables, so maybe probe only ipv4 and only if we couldn't detect any rules from either.

This also forces us to deviate from the kube-proxy logic, which would be slightly unfortunate, unless we can somehow convince them to add this rule there too (which ... it seems less clear that you'd ever need this in host network).

@seraphlive
Copy link

seraphlive commented Aug 3, 2021

I'm facing the same issue with a Fedora 34 virtual machine. Going through other issues, #2112 makes me wonder if this issue is related to btrfs. I'm not sure other Fedora users under this issue are using btrfs as it's default since Fedora 33. Out of curiosity, I made another vm with same Fedora 34 workstation installation and same 5.13.6 kernel version but choosing xfs manually instead of btrfs. And there is no issue on that.

(Please refer to the attachment if you need log files from my kind export logs output)
logs.zip

@wzzrd
Copy link

wzzrd commented Aug 4, 2021

On my laptop running a brand new F34 install w/ btrfs, kind fails to start. On my workstation running F34 w/ xfs, kind starts fine. You might be onto something :)

@wzzrd
Copy link

wzzrd commented Aug 4, 2021

Willing to test any experimental changes and / or workarounds. Let me know what I can do to help.

@aojea
Copy link
Contributor

aojea commented Aug 4, 2021

definitively last comments points to btrfs

Aug 03 07:48:24 kind-control-plane kubelet[816]: W0803 07:48:24.111487     816 fs.go:588] stat failed on /dev/vda2 with error: no such file or directory
Aug 03 07:48:24 kind-control-plane kubelet[816]: E0803 07:48:24.111503     816 kubelet.go:1384] "Failed to start ContainerManager" err="failed to get rootfs info: failed to get device for dir \"/var/lib/kubelet\": could not find device with major: 0, minor: 37 in cached partitions map"

but that was fixed by ab52382

are you using latest kind version?

I think we should lock this thread, this is becoming a placeholder of different errors and is very hard to follow

@moshevayner
Copy link

Hey folks! 👋🏻
Just wanted to hop-in and confirm that I'm experiencing the exact same issue.
Some details:

➜  ~ kind --version
kind version 0.11.1
➜  ~ podman --version
podman version 3.4.0


➜  ~ KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --name moshe-sysdig
using podman due to KIND_EXPERIMENTAL_PROVIDER
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 "moshe-sysdig" ...
 ✓ Ensuring node image (kindest/node:v1.21.1) 🖼
 ✗ Preparing nodes 📦
ERROR: failed to create cluster: podman run error: command "podman run --hostname moshe-sysdig-control-plane --name moshe-sysdig-control-plane --label io.x-k8s.kind.role=control-plane --privileged --tmpfs /tmp --tmpfs /run --volume 7a71499add0be5cf975b6ce40ab612ce632dcf18179be7d79535c41706250afc:/var:suid,exec,dev --volume /lib/modules:/lib/modules:ro --detach --tty --net kind --label io.x-k8s.kind.cluster=moshe-sysdig -e container=podman --publish=127.0.0.1:53379:6443/tcp -e KUBECONFIG=/etc/kubernetes/admin.conf kindest/node@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6" failed with error: exit status 126
Command Output: Error: error configuring network namespace for container 04b0fe06a02a9309724f8a30ce90611a4e0de46a33cf659db1aab5e8a00a98dc: error adding pod moshe-sysdig-control-plane_moshe-sysdig-control-plane to CNI network "kind": failed to list chains: running [/usr/sbin/ip6tables -t nat -S --wait]: exit status 3: modprobe: ERROR: could not insert 'ip6_tables': Operation not permitted
ip6tables v1.8.7 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.

The podman machine is running Fedora 34.

Willing to help out with testing if needed!

@aojea
Copy link
Contributor

aojea commented Oct 7, 2021

KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --name moshe-sysdig

can you run that as root?

rootless in podman has a known issue with a sidecar container used to configured the network, it was removed in master

@moshevayner
Copy link

KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --name moshe-sysdig

can you run that as root?

rootless in podman has a known issue with a sidecar container used to configured the network, it was removed in master

@aojea just making sure, when you say "run that as root" - you did mean simply with sudo, right? Making sure I didn't misunderstand. If that was indeed your intention, that unfortunately it didn't work either, same error:

➜  ~ sudo KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --name moshe-sysdig
Password:
using podman due to KIND_EXPERIMENTAL_PROVIDER
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 "moshe-sysdig" ...
 ✓ Ensuring node image (kindest/node:v1.21.1) 🖼
 ✗ Preparing nodes 📦
ERROR: failed to create cluster: podman run error: command "podman run --hostname moshe-sysdig-control-plane --name moshe-sysdig-control-plane --label io.x-k8s.kind.role=control-plane --privileged --tmpfs /tmp --tmpfs /run --volume 9712e2ef5dc8cb0426b54eb9972bdf4bbfd0ed40e53b4f56d3dcafdbc20a3234:/var:suid,exec,dev --volume /lib/modules:/lib/modules:ro --detach --tty --net kind --label io.x-k8s.kind.cluster=moshe-sysdig -e container=podman --publish=127.0.0.1:59824:6443/tcp -e KUBECONFIG=/etc/kubernetes/admin.conf kindest/node@sha256:69860bda5563ac81e3c0057d654b5253219618a22ec3a346306239bba8cfa1a6" failed with error: exit status 126
Command Output: Error: error configuring network namespace for container 6de8ed62f1deac29143ca93ce9ed4bb54ad2880ed60592c113e3a11e25d4caee: error adding pod moshe-sysdig-control-plane_moshe-sysdig-control-plane to CNI network "kind": failed to list chains: running [/usr/sbin/ip6tables -t nat -S --wait]: exit status 3: modprobe: ERROR: could not insert 'ip6_tables': Operation not permitted
ip6tables v1.8.7 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.

Thanks!

@aojea
Copy link
Contributor

aojea commented Oct 7, 2021

weird, are you using fedora?
it is complaining about the kernel module for ip6ables, you have to load it

sudo modprobe -v ip6_tables
insmod /lib/modules/5.4.132-1.el8.elrepo.x86_64/kernel/net/ipv6/netfilter/ip6_tables.ko.xz 
$ sudo lsmod | grep ip6
ip6_tables             36864  0

@moshevayner
Copy link

Ha, that helped for this part even though I'm getting another error now.
So to add some more clarification - I'm using podman with qemu on a macOS machine (BigSur).
I set it up using podman machine init and podman machine start. I guess it doesn't load the ip6module by default.
Apologies for the red-herring, I guess it wasn't exactly the same issue, so feel free to direct me elsewhere in order to avoid unrelated noise on that issue (I can even reach out on the k8s Slack if it makes more sense to bring it up there).
For the record, here's a full trace:

➜  ~ podman machine init
Extracting compressed file
➜  ~ podman machine start
INFO[0000] waiting for clients...
INFO[0000] listening tcp://0.0.0.0:7777
INFO[0000] new connection from  to /var/folders/3b/fs1dxw3d72n197yl2p9mzgrc0000gp/T/podman/qemu_podman-machine-default.sock
Waiting for VM ...
Machine "podman-machine-default" started successfully
➜  ~ podman machine list
NAME                     VM TYPE     CREATED             LAST UP            CPUS        MEMORY      DISK SIZE
podman-machine-default*  qemu        About a minute ago  Currently running  1           2.147GB     10.74GB
➜  ~ podman machine ssh
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
Warning: Permanently added '[localhost]:60413' (ECDSA) to the list of known hosts.
Fedora CoreOS 34.20211004.2.0
Tracker: https://github.com/coreos/fedora-coreos-tracker
Discuss: https://discussion.fedoraproject.org/c/server/coreos/

[core@localhost ~]$ sudo lsmod |grep ip6
[core@localhost ~]$ sudo modprobe -v ip6_tables
insmod /lib/modules/5.14.9-200.fc34.x86_64/kernel/net/ipv6/netfilter/ip6_tables.ko.xz
[core@localhost ~]$ sudo lsmod |grep ip6
ip6_tables             36864  0
[core@localhost ~]$
logout
Connection to localhost closed.
➜  ~ KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster --name moshe-sysdig
using podman due to KIND_EXPERIMENTAL_PROVIDER
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 "moshe-sysdig" ...
 ✓ Ensuring node image (kindest/node:v1.21.1) 🖼
 ✓ Preparing nodes 📦
ERRO[0175] accept tcp [::]:60532: use of closed network connection
 ✗ Writing configuration 📜
ERROR: failed to create cluster: failed to generate kubeadm config content: failed to get kubernetes version from node: failed to get file: command "podman exec --privileged moshe-sysdig-control-plane cat /kind/version" failed with error: exit status 125
Command Output: Error: can only create exec sessions on running containers: container state improper

It seems like the container is failing to start for some reason

@aojea
Copy link
Contributor

aojea commented Oct 7, 2021

I'm going to close this issue to avoid more confusion, no worries about that.

Your error seems related to that #2445, AFAIK podman machine doesn't work
/close

@k8s-ci-robot
Copy link
Contributor

@aojea: Closing this issue.

In response to this:

I'm going to close this issue to avoid more confusion, no worries about that.

Your error seems related to that #2445, AFAIK podman machine doesn't work
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@lookcrabs
Copy link

lookcrabs commented Apr 4, 2023

After ugrading podman recently I have run into problems myself. When using the v1.21.2 kind node image that contains the proper iptables wrapper script I appear to be reverting to having similar issues.

$ podman run --hostname kind-control-plane --name kind-control-plane --label io.x-k8s.kind.role=control-plane --privileged --tmpfs /tmp --tmpfs /run --volume bf9ca67764a451fd098017594578ea5b2e35808047316865ed43bcbf89c649ba:/var:suid,exec,dev --volume /lib/modules:/lib/modules:ro --detach --tty --net kind --label io.x-k8s.kind.cluster=kind -e container=podman --publish=127.0.0.1:34813:6443/tcp -e KUBECONFIG=/etc/kubernetes/admin.conf kindest/node:v1.21.2
ERRO[0002] error loading cached network config: network "kind" not found in CNI cache
WARN[0002] falling back to loading from existing plugins on disk
ERRO[0003] Error tearing down partially created network namespace for container 8779c1e9e30e664da84cc7d40537a104b44f99cffa07c44ed4354ce2d9644f34: error removing pod kind-control-plane_kind-control-plane from CNI network "kind": running [/usr/bin/iptables -t nat -D POSTROUTING -s 10.88.2.13 -j CNI-60d270dcc022372e968c855b -m comment --comment name: "kind" id: "8779c1e9e30e664da84cc7d40537a104b44f99cffa07c44ed4354ce2d9644f34" --wait]: exit status 2: iptables v1.8.7 (legacy): Couldn't load target `CNI-60d270dcc022372e968c855b':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
Error: error configuring network namespace for container 8779c1e9e30e664da84cc7d40537a104b44f99cffa07c44ed4354ce2d9644f34: error adding pod kind-control-plane_kind-control-plane to CNI network "kind": failed to list chains: running [/usr/bin/ip6tables -t nat -S --wait]: exit status 3: modprobe: ERROR: could not insert 'ip6_tables': Operation not permitted
ip6tables v1.8.7 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.

Sorry for replying to closed issue:

I'm just replying here as this is where google sent me when googling modprobe: ERROR: could not insert 'ip6_tables': Operation not permitted when trying to start kind with podman. Just sudo to root and run modprobe ip6_tables and retry and it works for me.

kind version 0.18.0
kindest/node:v1.26.3
podman version 4.4.4

@anquegi
Copy link

anquegi commented Jul 22, 2024

weird, are you using fedora? it is complaining about the kernel module for ip6ables, you have to load it

sudo modprobe -v ip6_tables
insmod /lib/modules/5.4.132-1.el8.elrepo.x86_64/kernel/net/ipv6/netfilter/ip6_tables.ko.xz 
$ sudo lsmod | grep ip6
ip6_tables             36864  0

Thanks this also worked on my Arch based manjaro distribution:
Linux toni-lenovo 6.6.40-1-MANJARO #1 SMP PREEMPT_DYNAMIC Mon Jul 15 21:39:34 UTC 2024 x86_64 GNU/Linux

before that I always get this error:

Running as unit: run-r9d78fe6f7d724821966320bfa0ad883f.scope; invocation ID: 6ac9776d5359466c8d08b096b8789b4e
enabling experimental podman provider
Creating cluster "ap-dev" ...
 ✓ Ensuring node image (kindest/node:v1.24.17) 🖼
 ✗ Preparing nodes 📦 📦  
Deleted nodes: ["ap-dev-control-plane" "ap-dev-worker"]
ERROR: failed to create cluster: command "podman run --name ap-dev-control-plane --hostname ap-dev-control-plane --label io.x-k8s.kind.role=control-plane --privileged --tmpfs /tmp --tmpfs /run --volume ca7840d0a1290e25775a5133085ddf5d2d59733f74ce584ba8217c90ab9bd8eb:/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=ap-dev -e container=podman --cgroupns=private --device /dev/fuse --publish=127.0.0.1:38561:6443/tcp -e KUBECONFIG=/etc/kubernetes/admin.conf docker.io/kindest/node@sha256:bad10f9b98d54586cba05a7eaa1b61c6b90bfc4ee174fdc43a7b75ca75c95e51" failed with error: exit status 126
Command Output: Error: netavark: code: 3, msg: modprobe: ERROR: could not insert 'ip6_tables': Operation not permitted
ip6tables v1.8.10 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.

Then I follow the tip and it worked pretty well:

sudo modprobe -v ip6_tables                                                
[sudo] contrasenya per a toni: 
insmod /lib/modules/6.6.40-1-MANJARO/kernel/net/ipv6/netfilter/ip6_tables.ko.zst 
$ sudo lsmod | grep ip6                                                      ✔  3s  
ip6_tables             36864  0
x_tables               65536  2 ip6_tables,ip_tables
$ make create_kind_cluster                                                        

kind create cluster --name ap-dev --config kind.ap-dev.yml
enabling experimental podman provider
Creating cluster "ap-dev" ...
 ✓ Ensuring node image (kindest/node:v1.24.17) 🖼
 ✓ Preparing nodes 📦 📦  
 ✓ Writing configuration 📜 
 ✓ Starting control-plane 🕹 
 ✓ Installing CNI 🔌 
 ✓ Installing StorageClass 💾 
 ✓ Joining worker nodes 🚜 
Set kubectl context to "kind-ap-dev"
You can now use your cluster with:

kubectl cluster-info --context kind-ap-dev

Have a nice day! 👋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/provider/podman Issues or PRs related to podman kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests