Kubesphere Multi Tenant Management logo

Kubesphere Multi Tenant Management

OrganizationPopular
kubesphere
kubesphere-multi-tenant-management

KubeSphere multi-tenant management Skill. Use when user requests to create users, workspaces, projects, or assign roles/permissions. Supports user lifecycle management, workspace configuration, project creation, role binding. Do not perform any delete operations, do not create custom roles.

Overview

Publisherkubesphere
Repositorykubesphere
Skill namekubesphere-multi-tenant-management
Stars
17.1K
Forks
2.8K
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by kubesphere on GitHub. Read the source before you install it.

Installation

Install the Kubesphere Multi Tenant Management AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kubesphere/kubesphere.git /tmp/kubesphere
mkdir -p .claude/skills
cp -r /tmp/kubesphere/skills/kubesphere-multi-tenant-management .claude/skills/kubesphere-multi-tenant-management
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Kubesphere Multi Tenant Management in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Kubesphere Multi Tenant Management on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Kubesphere Multi Tenant Management is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

KubeSphere Multi-Tenant Management

Security Guidelines

  1. Never use kubectl edit/delete - Do NOT use kubectl edit, kubectl delete, or similar commands to modify or delete workspaces, projects, users, roles, or role bindings. These operations are sensitive and should be performed via KubeSphere Console with proper approval workflow.

  2. Never perform delete operations via API - Do NOT delete users, workspaces, projects, roles, or role bindings via API. These operations must be performed manually via KubeSphere Console with proper approval workflow. Only use this skill for creating and querying resources.

  3. Never create custom roles - Do NOT create custom roles (Role, WorkspaceRole, GlobalRole). Only use built-in roles provided by KubeSphere. If custom permissions are needed, instruct the user to configure them via KubeSphere Console.

  4. Default to least privilege - When creating users or assigning permissions, always use the minimum required access level:

    • New user creation: default to platform-regular (not platform-admin)
    • Inviting user to workspace: default to <workspace-name>-regular (not admin)
    • Inviting user to project: default to viewer (not admin)
    • Only escalate permissions when explicitly requested

Core Concepts

Workspace

The top-level organizational unit in KubeSphere, representing a team, department, or business unit. A workspace can contain multiple projects and serves as the basic boundary for resource grouping and access control. Workspaces can span multiple clusters, enabling centralized management of resources distributed across different clusters.

Project

KubeSphere's enhanced Kubernetes namespace, representing a specific application, environment, or workload within a workspace. Each project maps to a separate namespace.

User & Role

  • User: KubeSphere account entity, can be platform admin, workspace member, or project member
  • Role: Permission set defined in KubeSphere's three-tier RBAC:

Project Roles (roles.iam.kubesphere.io):

  • admin: Full access to all resources
  • operator: Create/update/delete resources, cannot manage roles
  • viewer: Read-only access

Workspace Roles (WorkspaceRole, workspaceroles.iam.kubesphere.io):

  • <workspace-name>-admin: Full access to workspace and all projects
  • <workspace-name>-regular: Limited workspace access
  • <workspace-name>-self-provisioner: Create projects in workspace
  • <workspace-name>-viewer: Read-only access to workspace

Platform Roles (GlobalRole, globalroles.iam.kubesphere.io):

  • platform-admin: Full access to all resources
  • platform-regular: Limited platform access
  • platform-self-provisioner: Can create workspaces

Role Binding (KubeSphere API endpoints, binds roles to Users):

  • Project-level: /namespacemembers API, binds roles.iam.kubesphere.io to User
  • Workspace-level: /workspacemembers API, binds workspaceroles.iam.kubesphere.io to User
  • Platform-level: /users/<username> API, binds globalroles.iam.kubesphere.io to User via annotation

Step-by-Step Guide

Prerequisites

Set up authentication using the provided CLI tool. First, navigate to the scripts directory:

bash
# Navigate to the skill's scripts directory
# Example path (replace with your actual kubesphere-skills location):
cd ~/kubesphere-skills/core/kubesphere-core/scripts

# Install required Python package
pip install requests


# Set host endpoint (optional, defaults to http://ks-apiserver.kubesphere-system)
export KUBESPHERE_HOST="http://<kubesphere-host>"

# Login to get token (token will be cached)
python ks_api.py --login --username admin --password <your-password>

# Token is cached in ~/.kubesphere_token and auto-refreshed

