|
| 1 | +--- |
| 2 | +title: Configuring pods and services IP allocation policy on OVHcloud Managed Kubernetes (Standard plan only) |
| 3 | +excerpt: "Find out how to configure the IP allocation policy for your pods and service on an OVHcloud Managed Kubernetes cluster with Standard plan" |
| 4 | +updated: 2026-02-23 |
| 5 | +--- |
| 6 | + |
| 7 | +## Objective |
| 8 | + |
| 9 | +This guide will detail how to customize the IP ranges used for the pods and services in your OVHcloud Managed Kubernetes cluster with Standard plan. |
| 10 | + |
| 11 | +## Requirements |
| 12 | + |
| 13 | +- An OVHcloud Managed Kubernetes cluster |
| 14 | + |
| 15 | +## Limits |
| 16 | + |
| 17 | +The customization of the pods and services IP allocation policy is not possible on clusters with the Free plan. |
| 18 | + |
| 19 | +It is not possible to modify the IP allocation policy of a running cluster: either the configuration is done at the creation of the cluster or when the cluster is reset (implying the loss of all data in the cluster). |
| 20 | + |
| 21 | +## Configuration details |
| 22 | + |
| 23 | +Two parameters are available to control the IP allocation policy in your OVHcloud Managed Kubernetes cluster. |
| 24 | + |
| 25 | +| Parameter | Default value | Function | |
| 26 | +| ------------------ | --------------- | ------------------------------------------------------------------ | |
| 27 | +| `podsIpv4Cidr` | `10.240.0.0/13` | This is the subnet used to address all the pods in the cluster | |
| 28 | +| `servicesIpv4Cidr` | `10.3.0.0/16` | This is the subnet used to address all the services in the cluster | |
| 29 | + |
| 30 | +> [!primary] |
| 31 | +> |
| 32 | +> You can find more information about the CIDR notation here: [Classless Inter-Domain Routing](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) |
| 33 | +> |
| 34 | +
|
| 35 | +Here are some general rules to consider about these parameters: |
| 36 | + |
| 37 | +- The subnets _must not_ collide |
| 38 | +- The subnets _must_ be chosen in the [private network blocks](https://en.wikipedia.org/wiki/List_of_reserved_IP_addresses) |
| 39 | +- The minimal size allowed for the `podsIPpv4Cidr` and the `servicesIpv4Cidr` subnets is `/16` |
| 40 | + |
| 41 | +Please note that each node in the cluster is assigned a `/24` subnet inside the `podsIpv4Cidr`; choosing a `/16` subnet would limit the |
| 42 | +cluster to 16 nodes so choose your value wisely. |
| 43 | + |
| 44 | +Failing to consider this limit could render your cluster unstable. |
| 45 | + |
| 46 | +## Instructions using the OVHcloud API |
| 47 | + |
| 48 | +> [!primary] |
| 49 | +> |
| 50 | +> You can find more information on how to use the OVHcloud API here: [First steps with the OVHcloud API](/pages/manage_and_operate/api/first-steps). |
| 51 | +> |
| 52 | +
|
| 53 | +### Creating a new cluster with a custom IP allocation policy |
| 54 | + |
| 55 | +Using the following call, you can create a new cluster: |
| 56 | + |
| 57 | +> [!api] |
| 58 | +> |
| 59 | +> @api {v1} /cloud/project/{serviceName}/kube POST /cloud/project/{serviceName}/kube |
| 60 | +> |
| 61 | +
|
| 62 | +To set a custom IP allocation policy on pods and or services, you can take example on the following example: |
| 63 | + |
| 64 | +```json |
| 65 | +{ |
| 66 | + "name": "my-cluster-with-custom-ip", |
| 67 | + "nodepool": { |
| 68 | + "desiredNodes": 3, |
| 69 | + "flavorName": "b3-8", |
| 70 | + "name": "my-nodepool" |
| 71 | + }, |
| 72 | + "region": "GRA11", |
| 73 | + "ipAllocationPolicy": { |
| 74 | + "podsIpv4Cidr": "172.16.0/12", |
| 75 | + "servicesIpv4Cidr": "10.100.0.0/16" |
| 76 | + } |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | +Once the cluster is created, using this call should show you the IP allocation policy you have set: |
| 81 | + |
| 82 | +> [!api] |
| 83 | +> |
| 84 | +> @api {v1} /cloud/project/{serviceName}/kube GET /cloud/project/{serviceName}/kube |
| 85 | +> |
| 86 | +
|
| 87 | +### Resetting a cluster to change its IP allocations |
| 88 | + |
| 89 | +> [!warning] |
| 90 | +> |
| 91 | +> Resetting a cluster will delete all data and workload running on the cluster. |
| 92 | +> |
| 93 | +
|
| 94 | +Using the following call, you can reset a cluster and specify a custom IP allocation policy: |
| 95 | + |
| 96 | +> [!api] |
| 97 | +> |
| 98 | +> @api {v1} /cloud/project/{serviceName}/kube/{kubeId}/reset POST /cloud/project/{serviceName}/kube/{kubeId}/reset |
| 99 | +> |
| 100 | +
|
| 101 | +To set a custom IP allocation policy on pods and or services, you can take example on the following example: |
| 102 | + |
| 103 | +```json |
| 104 | +{ |
| 105 | + "ipAllocationPolicy": { |
| 106 | + "podsIpv4Cidr": "172.16.0/12", |
| 107 | + "servicesIpv4Cidr": "10.100.0.0/16" |
| 108 | + } |
| 109 | +} |
| 110 | +``` |
| 111 | + |
| 112 | +Once the cluster is reset, using this call should show you the IP allocation policy you have set: |
| 113 | + |
| 114 | +> [!api] |
| 115 | +> |
| 116 | +> @api {v1} /cloud/project/{serviceName}/kube GET /cloud/project/{serviceName}/kube |
| 117 | +> |
0 commit comments