⎈ k8s knowledge compiler

Multi-tenancy [page]deterministic

concepts

This page provides an overview of available configuration options and best practices for cluster multi-tenancy.

Sharing clusters saves costs and simplifies administration. However, sharing clusters also presents challenges such as security, fairness, and managing _noisy neighbors_.

Clusters can be shared in many ways. In some cases, different applications may run in the same cluster. In other cases, multiple instances of the same application may run in the same cluster, one for each end user. All these types of sharing are frequently described using the umbrella term _multi-tenancy_.

While Kubernetes does not have first-class concepts of end users or tenants, it provides several features to help manage different tenancy requirements. These are discussed below.

## Use cases

The first step to determining how to share your cluster is understanding your use case, so you can evaluate the patterns and tools available. In general, multi-tenancy in Kubernetes clusters falls into two broad categories, though many variations and hybrids are also possible.

### Multiple teams

A common form of multi-tenancy is to share a cluster between multiple teams within an organization, each of whom may operate one or more workloads. These workloads frequently need to communicate with each other, and with other workloads located on the same or different clusters.

In this scenario, members of the teams often have direct access to Kubernetes resources via tools such as `kubectl`, or indirect access through GitOps controllers or other types of release automation tools. There is often some level of trust between members of different teams, but Kubernetes policies such as RBAC, quotas, and network policies are essential to safely and fairly share clusters.

### Multiple customers

The other major form of multi-tenancy frequently involves a Software-as-a-Service (SaaS) vendor running multiple instances of a workload for customers. This business model is so strongly associated with this deployment style that many people call it "SaaS tenancy." However, a better term might be "multi-customer tenancy," since SaaS vendors may also use other deployment models, and this deployment model can also be used outside of SaaS.

In this scenario, the customers do not have access to the cluster; Kubernetes is invisible from their perspective and is only used by the vendor to manage the workloads. Cost optimization is frequently a critical concern, and Kubernetes policies are used to ensure that the workloads are strongly isolated from each other.

## Terminology

### Tenants

When discussing multi-tenancy in Kubernetes, there is no single definition for a "tenant". Rather, the definition of a tenant will vary depending on whether multi-team or multi-customer tenancy is being discussed.

In multi-team usage, a tenant is typically a team, where each team typically deploys a small number of workloads that scales with the complexity of the service. However, the definition of "team" may itself be fuzzy, as teams may be organized into higher-level divisions or subdivided into smaller teams.

By contrast, if each team deploys dedicated workloads for each new client, they are using a multi-customer model of tenancy. In this case, a "tenant" is simply a group of users who share a single workload. This may be as large as an entire company, or as small as a single team at that company.

In many cases, the same organization may use both definitions of "tenants" in different contexts. For example, a platform team may offer shared services such as security tools and databases to multiple internal “customers” and a SaaS vendor may also have multiple teams sharing a development cluster. Finally, hybrid architectures are also possible, such as a SaaS provider using a combination of per-customer workloads for sensitive data, combined with multi-tenant shared services.

![](/images/docs/multi-tenancy.png)

### Isolation

There are several ways to design and build multi-tenant s …(trimmed)

Sources

concepts/security/multi-tenancy.md · docMulti-tenancy

Related (24)

references NamespaceNamespace conf=1
part_of Use casesdescribes conf=1
part_of Terminologydescribes conf=1
part_of Control plane isolationdescribes conf=1
part_of Data Plane Isolationdescribes conf=1
part_of Additional Considerationsdescribes conf=1
part_of Implementationsdescribes conf=1
part_of Multiple teamsdescribes conf=1
part_of Multiple customersdescribes conf=1
part_of Tenantsdescribes conf=1
part_of Isolationdescribes conf=1
part_of Namespacesdescribes conf=1
part_of Access controlsdescribes conf=1
part_of Quotasdescribes conf=1
part_of Network isolationdescribes conf=1
part_of Storage isolationdescribes conf=1
part_of Sandboxing containersdescribes conf=1
part_of Node Isolationdescribes conf=1
part_of API Priority and Fairnessdescribes conf=1
part_of Quality-of-Service (QoS) {#qos}describes conf=1
part_of DNSdescribes conf=1
part_of Operatorsdescribes conf=1
part_of Namespace per tenantdescribes conf=1
part_of Virtual control plane per tenantdescribes conf=1

← all Docs