Add support for multiple IP addresses in `cni.projectcalico.org/ipAddrs`
Author: mikhail-manuilovCreated Nov 13, 2017Updated Sep 25, 2026
Labelshelp wantedkind/enhancementtriage/eternal
I got normal functioning kubernetes in azure 1.7.9 using calico cni 2.6.1.
I've created several pod with no issues (nginx ingress related).
But when I tried to create main application (parity) StatefulSet and used
EDITED:
annotations:
"cni.projectcalico.org/ipAddrs": "[\"10.244.3.251\", \"10.244.3.252\", \"10.244.3.253\" ]"I got error on first pod Pod sandbox changed, it will be killed and re-created.
Without annotation everything is fine and works as expected.
Expected Behavior
I got StatefulSet with pods each has static IP from supplied range in annotation according to https://docs.projectcalico.org/v2.1/reference/cni-plugin/configuration#requesting-a-specific-ip-address
Current Behavior
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
2m 2m 1 default-scheduler Normal Scheduled Successfully assigned parity-0 to k8s-agentpool1-23076979-1
2m 2m 1 kubelet, k8s-agentpool1-23076979-1 Normal SuccessfulMountVolume MountVolume.SetUp succeeded for volume "pvc-c88fc265-c889-11e7-9136-000d3a236c5e"
2m 1s 40 kubelet, k8s-agentpool1-23076979-1 Warning FailedSync Error syncing pod
2m 1s 40 kubelet, k8s-agentpool1-23076979-1 Normal SandboxChanged Pod sandbox changed, it will be killed and re-created.Possible Solution
Steps to Reproduce (for bugs)
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
labels:
app: myapp
name: myapp
namespace: default
spec:
replicas: 3
serviceName: myapp-svc
template:
metadata:
labels:
app: myapp
annotations:
"cni.projectcalico.org/ipAddrs": "[\"10.244.3.251\", \"10.244.3.252\", \"10.244.3.253\" ]"I've checked differrent subnets (pods are running in 10.244/16 and 10.240/16 nets
Context
Your Environment
- Calico version 2.6.1
- Orchestrator version (e.g. kubernetes, mesos, rkt): kubernetes 1.7.9
- Operating System and version: ubuntu 16.04.3 LTS 4.11.0-1014-azure
- Link to your project (optional):
Source: projectcalico/calico