Saltar al contenido principal

Manage permissions with Capsule

Objetivos

Este tutorial le guiará en el uso de Capsule, la herramienta de multi-tenancy integrada en su clúster Managed Kubernetes. Al final de esta guía, sabrá:

  • Qué es un Tenant Capsule y cómo organiza sus permisos.
  • Cómo crear y gestionar Namespaces dentro de su Tenant.
  • Cómo se aplican las políticas de seguridad y cuotas a sus proyectos.

¿Qué es Capsule?

Capsule es un controlador de Kubernetes que introduce el concepto de Tenant para agrupar múltiples Namespaces. En la oferta de Kubernetes gestionado de Cloud Temple, Capsule se utiliza para delegarle la gestión de sus propios Namespaces de forma autónoma, sin necesidad de intervención de un administrador del clúster.

Al entregarle su clúster, los equipos de Cloud Temple han creado un primer Tenant para usted y lo han designado como propietario (Tenant Owner).

tip

Por defecto, su primer Tenant se llama default y el servicio de cuenta propietario es defaultapp.

Para obtener más información sobre el proyecto, puede consultar el sitio web oficial de Capsule.

Step 1: Know your Tenant name

As a Tenant Owner, you do not have the permissions to list the Tenant resource directly. The name of your Tenant is provided to you by the Cloud Temple teams during service delivery.

If you have forgotten your Tenant name, you can retrieve it by inspecting the labels of the Namespaces you have access to. The following command lists all namespaces that are attached to a Capsule Tenant and displays their labels:

kubectl get ns -l capsule.clastix.io/tenant --show-labels

Look for the label capsule.clastix.io/tenant. The value of this label is your Tenant name. You can then use this name to filter and display only the Namespaces belonging to your Tenant:



# Once you know the name of your tenant, for example "my-tenant"
kubectl get ns -l capsule.clastix.io/tenant=my-tenant

Step 2: Create a new Namespace

Your main advantage as a Tenant Owner is the ability to create Namespaces yourself. You can do this directly with a single kubectl command.

Run the following command to create a namespace named mon-projet-dev:

kubectl create namespace mon-projet-dev

Capsule will intercept this request. Since you are the owner of a Tenant, it will allow the creation of the Namespace and automatically associate it with your Tenant.

Step 3: Verify Namespace Association

Once the Namespace is created, you can verify that it has been correctly attached to your Tenant.

kubectl get ns mon-projet-dev --show-labels

You will notice that Capsule has added a label to your Namespace, indicating which Tenant it belongs to. This mechanism ensures isolation between the different Tenants in the cluster.

NAME             STATUS   AGE   LABELS
mon-projet-dev Active 1m capsule.clastix.io/tenant=votre-tenant

Step 4: Understand policy inheritance

One of the greatest advantages of Capsule is that all security policies, resource quotas (ResourceQuota), and resource ranges (LimitRange) defined at the Tenant level by administrators are automatically inherited by all Namespaces you create.

This ensures your projects comply with consumption limits (CPU, memory, storage) and security rules (such as default network policies or security constraints defined by Kyverno) set for your environment, without needing to reconfigure them for each Namespace.

info

Specific quotas have been set on your Capsule Tenant to limit the use of persistent storage (Ceph-Block and Ceph-Filesystem) to the total available space in the cluster. If you need to modify these quotas for a specific project, please submit a request to Cloud Temple support.

Conclusión

Gracias a Capsule, dispone de una autonomía completa para gestionar los Namespaces de sus equipos, al tiempo que cuenta con un entorno seguro y preconfigurado por los administradores del clúster. Puede crear, modificar y eliminar Namespaces según sea necesario, sabiendo que las medidas de seguridad necesarias se aplican automáticamente.

Si necesita crear un nuevo Tenant para aislar otro conjunto de proyectos o equipos, puede solicitarlo al soporte de Cloud Temple.