Skip to content

[Backport release-1.6] fix(cilium)!: take cilium's own addresses from a block kube-ovn does not hand out - #4918

Merged
myasnikovdaniil merged 3 commits into
release-1.6from
backport-4778-to-release-1.6
Oct 14, 2026
Merged

myasnikovdaniil merged 3 commits into
release-1.6from
backport-4778-to-release-1.6

Conversation

@myasnikovdaniil

Copy link
Copy Markdown
Contributor

What this PR does

Backport of #4778 to release-1.6, fixes #3740 on the 1.6 line.

On the kube-ovn variants (isp-full, isp-full-generic) cilium allocates no pod IPs, but it still takes its router IP and the Gateway API ingress IP from Node.spec.podCIDR, a /24 out of the same range kube-ovn hands pods from, so sooner or later kube-ovn gives a pod an address cilium already holds. With this change cilium runs ipam.mode: cluster-pool with a /29 per node out of the last /21 of networking.podCIDR, platform passes the same range to kube-ovn as --default-exclude-ips, and a post-upgrade hook in the cilium chart moves existing clusters. Mechanism and hook steps are the same as in #4778, its description has the details.

This is breaking for a patch release, please read before merging:

  • networking.podCIDR has to be /20 or wider on the kube-ovn variants, otherwise platform refuses to render and the upgrade stops before anything changes. Widening the value later doesn't help, the hook refuses a block outside the subnet the cluster was installed with.
  • A /21 of /29s caps these variants at 256 nodes.
  • Every cilium agent restarts twice, once for the config change and once in the hook. While the cilium release is failed, packages that depend on networking wait for it.
  • If kube-ovn already handed out an address from the last /21, the hook names that address and stops before it moves any node. Recreate the pods holding it and the next retry goes through.
  • Rolling back to 1.6.4 brings ipam.mode: kubernetes back, agents take their /24 again, and the exclusions stay in ovn-default.

