@@ -1246,7 +1246,8 @@ someone else's choice. That is an isolation failure.
1246
1246
1247
1247
In order to allow you to choose a port number for your Services, we must
1248
1248
ensure that no two Services can collide. Kubernetes does that by allocating each
1249
- Service its own IP address.
1249
+ Service its own IP address from within the `service-cluster-ip-range`
1250
+ CIDR range that is configured for the API server.
1250
1251
1251
1252
To ensure each Service receives a unique IP, an internal allocator atomically
1252
1253
updates a global allocation map in {{< glossary_tooltip term_id="etcd" >}}
@@ -1260,6 +1261,25 @@ in-memory locking). Kubernetes also uses controllers to check for invalid
1260
1261
assignments (eg due to administrator intervention) and for cleaning up allocated
1261
1262
IP addresses that are no longer used by any Services.
1262
1263
1264
+ # ### IP address ranges for `type: ClusterIP` Services {#service-ip-static-sub-range}
1265
+
1266
+ {{< feature-state for_k8s_version="v1.24" state="alpha" >}}
1267
+ However, there is a problem with this `ClusterIP` allocation strategy, because a user
1268
+ can also [choose their own address for the service](#choosing-your-own-ip-address).
1269
+ This could result in a conflict if the internal allocator selects the same IP address
1270
+ for another Service.
1271
+
1272
+ If you enable the `ServiceIPStaticSubrange`
1273
+ [feature gate](/docs/reference/command-line-tools-reference/feature-gates/),
1274
+ the allocation strategy divides the `ClusterIP` range into two bands, based on
1275
+ the size of the configured `service-cluster-ip-range` by using the following formula
1276
+ ` min(max(16, cidrSize / 16), 256)` , described as _never less than 16 or more than 256,
1277
+ with a graduated step function between them_. Dynamic IP allocations will be preferentially
1278
+ chosen from the upper band, reducing risks of conflicts with the IPs
1279
+ assigned from the lower band.
1280
+ This allows users to use the lower band of the `service-cluster-ip-range` for their
1281
+ Services with static IPs assigned with a very low risk of running into conflicts.
1282
+
1263
1283
# ## Service IP addresses {#ips-and-vips}
1264
1284
1265
1285
Unlike Pod IP addresses, which actually route to a fixed destination,
0 commit comments