-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
current kind does not seem to support netavark backed rootless podman(4.x+) #2882
Comments
Are you sure this is Netavark-specific? My understanding is that Podman 4.0 uses the new inspect format for every network. Basically, everything pre-4.0 did not bother to format the output of inspect at all, so we just print the literal CNI config file. 4.0 and up parse the network's information and output Docker-compatible inspect JSON. This is a breaking change, hence the major release bump (among other things). We do not foresee the format changing any more, we're satisfied with where 4.0 left us. |
Thanks a lot for clarification @mheon ! It makes sense indeed. So that's a generic change related to a v4.x bump and the network inspect layout. @aojea : in this light I'd say my fix with covering both layouts(pre v4.x and the current) makes a lot of sense. It is backwards compatible, so we should not upset anyone here. |
awesome
we have already some pre and post 4.0 checks and behavior
|
@aojea : would you prefer to be explicit in this context or accommodate both layouts transparently and without mentioning the version? Both options are feasible. |
I would prefer to be explicit so we can delete the old code once 3.x version is EOL |
Thanks everyone, I don't think it should be a problem to support these and the direction to use docker compatible structs makes sense. The patch supported by @wherka-ama looks a great starting point. I hope someone's already brought this up, but the CNI binaries being removed (?) on upgrade in fedora with existing networks still trying to use CNI seems problematic #2821, is there something we can point users to for this? I've been slammed switching roles / job and I know Antonio has been busy too, we're clearly behind on these changes on our end. |
Support for netavark backed podman(4.x+) - fixing #2882
What happened:
Failure during the cluster creation.
$ /usr/bin/kind create cluster --name test3
enabling experimental podman provider
Creating cluster "test3" ...
✓ Ensuring node image (kindest/node:v1.24.0) 🖼
✓ Preparing nodes 📦
panic: runtime error: index out of range [0] with length 0
goroutine 1 [running]:
sigs.k8s.io/kind/pkg/cluster/internal/providers/podman.getSubnets({0x77d9fb?, 0x7a6280?})
sigs.k8s.io/kind/pkg/cluster/internal/providers/podman/provision.go:275 +0x199
sigs.k8s.io/kind/pkg/cluster/internal/providers/podman.getProxyEnv(0x77db16?, {0x77d9fb, 0x4})
What you expected to happen:
Cluster created successfully
How to reproduce it (as minimally and precisely as possible):
The problem can be recreated on any rootless installation with podman backed with netavark. The key here is the output structure produced by
podman network inspect kind
. In older version of podman, where the CNI plugin was used the subnets where displayed as[n]plugins[n].ipam.ranges[n][m].subnet
while in a netavark it's more like[n].subnets[n].subnet
Examples:
*** cni:
*** netavark:
Anything else we need to know?:
I've already modified the
podman.getSubnets
to be more flexible and to support both layouts. Everything works as expected. I'm happy to propose such implementation as a PR.Environment:
kind version: (use
kind version
):0.14.0
Kubernetes version: (use
kubectl version
):Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.3", GitCommit:"aef86a93758dc3cb2c658dd9657ab4ad4afc21cb", GitTreeState:"clean", BuildDate:"2022-07-13T14:30:46Z", GoVersion:"go1.18.3", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Unable to connect to the server: dial tcp 10.xxx:443: i/o timeout
Docker version: (use
docker info
):host:
arch: amd64
buildahVersion: 1.24.1
cgroupControllers:
cgroupManager: systemd
cgroupVersion: v2
conmon:
package: conmon-2.1.0-1.module+el8.6.0+14877+f643d2d6.x86_64
path: /usr/bin/conmon
version: 'conmon version 2.1.0, commit: 87b7a9037cbd1d81288bdf2d6705dfda889f7cf9'
cpus: 8
distribution:
distribution: '"rhel"'
version: "8.6"
eventLogger: file
hostname: xxx
idMappings:
gidmap:
host_id: 895
size: 1
host_id: 165536
size: 65536
uidmap:
host_id: 1000
size: 1
host_id: 165536
size: 65536
kernel: 4.18.0-372.16.1.el8_6.x86_64
linkmode: dynamic
logDriver: k8s-file
memFree: 23087063040
memTotal: 67530907648
networkBackend: netavark
ociRuntime:
name: runc
package: runc-1.0.3-2.module+el8.6.0+14877+f643d2d6.x86_64
path: /usr/bin/runc
version: |-
runc version 1.0.3
spec: 1.0.2-dev
go: go1.17.7
libseccomp: 2.5.2
os: linux
remoteSocket:
path: /run/user/1000/podman/podman.sock
security:
apparmorEnabled: false
capabilities: CAP_NET_RAW,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_CHROOT
rootless: true
seccompEnabled: true
seccompProfilePath: /usr/share/containers/seccomp.json
selinuxEnabled: false
serviceIsRemote: false
slirp4netns:
executable: /usr/bin/slirp4netns
package: slirp4netns-1.1.8-2.module+el8.6.0+14877+f643d2d6.x86_64
version: |-
slirp4netns version 1.1.8
commit: d361001f495417b880f20329121e3aa431a8f90f
libslirp: 4.4.0
SLIRP_CONFIG_VERSION_MAX: 3
libseccomp: 2.5.2
swapFree: 1073737728
swapTotal: 1073737728
uptime: 41h 21m 53.77s (Approximately 1.71 days)
plugins:
log:
network:
volume:
registries:
docker.io:
Blocked: false
Insecure: false
Location: dockerhub.xxx/registry-1-docker-io-remote
MirrorByDigestOnly: false
Mirrors: null
Prefix: docker.io
gcr.io:
Blocked: false
Insecure: false
Location: dockerhub.xxx/gcr-io-docker-remote
MirrorByDigestOnly: false
Mirrors: null
Prefix: gcr.io
mcr.microsoft.com:
Blocked: false
Insecure: false
Location: dockerhub.xxx/mcr-microsoft-com-docker-remote
MirrorByDigestOnly: false
Mirrors: null
Prefix: mcr.microsoft.com
quay.io:
Blocked: false
Insecure: false
Location: dockerhub.xxx/docker-quay-io-remote
MirrorByDigestOnly: false
Mirrors: null
Prefix: quay.io
registry.connect.redhat.com:
Blocked: false
Insecure: false
Location: dockerhub.xxx/docker-registry-connect-redhat-com-remote
MirrorByDigestOnly: false
Mirrors: null
Prefix: registry.connect.redhat.com
registry.redhat.io:
Blocked: false
Insecure: false
Location: dockerhub.xxx/docker-registry.access.redhat.com-remote
MirrorByDigestOnly: false
Mirrors: null
Prefix: registry.redhat.io
search:
store:
configFile: /home/xxx/.config/containers/storage.conf
containerStore:
number: 0
paused: 0
running: 0
stopped: 0
graphDriverName: overlay
graphOptions: {}
graphRoot: /home/xxx/.local/share/containers/storage
graphStatus:
Backing Filesystem: xfs
Native Overlay Diff: "true"
Supports d_type: "true"
Using metacopy: "false"
imageCopyTmpDir: /var/tmp
imageStore:
number: 2
runRoot: /run/user/1000/containers
volumePath: /home/xxx/.local/share/containers/storage/volumes
version:
APIVersion: 4.0.2
Built: 1650363392
BuiltTime: Tue Apr 19 10:16:32 2022
GitCommit: ""
GoVersion: go1.17.7
OsArch: linux/amd64
Version: 4.0.2
OS (e.g. from
/etc/os-release
):NAME="Red Hat Enterprise Linux"
VERSION="8.6 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
The text was updated successfully, but these errors were encountered: