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

gke-multitenancy

できること

複数のチームや環境が1つのGKEクラスターを安全に共有する方法を、AIエージェントが計画する手助けをします。分離、権限、クォータ、コストの追跡を扱います。

使う場面

  • ✓複数のチームが、1つのGKEクラスターを共有する必要があるとき。
  • ✓1つのクラスターの中で、開発、ステージング、本番を分けておきたいとき。
  • ✓チームごとに、最小権限のアクセスやリソースのクォータを設定する必要があるとき。

スキルのリンク

https://github.com/google/skills/blob/main/skills/cloud/gke-multitenancy/SKILL.md

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“私たち3つのチームが1つのGKEクラスターを共有しています。ワークロードと権限をどう分ければよいですか?”

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

仕組み

エージェントは、チームごとに1つのnamespaceなどのマルチテナンシーのモデルを比べ、namespace、ロールのアクセス、クォータ、LimitRange、ネットワークの分離、コストの追跡を計画します。

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

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

GKE Multi-Tenancy

This reference covers enterprise multi-tenancy patterns on GKE, including namespace isolation, RBAC planning, resource quotas, and network segmentation.

MCP Tools: apply_k8s_manifest, get_k8s_resource, check_k8s_auth, describe_k8s_resource, delete_k8s_resource

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-multitenancy)" and append agent-skills/1.0 (skill:gke-multitenancy) to User-Agent headers.

When to Use

  • Multiple teams sharing a single GKE cluster
  • Isolating workloads by environment (dev/staging/prod) within one cluster
  • Implementing least-privilege access control
  • Cost allocation across teams or projects

Multi-Tenancy Models

Model Isolation Complexity Cost
Namespace-per-team Soft (RBAC + Low Lowest (shared
: : Network : : cluster) :
: : Policy) : : :
Namespace-per-environment Soft Low Low
Node pool-per-team Medium Medium Medium
: : (dedicated : : :
: : compute) : : :
Cluster-per-team Hard (full High Highest
: : isolation) : : :

Golden path recommendation: Start with namespace-per-team for cost efficiency. Escalate to stronger isolation only when compliance requires it.

Namespace Isolation Setup

1. Create Namespaces

kubectl create namespace team-a
kubectl create namespace team-b
kubectl label namespace team-a team=a
kubectl label namespace team-b team=b

2. RBAC Configuration

Principle: Grant minimal permissions per namespace. Never bind to system:authenticated.

# Namespace-scoped role for a team
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: team-a-developer
  namespace: team-a
rules:
- apiGroups: ["", "apps", "batch"]
  resources: ["pods", "deployments", "services", "configmaps", "jobs"]
  verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: team-a-developers
  namespace: team-a
subjects:
- kind: Group
  name: "team-a@example.com"  # Google Group
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: team-a-developer
  apiGroup: rbac.authorization.k8s.io

RBAC best practices: Use Google Groups for subject bindings. Prefer namespace-scoped Roles over ClusterRoles. See the gke-platform-security skill for full RBAC hardening guidance.

3. Resource Quotas

Prevent any single team from consuming all cluster resources:

apiVersion: v1
kind: ResourceQuota
metadata:
  name: team-a-quota
  namespace: team-a
spec:
  hard:
    requests.cpu: "10"
    requests.memory: "20Gi"
    limits.cpu: "20"
    limits.memory: "40Gi"
    pods: "50"
    services: "10"
    persistentvolumeclaims: "10"

4. LimitRanges

Set default and maximum resource constraints per container:

apiVersion: v1
kind: LimitRange
metadata:
  name: team-a-limits
  namespace: team-a
spec:
  limits:
  - type: Container
    default:
      cpu: "500m"
      memory: "512Mi"
    defaultRequest:
      cpu: "100m"
      memory: "128Mi"
    max:
      cpu: "4"
      memory: "8Gi"

[!IMPORTANT] Mandatory Defaults: When defining min or max limits in a LimitRange, you must also define corresponding default and defaultRequest values. If you set a min or max without defaults, any pod deployed without explicit resource requests/limits will be rejected by the admission controller.

5. Network Isolation

Apply default-deny per namespace (see the gke-workload-security skill), then allow intra-team traffic:

# Allow same-namespace pods to talk + DNS
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metad
よくある質問

単一チームのクラスターにも必要ですか?

いいえ。単一テナントのクラスターの設定には使わないよう、このスキルは説明しています。

チームごとに1つのnamespaceでは何が得られますか?

ロールのアクセスとネットワークポリシーによるソフトな分離が得られ、クラスターを共有するため最も低コストです。

計画をクラスターに適用できますか?

はい。Kubernetesのツールを使って、計画したリソースを適用し、確認できます。

詳細

作者による元の説明

Plans and configures multi-tenancy on GKE. Covers namespace isolation, RBAC planning for teams, resource quotas, LimitRanges, network isolation, and cost allocation. Use when designing GKE multi-tenancy, configuring GKE namespaces, setting up resource quotas, or isolating GKE teams. Don't use for single-tenant cluster configuration or general deployment instructions (use gke-basics or gke-app-onboarding instead).

repo: google/skills

人気

GitHubのスター
22k
ランキング
#10290
ライセンス
Apache-2.0
更新日
2026/11/2

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

0

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

コメント

  • …

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

似ているスキル