What's the maximum number of Kubernetes namespaces?
Asked Answered
F

3

14

Is there a maximum number of namespaces supported by a Kubernetes cluster? My team is designing a system to run user workloads via K8s and we are considering using one namespace per user to offer logical segmentation in the cluster, but we don't want to hit a ceiling with the number of users who can use our service.

We are using Amazon's EKS managed Kubernetes service and Kubernetes v1.11.

Fax answered 10/5, 2019 at 19:5 Comment(0)
P
10

This is quite difficult to answer which has dependency on a lot of factors, Here are some facts which were created on the k8s 1.7 cluster kubernetes-theresholds the Number of namespaces (ns) are 10000 with few assumtions

Pragmatist answered 10/5, 2019 at 19:23 Comment(1)
The video linked in the page (youtu.be/t_Ww6ELKl4Q?t=1495) says that since K8s v1.12 that namespaces==10000 limit doesn't apply anymore. Check which K8s you are using.Glarum
M
4

The are no limits from the code point of view because is just a Go type that gets instantiated as a variable.

In addition to link that @SureshVishnoi posted, the limits will depend on your setup but some of the factors that can contribute to how your namespaces (and resources in a cluster) scale can be:

  • Physical or VM hardware size where your masters are running
    • Unfortunately, EKS doesn't provide that yet (it's a managed service after all)
  • The number of nodes your cluster is handling.
  • The number of pods in each namespace
  • The number of overall K8s resources (deployments, secrets, service accounts, etc)
  • The hardware size of your etcd database.
    • Storage: how many resources can you persist.
    • Raw performance: how much memory and CPU you have.
  • The network connectivity between your master components and etcd store if they are on different nodes.
    • If they are on the same nodes then you are bound by the server's memory, CPU and storage.
Milky answered 10/5, 2019 at 21:30 Comment(0)
R
1

There is no limit on number of namespaces. You can create as many as you want. It doesn't actually consume cluster resources like cpu, memory etc.

Receptor answered 10/5, 2019 at 19:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.