Differences from #4778

  • No slim variants on release-1.6, so the cozystack.platform.slim gate is gone and the pool is wired in the isp-full and isp-full-generic branches only. isp-hosted renders noop and is not touched.
  • The code around the wiring in system.yaml is release-1.6's (no gateway.http2, no networking.encryption, the older cozystack.platform.package call).
  • The wiring test for isp-slim is left out of the cherry-pick, the second commit adds one for isp-hosted with a /24 pod CIDR, which has to keep rendering without the /20 requirement.
  • packages/system/cilium has no make test target here, so hack/helm-unit-tests.sh would skip the new suite without a word. The third commit adds it.
  • The follow-up from main that loads test_helper in hack/cilium-ipam-migration.bats is not applied. release-1.6 has no hack/test_helper.bash and runs hack/*.bats through hack/cozytest.sh, with that line the file doesn't load.
  • release-1.6 ships kube-ovn v1.15.10, fix(cilium)!: take cilium's own addresses from a block kube-ovn does not hand out #4778 was written against v1.15.26.

Validation

  • helm unittest: cilium 11/11, platform 113/113 with [Backport release-1.6] fix(cert-manager): enable the Gateway API solver in the host cert-manager #4808 merged. hack/cilium-ipam-migration.bats passes 27/27 through hack/cozytest.sh.
  • Live hook run on a three-node Talos cluster with kube-ovn v1.15.10. I put cilium on the release-1.6 chart first, then upgraded to this branch with helm upgrade (operator stopped, HelmRelease suspended). A pod pinned to 10.244.250.10 made the hook add the block and the old ingress IPs to excludeIps of ovn-default, name that address and stop before moving any node. After deleting the pod the same upgrade moved all three nodes to /29s from 10.244.248.0/21, router and ingress IPs inside. The available range of the subnet ends at 10.244.247.255, no pod IP is duplicated, and pod to pod across nodes, DNS and a ping to a VM pod IP work. A third run of the same upgrade restarted nothing and left the CIDRs as they were.
  • Rolling the release back on that cluster returned the agents to their /24s with new ingress IPs, and excludeIps stayed until I patched it by hand.
  • Not run: the upgrade through the operator, the generic variant, Gateway API traffic (no gateway on that cluster). kube-ovn still admits a pod with a static ovn.kubernetes.io/ip_address inside the block after the migration, the hook looks at it only while migrating.

Downstream repositories

The website note for this change is cozystack/website#739, merged for docs/next. The v1.6 docs need the same note, not opened yet, so the box stays empty.

Release note

fix(cilium)!: on the kube-ovn variants cilium now takes its router and gateway api ingress ips from the last /21 of networking.podCIDR, which kube-ovn no longer hands out, so pods stop landing on addresses cilium holds. existing clusters move on upgrade through a post-upgrade hook, and each cilium agent restarts twice, once for the config change and once in the hook. networking.podCIDR needs /20 or wider on these variants, and a /21 of /29s caps them at 256 nodes.

@github-actions github-actions Bot added area/cilium Issues or PRs related to Cilium (agent, operator, Gateway API, network policy, LB-IPAM) area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/breaking-change Indicates the change introduces a breaking API or behaviour change kind/bug Categorizes issue or PR as related to a bug size/XXL This PR changes 1000+ lines, ignoring generated files labels Oct 14, 2026
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: cozystack/cozystack/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 382fa661-a74f-475c-b994-0d8498889ce6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…not hand out

On the kube-ovn variants Cilium allocates no pod addresses, but the agent
still takes its router IP and the Gateway API Ingress IP from its
allocation CIDR. In ipam.mode kubernetes that is Node.spec.podCIDR, which
the documented installs slice from the same range kube-ovn allocates pods
from, so kube-ovn sooner or later hands a pod an address Cilium already
holds.

Cilium now runs ipam.mode cluster-pool on the kube-ovn variants, with a
/29 per node from the last /21 of networking.podCIDR, and kube-ovn
excludes that /21 through --default-exclude-ips. The block stays inside
the pod CIDR on purpose. Envoy reaches Gateway API backends from the
node's Ingress IP, and kube-ovn masquerades host-originated traffic only
when the source lies in one of its subnets, so a block outside them such
as 100.65.0.0/16 breaks Gateway API traffic that crosses nodes.

A post-upgrade hook moves existing clusters. It first checks that the
block has a /29 for every node and lies inside kube-ovn's default
subnet, and stops without changing anything otherwise. It adds the block
and every node's current Ingress IP to excludeIps of that subnet,
because the agent keeps a former Ingress IP in its ipcache as
reserved:ingress. It then waits until kube-ovn stops offering the block
and stops if an address in it is still allocated. kube-ovn leaves
excluded addresses out of the subnet status, so that check reads its IP
objects. Then, one node at a time, it clears the inherited /24 from the
CiliumNode, waits for the operator to allocate from the block and
restarts the agent.

networking.podCIDR now needs a prefix of /20 or shorter on the kube-ovn
variants, and the render fails otherwise. A /21 cut into /29s also caps
these variants at 256 nodes.

Assisted-by: LLM
Signed-off-by: Yan Bondarenko <[email protected]>
(cherry picked from commit dc362fa)
Signed-off-by: Myasnikov Daniil <[email protected]>
…6 has

The cherry-pick leaves out main's case for the slim variants, which
release-1.6 does not have, so that commit's suite stays green on its
own. isp-hosted is the one system variant here without kube-ovn, and
the /20 requirement must not reach it, so the case renders it with a
pod CIDR the kube-ovn variants refuse.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <[email protected]>
hack/helm-unit-tests.sh picks the packages it tests by probing for a
make test target, and the cilium package had none, so make unit-tests
and CI would skip the IPAM pool suite this package now carries without
saying so.

Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <[email protected]>
@myasnikovdaniil
myasnikovdaniil force-pushed the backport-4778-to-release-1.6 branch from e810c41 to c9c21bb Compare October 14, 2026 11:32
@myasnikovdaniil
myasnikovdaniil merged commit 6688ddf into release-1.6 Oct 14, 2026
14 of 15 checks passed
@myasnikovdaniil
myasnikovdaniil deleted the backport-4778-to-release-1.6 branch October 14, 2026 14:38
myasnikovdaniil added a commit to cozystack/website that referenced this pull request Oct 16, 2026
…ilium on v1.6 (#759)

The same note is in `next/` since #739. v1.6.5 carries the change from
cozystack/cozystack#4918, so the v1.6 page needs it too. Variant names
are the ones v1.6 has (`isp-full`, `isp-full-generic`), there are no
slim variants on this line.

The limit does not exist on v1.6.4, so merge this after v1.6.5 is
published, same as the generated apps reference PR (#758).
xrmtech-isk pushed a commit to katamarina-ru/cozystack-website that referenced this pull request Oct 26, 2026
…ilium on v1.6

The same note has been in next/ since cozystack#739. v1.6.5 carries the change (cozystack/cozystack#4918), so the v1.6 page needs it too, with the variant names this release has.

Signed-off-by: Myasnikov Daniil <[email protected]>
Assisted-by: LLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cilium Issues or PRs related to Cilium (agent, operator, Gateway API, network policy, LB-IPAM) area/release Issues or PRs related to release tooling (changelog, backport, release pipeline) kind/breaking-change Indicates the change introduces a breaking API or behaviour change kind/bug Categorizes issue or PR as related to a bug size/XXL This PR changes 1000+ lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants