Question

Are Pods always assigned to `10.244.0.0/16`?

I’ve been able to spin up a managed Kubernetes cluster and can deploy workloads as pods. 🎉

Running doctl kubernetes cluster get <UUID> -o json reports, among other things, that the cluster_subnet is 10.244.0.0/16. According to the documentation, cluster_subnet is The range of IP addresses in the overlay network of the Kubernetes cluster in CIDR notation. That means that all my pods will be assigned an IP from that range, right?

Question: is the cluster_subnet always 10.244.0.0/16? If I spin up a new cluster, am I guaranteed a cluster_subnet of 10.244.0.0/16? Is there a way for me to choose a different cluster_subnet, say, during cluster creation?

Thanks!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
October 5, 2023
Accepted Answer

Hello @caffeinestorm,

Firstly, congratulations on spinning up a managed Kubernetes cluster and deploying your workloads! 🎉

To address your question on the cluster_subnet:

  1. Is the cluster_subnet always 10.244.0.0/16?

    • As of now, the overlay network does utilize the 10.244.0.0/16 CIDR. However, it’s crucial to understand that this is an implementation detail that can change based on the needs or updates in the platform. Thus, it’s not advisable to rely on this specific range for any of your configurations or operations.
  2. If I spin up a new cluster, am I guaranteed a cluster_subnet of 10.244.0.0/16?

    • There’s no guarantee. While currently the clusters are being assigned this range, future versions or updates might differ. Relying on this specific CIDR might cause issues during potential upgrades.
  3. Can I choose a different cluster_subnet during cluster creation?

    • Currently, there isn’t an option for users to specify a custom cluster_subnet range during the cluster creation process.

A significant point to remember is that in DOKS (DigitalOcean Managed Kubernetes), there are more efficient and robust mechanisms to identify workloads beyond just IPs. It’s advisable to leverage those mechanisms to ensure the resilience and stability of your deployments.

For example, one option here is to use a service. A Kubernetes Service is an abstraction that defines a logical set of pods and a way to access them. When creating a service, Kubernetes will allocate a unique IP address (ClusterIP) which remains static for the lifecycle of the service. This means that you don’t have to rely on the individual IPs of pods, but rather on the Service’s ClusterIP or its DNS name.

I hope this clarifies your queries. Please let us know if you have any other questions or need further assistance!

Best,

Bobby

KFSys
Site Moderator
Site Moderator badge
October 6, 2023

Heya,

In Kubernetes, the 10.244.0.0/16 range is a common default for pod networking, but it is not immutable and may vary depending on the setup or the cloud provider. In DigitalOcean Kubernetes (DOKS), 10.244.0.0/16 is the default range, if I am not mistaken.

If I spin up a new cluster, am I guaranteed a cluster_subnet of 10.244.0.0/16? Yes, but it’s always a good idea to check after creating the cluster or consulting DigitalOcean’s latest documentation as there is no guaratnee that is the case.

Is there a way for me to choose a different cluster_subnet, say, during cluster creation? As of now, users are not allowed to specify custom pod or service CIDR ranges during cluster creation.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel