Skip to content

Commit 9519988

Browse files
Add blog enabling-seamless-ipv4-to-dual-stack-migration-for-kubernetes-clusters-on-gcp
1 parent d7546bf commit 9519988

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "Enabling Seamless IPv4 to Dual-Stack Migration for Kubernetes Clusters on GCP"
3+
linkTitle: "Enabling Seamless IPv4 to Dual-Stack Migration for Kubernetes Clusters on GCP"
4+
newsSubtitle: June 18, 2025
5+
publishdate: 2025-06-18
6+
authors:
7+
- avatar: https://avatars.githubusercontent.com/DockToFuture
8+
9+
login: DockToFuture
10+
name: Sebastian Stauch
11+
aliases: ["/blog/2025/06/18/enabling-seamless-ipv4-to-dual-stack-migration-for-kubernetes-clusters-on-gcp"]
12+
---
13+
14+
Gardener continues to enhance its networking capabilities, now offering a streamlined migration path for existing IPv4-only shoot clusters on Google Cloud Platform (GCP) to a dual-stack (IPv4 and IPv6) configuration. This allows clusters to leverage the benefits of IPv6 networking while maintaining IPv4 compatibility.
15+
16+
### The Shift to Dual-Stack: What Changes?
17+
18+
Transitioning a Gardener-managed Kubernetes cluster on GCP from a single-stack IPv4 to a dual-stack setup involves several key modifications to the underlying infrastructure and networking configuration.
19+
20+
#### Triggering the Migration
21+
The migration process is initiated by updating the shoot specification. Users simply need to add `IPv6` to the `spec.networking.ipFamilies` field, changing it from `[IPv4]` to `[IPv4, IPv6]`.
22+
23+
#### Infrastructure Adaptations
24+
Once triggered, Gardener orchestrates the necessary infrastructure changes on GCP:
25+
* **IPv6-Enabled Subnets:** The existing node and internal subnets within the Virtual Private Cloud (VPC) are assigned external IPv6 ranges.
26+
* **New IPv6 Service Subnet:** A new subnet is provisioned specifically for services, also equipped with an external IPv6 range.
27+
* **Secondary IPv4 Range for Nodes:** The node subnet is allocated an additional (secondary) IPv4 range. This is crucial as dual-stack load balancing on GCP, often managed via `ingress-gce`, utilizes alias IP ranges for pods, which are derived from such secondary ranges.
28+
29+
#### Enhanced Pod Routing on GCP
30+
A significant change occurs in how pod traffic is routed. In the IPv4-only setup (especially with native routing), the Cloud Controller Manager (CCM) creates individual routes in the VPC route table for each node's pod CIDR. During the migration to dual-stack:
31+
* These existing pod-specific cloud routes are systematically deleted from the VPC routing table.
32+
* To maintain connectivity and prepare for the dual-stack CNI, these routes are effectively replaced by adding corresponding alias IP ranges directly to the network interface controllers (NICs) of the Kubernetes worker nodes (VM instances).
33+
34+
### The Migration Journey
35+
36+
The migration is a multi-phase process, tracked by a `DualStackNodesMigrationReady` constraint in the shoot's status, which remains `False` until all nodes are successfully updated.
37+
38+
* **Phase 1: Infrastructure Preparation**
39+
Immediately after the `ipFamilies` field is updated, an infrastructure reconciliation begins. This phase includes the subnet modifications mentioned above. A critical step here is the transition from VPC routes to alias IP ranges for existing nodes. The system carefully manages the deletion of old routes and the creation of new alias IP ranges on the node instances to ensure a smooth transition. Information about the routes to be migrated is temporarily persisted during this step.
40+
41+
* **Phase 2: Node Upgrades**
42+
For nodes to become dual-stack aware (i.e., receive IPv4 and IPv6 addresses for themselves and their pods), they need to be rolled out. This can happen during the next scheduled Kubernetes version update or can be expedited by manually deleting the nodes, allowing Gardener to recreate them with the new dual-stack configuration. Once all nodes have been updated and possess both IPv4 and IPv6 pod CIDRs, the `DualStackNodesMigrationReady` constraint will change to `True`.
43+
44+
* **Phase 3: Finalizing Dual-Stack Activation**
45+
With the infrastructure and nodes prepared, the final step involves configuring the remaining control plane components (like kube-apiserver service CIDRs) and the Container Network Interface (CNI) plugin (e.g., Calico) for dual-stack operation. After these components are fully dual-stack enabled, the migration constraint is removed, and the cluster operates in a full dual-stack mode. Pods will then be assigned both IPv4 and IPv6 addresses.
46+
47+
### Important Considerations for GCP Users
48+
49+
Before initiating the migration, please note the following:
50+
* **Native Routing Prerequisite:** The IPv4-only cluster must be operating in native routing mode. This means the pod overlay network needs to be disabled.
51+
* **GCP Route Quotas:** When using native routing, especially for larger clusters, be mindful of GCP's default quota for static routes per VPC (often 200, referred to as `STATIC_ROUTES_PER_NETWORK`). It might be necessary to request a quota increase via the GCP cloud console before enabling native routing or migrating to dual-stack to avoid hitting limits.
52+
* **IPv6-Only Not Supported on GCP:** Currently, GCP supports migrating to dual-stack (IPv4 and IPv6). IPv6-only shoot clusters are not an option on GCP through this migration path.
53+
54+
This enhancement provides a clear path for Gardener users on GCP to adopt IPv6, paving the way for future-ready network architectures.
55+
56+
For further details, you can refer to the [official pull request](https://github.com/gardener/gardener-extension-provider-gcp/pull/1010) and the [relevant segment of the developer talk](https://youtu.be/HguO_KY86ac?t=82). Additional documentation can also be found within the [Gardener documentation](https://gardener.cloud/docs/gardener/networking/dual-stack-networking-migration/).

0 commit comments

Comments
 (0)