本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)17k · #10777

kubesphere-multi-tenant-management

できること

このスキルは、KubeSphereでテナントを設定するよう、AIエージェントを支援します。ユーザー、ワークスペース、プロジェクト、ロールのバインディングを含みます。共有クラスターで、誰が何にアクセスできるかを管理する管理者向けです。

使う場面

  • ✓基本的なロールを持つ新しいユーザーを、KubeSphereに追加する必要があるとき。
  • ✓新しいチームに、適切なメンバーを含むワークスペースまたはプロジェクトが必要なとき。
  • ✓必要最低限のレベルで、ある人にプロジェクトへのアクセス権を与えたいとき。

スキルのリンク

https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-multi-tenant-management/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/kubesphere/kubesphere/blob/master/skills/kubesphere-multi-tenant-management/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“Mariaという新しいユーザーを、通常のアクセス権で追加し、マーケティングのワークスペースに通常のメンバーとして招待してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、ユーザー、ワークスペース、プロジェクトを作成または読み取り、対応する組み込みのロールをバインドします。最も低いアクセスレベルから始め、あなたが頼んだときにのみ引き上げます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

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:

# 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)
# 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
よくある質問

エージェントはユーザーやプロジェクトを削除できますか?

いいえ。削除の操作は、KubeSphereのコンソールで手作業で行う必要があると述べています。

カスタムロールを作成できますか?

いいえ。組み込みのロールだけを使い、カスタムロールはコンソールで設定するよう述べています。

既定のアクセスレベルは何ですか?

最小のアクセス権が既定です。例えば、新しいユーザーは一般ユーザー、プロジェクトは閲覧者のロールから始まります。

詳細

作者による元の説明

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

人気

GitHubのスター
17k
ランキング
#10777
ライセンス
—
更新日
2026/7/14

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル