Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

A deep dive into Stakater's Multi-Tenant Operator

Learn more about the Quotas, Tenants, and Console features in the Multi-Tenant operator

February 14, 2024
Vivien Wang Rasheed Amir, Karl Johan Grahn, Bharath Nallapeta & Tanveer Alam
Related topics:
Kubernetes
Related products:
Red Hat OpenShift

    Welcome back to our in-depth exploration of Multi Tenant Operator (MTO) by Stakater. In our previous blog, we covered the fundamental aspects of MTO and its role in achieving efficient and secure multi-tenancy in Red Hat OpenShift. This time, we're diving deeper into MTO’s core features.

    We will navigate through the three core features of MTO: Quotas, Tenants, and Console.

    Installation

    MTO is available on both Red Hat Marketplace and OperatorHub. Installation instructions are available on the official MTO Docs on installation.

    Core features

    In the realm of multi-tenancy, the concept of a "Tenant" is akin to having distinct football clubs like Arsenal, Chelsea, and PSG within a single league. Each club (Tenant) operates independently, with its own players (users) and resources (quotas, labels, and integrations).

    Quotas

    Quota is essential for the creation of a Tenant. Quotas are like the financial budgets assigned to each football club. They define the maximum amount of resources (like CPU, memory, storage) that each Tenant (club) can use within the OpenShift cluster (league).

    Custom Resource (YAML)

    A Quota in MTO is defined as a custom resource (CR). Here's an example where Bill, a cluster administrator, creates a medium quota:

    apiVersion: tenantoperator.stakater.com/v1beta1
    kind: Quota
    metadata:
     name: medium
    spec:
     limitrange:
       limits:
         - max:
             cpu: '2'
             memory: 1Gi
           min:
             cpu: 200m
             memory: 100Mi
           type: Pod
     resourcequota:
       hard:
         configmaps: '10'
         requests.cpu: '5'
         requests.memory: 5Gi
         secrets: '10'
         services: '10'
         services.loadbalancers: '2'
    • Resource quotas: The resourcequota field in the Quota CR specifies the maximum amount of resources a Tenant can use. It is like setting a budget cap for each club.
    • Limit ranges: The limitrange field defines minimum and maximum usage limits for resources like CPU and memory per Pod, similar to setting limits on player salaries.
    • Linking Quotas to Tenants: The quota is then linked to a Tenant, ensuring that the Tenant’s resource usage stays within the defined limits.
    • Limiting PersistentVolume: To restrict storage usage, the quota can include a requests.storage field. This is akin to setting a maximum limit on the stadium size.
    • StorageClass restrictions: For more granular control, storage limits can be set per StorageClass, much like having specific budgets for different categories like player acquisitions, medical facilities, or youth academies.

    Bill then links this quota to a Tenant named devops, managed by Anna:

    apiVersion: tenantoperator.stakater.com/v1beta2
    kind: Tenant
    metadata:
     name: devops
    spec:
     onDelete:
       cleanAppProject: true
       cleanNamespaces: false
     owners:
       users:
         - anna@stakater.com
     quota: medium

    When Anna, managing the devops Tenant, tries to deploy resources beyond her quota, she receives an error, ensuring that her usage stays within the club's (Tenant's) budget:

    Error creating: pods "myapp-devops-thd98" is forbidden: exceeded quota: medium, requested: requests.cpu=200Mi, used: requests.cpu=6, limited: requests.cpu=16

    In a multi-tenant environment like a shared OpenShift cluster, Quotas ensure that resources are fairly distributed and that one department’s (Tenant’s) excessive usage doesn’t impact others.

    More information about Quotas can be found on the official MTO Docs on Quotas.

    Tenants

    MTO's Tenant feature ensures that clubs (Tenants) coexist harmoniously, with clearly defined boundaries and operational rules. It's about maximizing the league's (cluster's) potential while maintaining each club's (Tenant’s) unique identity and needs.

    Custom resource (YAML)

    A Tenant in MTO is defined using a custom resource (CR). The smallest valid Tenant definition is straightforward, as shown below:

    apiVersion: tenantoperator.stakater.com/v1beta2
    kind: Tenant
    metadata:
     name: arsenal
    spec:
     quota: medium

    Let’s focus on some key aspects of the Tenant CR:

    • Owners, Editors, Viewers (roles and permissions): Like assigning roles in a club—managers (owners), coaches (editors), and scouts (viewers)—these fields define the permissions for users within the Tenant.
    • Quota (resource limits): Just as a club has a budget cap, the quota specifies resource limits for the Tenant, promoting efficient usage.
    • Argo CD integration (tactical tools): Integrating with Argo CD is akin to providing the club with tactical tools and resources, dictated by the Tenant’s requirements.
    • Template instances (playbooks): Like deploying specific playbooks to different squads, this feature applies certain templates to namespaces under the Tenant.

    The complete set of options available can be found in the official MTO Docs on Tenants.

    E-commerce example

    Now that we understand the basic structure of Tenants, let's see how this works in a technical scenario at the e-commerce company NordMart. NordMart faced challenges in managing their single OpenShift cluster used by various departments like sales, marketing, and design. To promote efficient management, security, and resource optimization, NordMart adopted MTO’s Tenants feature. This enabled the creation of distinct Tenants for each department.

    Each department was set up as a Tenant with customized resource quotas, role assignments, and specific namespaces—sales-tenant for sales with high resources and sandbox environments, marketing-tenant for marketing with moderate quotas and isolated testing namespaces, and design-tenant for design with flexible resources and hibernation configurations. This setup not only streamlined resource allocation and operational efficiency but also ensured departmental autonomy and security within the shared cluster.

    1. Sales Tenant: sales-tenant

    apiVersion: tenantoperator.stakater.com/v1beta2
    kind: Tenant
    metadata:
      name: sales-tenant
    spec:
      owners:
        users:
          - seniorsales@nordmart.com
          - salesmanager@nordmart.com
      quota: medium
      namespaces:
        withTenantPrefix:
          - customer-engagement
          - sales-analytics

    2. Marketing Tenant: marketing-tenant

    apiVersion: tenantoperator.stakater.com/v1beta2
    kind: Tenant
    metadata:
      name: marketing-tenant
    spec:
      owners:
        users:
          - marketinglead@nordmart.com
      quota: medium
      namespaces:
        withTenantPrefix:
          - campaign-planning
          - market-research

    3. Design Tenant: design-tenant

    apiVersion: tenantoperator.stakater.com/v1beta2
    kind: Tenant
    metadata:
      name: design-tenant
    spec:
      owners:
        users:
          - designdirector@nordmart.com
          - leaddesigner@nordmart.com
      quota: medium
      namespaces:
        withTenantPrefix:
          - ui-ux
          - graphic-design

    MTO Console

    Now that we have installed all the resources, let’s see how they are shown on the MTO Console when logged in as an MTO Admin.

    The dashboard is shown below in Figure 1.

    mto-dashboard
    Figure 1. MTO Dashboard
    Figure 1: MTO dashboard.

    Figure 2 shows the Quotas.

    mto-quotas
    Figure 1. MTO Quotas
    Figure 2: MTO quotas.

    Lastly, Figure 3 shows the Tenants.

    mto-tenants
    Figure 3. MTO Tenants
    Figure 3: MTO Tenants.

    Conclusion: Mastering multitenancy with MTO

    For Kubernetes multi-tenancy, Stakater's Multi Tenant Operator (MTO) plays a role akin to a skilled coach in a football league, orchestrating harmony and peak performance among diverse teams. MTO ensures each Tenant operates optimally, with the right resources and strategies in place.

    Throughout this article, we've seen how MTO's Tenants and Quotas features contribute to a well-organized, efficient environment. In essence, MTO empowers administrators to enforce security, ensure operational efficiency, and maintain uniformity across a multi-tenant landscape.

    Related Posts

    • Simplify multitenancy with Stakater's Multi Tenant Operator

    • Approaches to implementing multi-tenancy in SaaS applications

    • Manage namespaces in multitenant clusters with Argo CD, Kustomize, and Helm

    • Implement multitenant SaaS on Kubernetes

    • Is it better to split Kafka clusters?

    • How to program a multitenant SaaS platform in Kubernetes

    Recent Posts

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    What’s up next?

    Operators make it easier to automate the lifecycle of complex, stateful programs by adding application-specific skills to a Kubernetes cluster. Read Kubernetes Operators for realistic examples that show you how Operators work and how to build them with the Operator Framework and SDK.

    Get the e-book
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.