Catalog
google/gke-multitenancy

google

gke-multitenancy

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).

New~1.3kUpdated Jun 28, 2026

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

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-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-security skill), then allow intra-team traffic:

# Allow same-namespace pods to talk + DNS
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-same-namespace
  namespace: team-a
spec:
  podSelector: {}
  ingress:
  - from:
    - podSelector: {}
  egress:
  - to:
    - podSelector: {}
  - to:  # Allow DNS
    - namespaceSelector: {}
      podSelector:
        matchLabels:
          k8s-app: kube-dns
    ports:
    - protocol: UDP
      port: 53

Cost Allocation

Labels for Cost Attribution

# Label namespaces for billing
kubectl label namespace team-a cost-center=engineering
kubectl label namespace team-b cost-center=data-science

GKE Cost Allocation

Enable GKE cost allocation to break down costs by namespace and label:

gcloud container clusters update <CLUSTER_NAME> --region <REGION> \
  --enable-cost-allocation

View in Cloud Billing > GKE Cost Allocation.

Files1
1 files · 11.1 KB

Select a file to preview

Overall Score

82/100

Grade

B

Good

Safety

85

Quality

82

Clarity

85

Completeness

72

Summary

This skill provides a reference guide for designing and configuring multi-tenancy on GKE, covering namespace isolation, RBAC planning, resource quotas, LimitRanges, network policies, and cost allocation. It guides agents through creating namespaces, binding teams to least-privilege roles, setting resource constraints, and configuring network segmentation using Kubernetes manifests applied via MCP tools.

Detected Capabilities

apply_k8s_manifestget_k8s_resourcecheck_k8s_authdescribe_k8s_resourcedelete_k8s_resourcekubectl commandsgcloud CLI invocation

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

gke multi-tenancynamespace isolation rbacmulti-team kubernetesresource quotas gkenetwork policies gkecost allocation gketeam isolation clusters

Risk Signals

INFO

Applies Kubernetes manifests (RBAC, NetworkPolicy, ResourceQuota) via MCP tools with no explicit authentication guardrails documented

MCP Tools section
INFO

References example Google Group binding (team-a@example.com) that must be replaced with actual team identifiers

RBAC Configuration section
WARNING

Recommends gcloud command to enable cost allocation without specifying required IAM roles or permissions

GKE Cost Allocation section
INFO

Cross-references related skills (gke-security, gke-basics, gke-app-onboarding) without verification those skills exist or align

Multiple sections

Referenced Domains

External domains referenced in skill content, detected by static analysis.

www.apache.org

Use Cases

  • Design multi-tenant GKE cluster architecture with namespace-per-team isolation
  • Configure RBAC policies scoped to namespaces for team-based access control
  • Set up resource quotas and LimitRanges to prevent resource exhaustion by single teams
  • Isolate network traffic between teams using NetworkPolicy
  • Enable and view GKE cost allocation by team and namespace
  • Plan cluster isolation strategy (namespace vs. node pool vs. cluster-per-team)

Quality Notes

  • Excellent use of clear multi-tenancy model comparison table with tradeoffs (isolation vs. complexity vs. cost)
  • YAML examples are practical and directly applicable; includes both role definitions and bindings
  • Mandatory defaults warning in LimitRange section is crucial and well-highlighted
  • Golden path recommendation (namespace-per-team first) provides actionable guidance for common case
  • RBAC best practice note about preferring namespace-scoped Roles over ClusterRoles is correct and important
  • Detailed resource quota example shows both CPU/memory requests+limits and pod/service/PVC counts
  • NetworkPolicy example correctly demonstrates same-namespace egress AND DNS allowlist pattern
  • Limitations are clearly stated in 'When to Use' section (excludes single-tenant and general deployment guidance)
  • Content assumes reader has basic Kubernetes knowledge (roles, namespaces, manifests) — appropriate for target audience
  • Missing: no guidance on validating or testing multi-tenancy setup; no troubleshooting section for common isolation failures
Model: claude-haiku-4-5-20251001Analyzed: Jun 28, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Version History

  1. v1.1

    Content updated

    ✦ AISKILL.md content unchanged; safety grade moved A to B.

    2026-06-28

    Latest
  2. v1.0

    2026-06-24

    View This VersionInitial version

Use google/gke-multitenancy in your dev environment

Command Palette

Search for a command to run...