# Optional: Clear cached token
python ks_api.py --clear-cache

1. Create Workspace

Required parameters:

  • workspace-name: Name for the workspace (maps to metadata.name)
  • manager: Workspace manager (maps to spec.template.spec.manager, default to current login user)
  • creator: Creator name (maps to metadata.annotations["kubesphere.io/creator"])
  • clusters: List of cluster names to host this workspace (maps to spec.placement.clusters)
bash
# Create workspace via Python CLI
python ks_api.py POST /kapis/tenant.kubesphere.io/v1beta1/workspacetemplates '{
  "apiVersion": "iam.kubesphere.io/v1beta1",
  "kind": "WorkspaceTemplate",
  "metadata": {
    "name": "<workspace-name>",
    "annotations": {
      "kubesphere.io/creator": "<creator>"
    }
  },
  "spec": {
    "template": {
      "spec": {
        "manager": "<manager>"
      },
      "metadata": {
        "annotations": {
          "kubesphere.io/creator": "<creator>"
        }
      }
    },
    "placement": {
      "clusters": [
        {"name": "<cluster-name>"}
      ]
    }
  }
}'

Note: Before creating a workspace, always ask the user for:

  • Workspace name (required)
  • Manager (required, default to current login user)
  • Clusters (required) - which cluster(s) to assign the workspace to

2. Create Project within Workspace

Required parameters:

  • project-name: Name for the project (maps to metadata.name)
  • workspace-name: Name of the workspace to create the project in (maps to metadata.labels["kubesphere.io/workspace"])
  • cluster-name: Cluster name to create the project in (maps to URI path and cluster field)
  • creator: Creator name (maps to metadata.annotations["kubesphere.io/creator"])
bash
# Create project within workspace via Python CLI
python ks_api.py POST /clusters/<cluster-name>/kapis/tenant.kubesphere.io/v1beta1/workspaces/<workspace-name>/namespaces '{
  "apiVersion": "v1",
  "kind": "Namespace",
  "metadata": {
    "labels": {
      "kubesphere.io/workspace": "<workspace-name>",
      "kubesphere.io/managed": "true"
    },
    "name": "<project-name>",
    "annotations": {
      "kubesphere.io/creator": "<creator>"
    }
  },
  "cluster": "<cluster-name>"
}'

Note: Before creating a project, always ask the user for:

  • Project name (required)
  • Workspace name (required) - which workspace to create the project in
  • Cluster name (required) - which cluster to create the project in

3. Create User

Required parameters:

  • username: Username for the new user
  • email: User's email address
  • password: User's password (must meet KubeSphere password policy)

Optional parameters:

  • globalrole: Platform role (default: platform-regular)
bash
# Create user via Python CLI
python ks_api.py POST /kapis/iam.kubesphere.io/v1beta1/users '{
  "apiVersion": "iam.kubesphere.io/v1beta1",
  "kind": "User",
  "metadata": {
    "annotations": {
      "iam.kubesphere.io/uninitialized": "true",
      "iam.kubesphere.io/globalrole": "platform-regular",
      "kubesphere.io/creator": "admin"
    },
    "name": "<username>"
  },
  "spec": {
    "email": "<email>",
    "password": "<password>"
  }
}'

Note: Before creating a user, always ask the user for:

  • Username (required)
  • Email address (required)
  • Platform role: If not specified, default to platform-regular

4. Invite User to Workspace/Project

For Workspace invitation:

  • username: Username to invite (required)
  • workspace-name: Target workspace name (required)
  • role: Workspace role (default: <workspace-name>-regular)

For Project invitation:

  • username: Username to invite (required)
  • project-name: Target project name (required)
  • cluster-name: Cluster name (required)
  • role: Project role (default: viewer)
bash
# Invite user to workspace (default role: <workspace-name>-regular)
python ks_api.py POST /kapis/iam.kubesphere.io/v1beta1/workspaces/<workspace-name>/workspacemembers '[{"username":"<username>","roleRef":"<workspace-name>-regular"}]'
bash
# Invite user to project (default role: viewer)
python ks_api.py POST /clusters/<cluster-name>/kapis/iam.kubesphere.io/v1beta1/namespaces/<project-name>/namespacemembers '[{"username":"<username>","roleRef":"viewer"}]'

Note: Before inviting a user, always ask the user for:

  • Username to invite (required)
  • Target: workspace or project (required)
  • Role: If not specified, default to <workspace-name>-regular for workspace or viewer for project

5. Modify User Permissions

Modify user roles at three levels: platform, workspace, and project.

For Platform Role (global role):

  • username: Username to modify (required)
  • globalrole: New platform role (required)
  • Note: Must first GET the user to get current metadata, then PUT with updated annotation
bash
# Step 1: Get current user info (required before modification)
python ks_api.py GET /kapis/iam.kubesphere.io/v1beta1/users/<username>

# Step 2: Update global role annotation
python ks_api.py PUT /kapis/iam.kubesphere.io/v1beta1/users/<username> '{
  "apiVersion": "iam.kubesphere.io/v1beta1",
  "kind": "User",
  "metadata": {
    "name": "<username>",
    "annotations": {
      "iam.kubesphere.io/globalrole": "<new-global-role>"
    }
  }
}'

For Workspace Role:

  • username: Username to modify (required)
  • workspace-name: Target workspace name (required)
  • roleRef: New workspace role (required)
bash
# Modify user role in workspace
python ks_api.py PUT /kapis/iam.kubesphere.io/v1beta1/workspaces/<workspace-name>/workspacemembers/<username> '{"username":"<username>","roleRef":"<workspace-name>-<role>"}'

For Project Role:

  • username: Username to modify (required)
  • project-name: Target project name (required)
  • cluster-name: Cluster name (required)
  • roleRef: New project role (required)
bash
# Modify user role in project
python ks_api.py PUT /clusters/<cluster-name>/kapis/iam.kubesphere.io/v1beta1/namespaces/<project-name>/namespacemembers/<username> '{"username":"<username>","roleRef":"<role>"}'

Note: Before modifying permissions, always ask the user for:

  • Username to modify (required)
  • Scope: platform / workspace / project (required)
  • New role: Only use built-in roles provided by KubeSphere

6. Query Resources

List Workspaces
bash
python ks_api.py GET /kapis/tenant.kubesphere.io/v1beta1/workspacetemplates
List Users
bash
python ks_api.py GET /kapis/iam.kubesphere.io/v1beta1/users
List Workspace Members
bash
python ks_api.py GET /kapis/iam.kubesphere.io/v1beta1/workspaces/<workspace-name>/workspacemembers
List Project Members
bash
python ks_api.py GET /clusters/<cluster-name>/kapis/iam.kubesphere.io/v1beta1/namespaces/<project-name>/namespacemembers
List Projects in Workspace
bash
python ks_api.py GET /clusters/<cluster-name>/kapis/tenant.kubesphere.io/v1beta1/workspaces/<workspace-name>/namespaces
Get User Details
bash
python ks_api.py GET /kapis/iam.kubesphere.io/v1beta1/users/<username>

Error Handling

Error CodeCauseSolution
401 UnauthorizedToken expiredpython ks_api.py --clear-cache && python ks_api.py --login --username admin --password <password>
403 ForbiddenNo permissionUse admin account
409 ConflictResource already existsUse different name
404 Not FoundResource not foundVerify name/workspace/cluster is correct
400 Bad RequestInvalid parametersCheck error message for details (email format, password policy, naming rules)
Connection refused/timeoutAPI unreachableVerify KUBESPHERE_HOST is correct

Debugging:

  • --quiet flag for cleaner output: python ks_api.py GET /users --quiet
  • Check token: python ks_api.py

References

Related Skills

  • kubesphere-core - Core platform architecture
  • kubesphere-cluster-management - Cluster operations

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Kubesphere Multi Tenant Management AI skill do?

KubeSphere multi-tenant management Skill. Use when user requests to create users, workspaces, projects, or assign roles/permissions. Supports user lifecycle management, workspace configuration, project creation, role binding. Do not perform any delete operations, do not create custom roles.

Why use Kubesphere Multi Tenant Management on TypingMind?

Because you install it once and use it with any model. Kubesphere Multi Tenant Management is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Kubesphere Multi Tenant Management in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/kubesphere/kubesphere/tree/master/skills/kubesphere-multi-tenant-management. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Kubesphere Multi Tenant Management?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Kubesphere Multi Tenant Management?

As many as you like. As long as a model supports skills, you can use Kubesphere Multi Tenant Management with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Kubesphere Multi Tenant Management AI skill free?

It is published on GitHub by kubesphere. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