You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IPv4/IPv6 dual-stack enables the allocation of both IPv4 and IPv6 addresses to {{< glossary_tooltip text="Pods" term_id="pod" >}} and {{< glossary_tooltip text="Services" term_id="service" >}}.
21
+
IPv4/IPv6 dual-stack networking enables the allocation of both IPv4 and IPv6 addresses to {{< glossary_tooltip text="Pods" term_id="pod" >}} and {{< glossary_tooltip text="Services" term_id="service" >}}.
22
22
23
-
If you enable IPv4/IPv6 dual-stack networking for your Kubernetes cluster, the cluster will support the simultaneous assignment of both IPv4 and IPv6 addresses.
23
+
IPv4/IPv6 dual-stack networking is enabled by default for your Kubernetes cluster starting in 1.21, allowing the simultaneous assignment of both IPv4 and IPv6 addresses.
24
24
25
25
26
26
27
27
<!-- body -->
28
28
29
29
## Supported Features
30
30
31
-
Enabling IPv4/IPv6 dual-stack on your Kubernetes cluster provides the following features:
31
+
IPv4/IPv6 dual-stack on your Kubernetes cluster provides the following features:
32
32
33
33
* Dual-stack Pod networking (a single IPv4 and IPv6 address assignment per Pod)
34
34
* IPv4 and IPv6 enabled Services
@@ -45,34 +45,34 @@ The following prerequisites are needed in order to utilize IPv4/IPv6 dual-stack
45
45
* Provider support for dual-stack networking (Cloud provider or otherwise must be able to provide Kubernetes nodes with routable IPv4/IPv6 network interfaces)
46
46
* A network plugin that supports dual-stack (such as Kubenet or Calico)
47
47
48
-
## Enable IPv4/IPv6 dual-stack
48
+
## Configure IPv4/IPv6 dual-stack
49
49
50
-
To enable IPv4/IPv6 dual-stack, enable the `IPv6DualStack`[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for the relevant components of your cluster, and set dual-stack cluster network assignments:
50
+
To use IPv4/IPv6 dual-stack, ensure the `IPv6DualStack`[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled for the relevant components of your cluster. (Starting in 1.21, IPv4/IPv6 dual-stack defaults to enabled.)
51
+
52
+
To configure IPv4/IPv6 dual-stack, set dual-stack cluster network assignments:
*`--node-cidr-mask-size-ipv4|--node-cidr-mask-size-ipv6` defaults to /24 for IPv4 and /64 for IPv6
60
-
* kubelet:
61
-
*`--feature-gates="IPv6DualStack=true"`
62
60
* kube-proxy:
63
61
*`--cluster-cidr=<IPv4 CIDR>,<IPv6 CIDR>`
64
-
*`--feature-gates="IPv6DualStack=true"`
65
62
66
63
{{< note >}}
67
64
An example of an IPv4 CIDR: `10.244.0.0/16` (though you would supply your own address range)
68
65
69
66
An example of an IPv6 CIDR: `fdXY:IJKL:MNOP:15::/64` (this shows the format but is not a valid address - see [RFC 4193](https://tools.ietf.org/html/rfc4193))
70
67
68
+
Starting in 1.21, IPv4/IPv6 dual-stack defaults to enabled.
69
+
You can disable it when necessary by specifying `--feature-gates="IPv6DualStack=false"`
70
+
on the kube-apiserver, kube-controller-manager, kubelet, and kube-proxy command line.
71
71
{{< /note >}}
72
72
73
73
## Services
74
74
75
-
If your cluster has dual-stack enabled, you can create {{< glossary_tooltip text="Services" term_id="service" >}} which can use IPv4, IPv6, or both.
75
+
You can create {{< glossary_tooltip text="Services" term_id="service" >}} which can use IPv4, IPv6, or both.
76
76
77
77
The address family of a Service defaults to the address family of the first service cluster IP range (configured via the `--service-cluster-ip-range` flag to the kube-apiserver).
78
78
@@ -81,11 +81,9 @@ set the `.spec.ipFamilyPolicy` field to one of the following values:
81
81
82
82
*`SingleStack`: Single-stack service. The control plane allocates a cluster IP for the Service, using the first configured service cluster IP range.
83
83
*`PreferDualStack`:
84
-
* Only used if the cluster has dual-stack enabled. Allocates IPv4 and IPv6 cluster IPs for the Service
85
-
* If the cluster does not have dual-stack enabled, this setting follows the same behavior as `SingleStack`.
84
+
* Allocates IPv4 and IPv6 cluster IPs for the Service. (If the cluster has `--feature-gates="IPv6DualStack=false"`, this setting follows the same behavior as `SingleStack`.)
86
85
*`RequireDualStack`: Allocates Service `.spec.ClusterIPs` from both IPv4 and IPv6 address ranges.
87
86
* Selects the `.spec.ClusterIP` from the list of `.spec.ClusterIPs` based on the address family of the first element in the `.spec.ipFamilies` array.
88
-
* The cluster must have dual-stack networking configured.
89
87
90
88
If you would like to define which IP family to use for single stack or define the order of IP families for dual-stack, you can choose the address families by setting an optional field, `.spec.ipFamilies`, on the Service.
91
89
@@ -126,7 +124,7 @@ These examples demonstrate the behavior of various dual-stack Service configurat
126
124
127
125
#### Dual-stack defaults on existing Services
128
126
129
-
These examples demonstrate the default behavior when dual-stack is newly enabled on a cluster where Services already exist.
127
+
These examples demonstrate the default behavior when dual-stack is newly enabled on a cluster where Services already exist. (Upgrading an existing cluster to 1.21 will enable dual-stack unless `--feature-gates="IPv6DualStack=false"` is set.)
130
128
131
129
1. When dual-stack is enabled on a cluster, existing Services (whether `IPv4` or `IPv6`) are configured by the control plane to set `.spec.ipFamilyPolicy` to `SingleStack` and set `.spec.ipFamilies` to the address family of the existing Service. The existing Service cluster IP will be stored in `.spec.ClusterIPs`.
0 commit comments