Docker calico libnetwork driver (IPAM) is not getting IPs for containers, when I have created the network with the --subnet parameter.
docker run -ti --rm --net my-net nginx:alpine ip a
docker: Error response from daemon: IpamDriver.RequestAddress: Unexpected number of assigned IP addresses. A single address should be assigned. Got []
# calicoctl apply -f pool.yml
# calicoctl get ipPool -o yaml
- apiVersion: v1
kind: ipPool
metadata:
cidr: 172.16.0.0/16
spec: {}
# docker network create --driver calico --ipam-driver calico-ipam my-net
73b95eed1a35afaa4ea86f876c95a8eedbc5dd6495927856ce4f395e10473ca7
# docker run -ti --rm --net my-net nginx:alpine ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
28: cali0@if29: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
link/ether ee:ee:ee:ee:ee:ee brd ff:ff:ff:ff:ff:ff
inet 172.16.91.195/32 scope global cali0
valid_lft forever preferred_lft forever
inet6 fe80::ecee:eeff:feee:eeee/64 scope link tentative
valid_lft forever preferred_lft forever
# calicoctl apply -f pool.yml
# calicoctl get ipPool -o yaml
- apiVersion: v1
kind: ipPool
metadata:
cidr: 172.16.0.0/16
spec: {}
# docker network create --driver calico --ipam-driver calico-ipam --subnet 172.16.0.0/16 my-net
8380dda610353d9a2f761d54e0df53f7de88e2f37992e1cded699fabbcc2bd97
# docker run -ti --rm --net my-net nginx:alpine ip a
docker: Error response from daemon: IpamDriver.RequestAddress: Unexpected number of assigned IP addresses. A single address should be assigned. Got []
Client:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:23:11 2016
OS/Arch: linux/amd64
Server:
Version: 1.11.2
API version: 1.23
Go version: go1.5.4
Git commit: b9f10c9
Built: Wed Jun 1 21:23:11 2016
OS/Arch: linux/amd64
I had the same problem with calico-node 2.6.3. But 2.6.2 works well, JFYI
I've found the same problem, with the solution of @tungdam it works perfectly
I can confirm downgrading from 2.6.8 to 2.6.2 solved this problem for me as well.
Is this issue still not fixed? i've found the same problem with calico 2.6.5
@xiaolei0125 I'm not aware of any work that has been done to fix this.
If anyone knows the cause and would like to contribute a fix I'd be happy to review!
@caseydavenport I've done some digging and I think I've found a cause for this error, PR raised here: https://github.com/projectcalico/libnetwork-plugin/pull/179
Most helpful comment
I had the same problem with calico-node 2.6.3. But 2.6.2 works well, JFYI