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

Docker integration create network got error invalid network config #1949

Open
aleccai8 opened this issue Apr 18, 2024 · 1 comment
Open

Docker integration create network got error invalid network config #1949

aleccai8 opened this issue Apr 18, 2024 · 1 comment

Comments

@aleccai8
Copy link

Expected Behavior

network should create sucessfully

Current Behavior

root@docker:~/daemonset# docker network create --attachable=true --subnet=${FLANNEL_SUBNET} -o "com.docker.network.driver.mtu"=${FLANNEL_MTU} flannel
Error response from daemon: invalid network config:
invalid subnet 10.0.35.1/24: it should be 10.0.35.0/24

Steps to Reproduce (for bugs)

Context

flannel logs:
I0418 21:49:50.510214 90815 main.go:210] CLI flags config: {etcdEndpoints:http://127.0.0.1:4001,http://127.0.0.1:2379 etcdPrefix:/coreos.com/network etcdKeyfile: etcdCertfile: etcdCAFile: etcdUsername: etcdPassword: version:false kubeSubnetMgr:false kubeApiUrl: kubeAnnotationPrefix:flannel.alpha.coreos.com kubeConfigFile: iface:[] ifaceRegex:[] ipMasq:false ifaceCanReach: subnetFile:/run/flannel/subnet.env publicIP: publicIPv6: subnetLeaseRenewMargin:60 healthzIP:0.0.0.0 healthzPort:0 iptablesResyncSeconds:5 iptablesForwardRules:true netConfPath:/etc/kube-flannel/net-conf.json setNodeNetworkUnavailable:true} W0418 21:49:50.510914 90815 main.go:530] no subnet found for key: FLANNEL_IPV6_SUBNET in file: /run/flannel/subnet.env W0418 21:49:50.511178 90815 registry.go:84] no certificate provided: connecting to etcd with http. This is insecure I0418 21:49:50.513636 90815 main.go:230] Created subnet manager: Etcd Local Manager with Previous Subnet: 10.0.35.0/24 I0418 21:49:50.513667 90815 main.go:233] Installing signal handlers I0418 21:49:50.517323 90815 main.go:442] Found network config - Backend type: vxlan I0418 21:49:50.517368 90815 match.go:210] Determining IP address of default interface I0418 21:49:50.518324 90815 match.go:263] Using interface with name eth0 and address 192.168.2.6 I0418 21:49:50.518363 90815 match.go:285] Defaulting external address to interface address (192.168.2.6) I0418 21:49:50.518441 90815 vxlan.go:141] VXLAN config: VNI=1 Port=0 GBP=false Learning=false DirectRouting=false I0418 21:49:50.521383 90815 local_manager.go:154] Found lease (ip: 10.0.35.0/24 ipv6: ::/0) for current IP (192.168.2.6), reusing I0418 21:49:50.524366 90815 main.go:567] Starting flannel in iptables mode I0418 21:49:50.524412 90815 iptables.go:224] Changing default FORWARD chain policy to ACCEPT I0418 21:49:50.533041 90815 main.go:386] Wrote subnet file to /run/flannel/subnet.env I0418 21:49:50.533075 90815 main.go:390] Running backend. I0418 21:49:50.533153 90815 vxlan_network.go:65] watching for new subnet leases I0418 21:49:50.535157 90815 registry.go:291] registry: watching subnets starting from rev 10 I0418 21:49:50.535195 90815 local_manager.go:318] manager.WatchLease: sending reset results... I0418 21:49:50.535273 90815 local_manager.go:395] Waiting for 22h59m58.999911093s to renew lease I0418 21:49:50.569849 90815 iptables.go:370] bootstrap done

Your Environment

  • Flannel version: v0.25.1
  • Backend used (e.g. vxlan or udp): vxlan
  • Etcd version: 3.5.13
  • Kubernetes version (if used):
  • Operating System and version: Linux docker 6.5.11-8-pve write a prototype :) #1 SMP PREEMPT_DYNAMIC PMX 6.5.11-8 (2024-01-30T12:27Z) x86_64 GNU/Linux
  • Link to your project (optional):
@aleccai8 aleccai8 changed the title Docker integration create network got error invalid network config: Docker integration create network got error invalid network config Apr 18, 2024
@rbrtbnfgl
Copy link
Contributor

It seems that Docker doesn't like the subnet specified with the first address. You could try to edit /run/flannel/subnet.env and change 10.0.35.1/24 with 10.0.35.0/24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants