kubesphere-multi-tenant-management
What it does
This skill helps an AI agent set up tenants in KubeSphere, including users, workspaces, projects and role bindings. It is for administrators who manage who can access what in a shared cluster.
When to use it
- ✓When you need to add a new user to KubeSphere with the basic role.
- ✓When a new team needs a workspace or a project with the right members.
- ✓When you want to give a person access to a project at the lowest level needed.
Skill link
https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-multi-tenant-management/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Please add a new user for Maria with regular access and invite her to the marketing workspace as a regular member.”
5 new skills a week. 1 minute to read.
How it works
The agent creates or reads the user, workspace or project, then binds the matching built-in role. It starts with the least access level and only raises it when you ask.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
KubeSphere Multi-Tenant Management
Security Guidelines
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.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.
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.
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
- New user creation: default to
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 resourcesoperator: Create/update/delete resources, cannot manage rolesviewer: 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 resourcesplatform-regular: Limited platform accessplatform-self-provisioner: Can create workspaces
Role Binding (KubeSphere API endpoints, binds roles to Users):
- Project-level:
/namespacemembersAPI, bindsroles.iam.kubesphere.ioto User - Workspace-level:
/workspacemembersAPI, bindsworkspaceroles.iam.kubesphere.ioto User - Platform-level:
/users/<username>API, bindsglobalroles.iam.kubesphere.ioto User via annotation
Step-by-Step Guide
Prerequisites
Set up authentication using the provided CLI tool. First, navigate to the scripts directory:
# 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 tometadata.name)manager: Workspace manager (maps tospec.template.spec.manager, default to current login user)creator: Creator name (maps tometadata.annotations["kubesphere.io/creator"])clusters: List of cluster names to host this workspace (maps tospec.placement.clusters)
# 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>",
"annotation
FAQ
Can the agent delete users or projects?
No. The skill says delete operations must be done by hand in the KubeSphere console.
Can it create custom roles?
No. It uses only the built-in roles, and custom roles should be set up in the console.
What is the default access level?
It defaults to the least access, such as regular for a new user and viewer for a project.
Details
Original description by the author
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.
repo: kubesphere/kubesphere
Popularity
- GitHub stars
- 17k
- Ranking position
- #10777
- License
- —
- Updated
- 7/14/2026
Comments
- …
More skills from this repository
frontend-forge-fe-operations
17kHelps your agent manage FrontendExtension resources in KubeSphere, including building, publishing and debugging them.
frontend-forge-fi-operations
17kHelps your agent create, update, enable, disable and inspect FrontendIntegration resources and the frontend-forge extension in KubeSphere.
frontend-integration-yaml
17kHelps your agent create ready-to-submit FrontendIntegration YAML for a single menu with one or more pages.
kubeeye
17kHelps your agent install KubeEye and set up cluster inspection rules and plans, then read the inspection reports.
Similar skills
openclaw-update
394kHelps your agent update an existing OpenClaw Gateway, choosing the update method that fits how it was installed and keeping your session working.
diagnose-gateway
394kHelps your agent find out why your OpenClaw Gateway is failing by checking settings, channels, and ports without changing anything.
crabbox-apps
394kHelps your agent open and run an app on a temporary cloud machine, then show its view in your chat side panel.