
GKE Multi-Tenancy
FreeEfficiently manage shared GKE clusters for multiple teams.
Free · Opens the source repo
What GKE Multi-Tenancy does
GKE Multi-Tenancy is a specialized skill designed for enterprises looking to implement multi-tenancy on Google Kubernetes Engine (GKE). It provides a comprehensive guide for configuring and managing shared GKE clusters, ensuring that multiple teams can operate within a single environment while maintaining necessary isolation and resource management. This skill covers essential topics such as namespace isolation, Role-Based Access Control (RBAC) planning, resource quotas, and network segmentation, which are critical for effective multi-tenant architectures.
The skill begins by outlining various multi-tenancy models, including namespace-per-team and cluster-per-team strategies. It emphasizes the importance of starting with less complex models for cost efficiency and scalability, escalating to more isolated configurations only when compliance requirements dictate. Users will find practical examples and commands for setting up namespaces, configuring RBAC roles, and applying resource quotas to prevent resource contention among teams.
In addition to resource management, GKE Multi-Tenancy addresses network isolation through Kubernetes Network Policies, ensuring that workloads are securely segmented. The skill also includes guidance on cost allocation, allowing teams to track and manage their resource usage effectively. By labeling namespaces for billing and enabling GKE's cost allocation features, organizations can gain insights into their cloud expenditures, helping to optimize costs across different teams and projects.
This skill is particularly useful for DevOps engineers, cloud architects, and system administrators who are tasked with managing GKE environments in a multi-tenant setup. It provides the necessary tools and best practices to create a secure, efficient, and cost-effective Kubernetes infrastructure that meets the needs of diverse teams within an organization.
When to use it
Use this skill when multiple teams need to share a single GKE cluster while ensuring isolation and resource management.
When not to use it
This skill is not suitable for single-tenant cluster configurations or general deployment instructions; consider using gke-basics or gke-app-onboarding instead.
What you can build with it
Setting Up a Multi-Tenant GKE Cluster
Use this skill to configure a GKE cluster that supports multiple teams, ensuring each team has its own namespace and appropriate resource limits.
Implementing RBAC for Team Isolation
Leverage the RBAC configuration examples provided to enforce least-privilege access controls for different teams within a shared GKE environment.
Tracking Costs Across Teams
Utilize the cost allocation features to label namespaces and enable cost tracking, helping to manage and optimize cloud expenditures.
How to install GKE Multi-Tenancy
View source1. Install with the skills CLI
npx skills add google/skills/gke-multitenancy --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by googleGKE 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-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
minormaxlimits in aLimitRange, you must also define correspondingdefaultanddefaultRequestvalues. If you set aminormaxwithout 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
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.
Frequently asked questions about GKE Multi-Tenancy
Similar skills
Turborepo
Optimized build system for JavaScript/TypeScript monorepos.
Azure Pipelines Validation
Streamline your Azure DevOps pipeline changes locally.
Azure Developer CLI
Streamline your Azure project workflows with best practices.
Azure Container Registry CLI
Manage Azure Container Registry resources with ease.
Aspire
Build and orchestrate polyglot distributed applications seamlessly.
Vercel CLI
Manage and deploy Vercel projects from the command line.
