{"data":{"slug":"github-google-skills-skills-cloud-gke-multitenancy-c35fae25ab1c","title":"GKE Multi-Tenancy Configuration","summary":"Configure multi-tenancy on GKE with namespace isolation, RBAC, resource quotas, and network policies for team isolation and cost allocation. Deliverables include isolated namespaces, role-based access controls, and resource constraints defined in YAML format.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-multitenancy-c35fae25ab1c","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-gke-multitenancy-c35fae25ab1c","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-multitenancy-c35fae25ab1c.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-multitenancy-c35fae25ab1c\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before executing any `gcloud`, REST API, or MCP command, you must read [Usage Attribution](references\/attribution.md). For terminal commands, 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 defining `min` or `max` limits in a `LimitRange`, you must also define corresponding `default` and `defaultRequest` values.","instructions":"---\nname: gke-multitenancy\ndescription: >-\n  Plans and configures multi-tenancy on GKE. Covers namespace isolation, RBAC\n  planning for teams, resource quotas, LimitRanges, network isolation, and\n  cost allocation. Use when designing GKE multi-tenancy, configuring GKE\n  namespaces, setting up resource quotas, or isolating GKE teams. Don't use\n  for single-tenant cluster configuration or general deployment instructions\n  (use gke-basics or gke-app-onboarding instead).\nmetadata:\n  version: \"1.0.2\"\n  category: Containers\n---\n\n# GKE Multi-Tenancy\n\nThis reference covers enterprise multi-tenancy patterns on GKE, including\nnamespace isolation, RBAC planning, resource quotas, and network segmentation.\n\n> **MCP Tools:** `apply_k8s_manifest`, `get_k8s_resource`, `check_k8s_auth`,\n> `describe_k8s_resource`, `delete_k8s_resource`\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\/attribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\/1.0 (skill:gke-multitenancy)\"`\nand append `agent-skills\/1.0 (skill:gke-multitenancy)` to `User-Agent` headers.\n\n## When to Use\n\n-   Multiple teams sharing a single GKE cluster\n-   Isolating workloads by environment (dev\/staging\/prod) within one cluster\n-   Implementing least-privilege access control\n-   Cost allocation across teams or projects\n\n## Multi-Tenancy Models\n\n| Model                         | Isolation    | Complexity | Cost           |\n| ----------------------------- | ------------ | ---------- | -------------- |\n| **Namespace-per-team**        | Soft (RBAC + | Low        | Lowest (shared |\n:                               : Network      :            : cluster)       :\n:                               : Policy)      :            :                :\n| **Namespace-per-environment** | Soft         | Low        | Low            |\n| **Node pool-per-team**        | Medium       | Medium     | Medium         |\n:                               : (dedicated   :            :                :\n:                               : compute)     :            :                :\n| **Cluster-per-team**          | Hard (full   | High       | Highest        |\n:                               : isolation)   :            :                :\n\n> **Golden path recommendation**: Start with namespace-per-team for cost\n> efficiency. Escalate to stronger isolation only when compliance requires it.\n\n## Namespace Isolation Setup\n\n### 1. Create Namespaces\n\n```bash\nkubectl create namespace team-a\nkubectl create namespace team-b\nkubectl label namespace team-a team=a\nkubectl label namespace team-b team=b\n```\n\n### 2. RBAC Configuration\n\n**Principle**: Grant minimal permissions per namespace. Never bind to\n`system:authenticated`.\n\n```yaml\n# Namespace-scoped role for a team\napiVersion: rbac.authorization.k8s.io\/v1\nkind: Role\nmetadata:\n  name: team-a-developer\n  namespace: team-a\nrules:\n- apiGroups: [\"\", \"apps\", \"batch\"]\n  resources: [\"pods\", \"deployments\", \"services\", \"configmaps\", \"jobs\"]\n  verbs: [\"get\", \"list\", \"watch\", \"create\", \"update\", \"patch\", \"delete\"]\n---\napiVersion: rbac.authorization.k8s.io\/v1\nkind: RoleBinding\nmetadata:\n  name: team-a-developers\n  namespace: team-a\nsubjects:\n- kind: Group\n  name: \"team-a@example.com\"  # Google Group\n  apiGroup: rbac.authorization.k8s.io\nroleRef:\n  kind: Role\n  name: team-a-developer\n  apiGroup: rbac.authorization.k8s.io\n```\n\n**RBAC best practices:** Use Google Groups for subject bindings. Prefer\nnamespace-scoped Roles over ClusterRoles. See the `gke-platform-security` skill\nfor full RBAC hardening guidance.\n\n### 3. Resource Quotas\n\nPrevent any single team from consuming all cluster resources:\n\n```yaml\napiVersion: v1\nkind: ResourceQuota\nmetadata:\n  name: team-a-quota\n  namespace: team-a\nspec:\n  hard:\n    requests.cpu: \"10\"\n    requests.memory: \"20Gi\"\n    limits.cpu: \"20\"\n    limits.memory: \"40Gi\"\n    pods: \"50\"\n    services: \"10\"\n    persistentvolumeclaims: \"10\"\n```\n\n### 4. LimitRanges\n\nSet default and maximum resource constraints per container:\n\n```yaml\napiVersion: v1\nkind: LimitRange\nmetadata:\n  name: team-a-limits\n  namespace: team-a\nspec:\n  limits:\n  - type: Container\n    default:\n      cpu: \"500m\"\n      memory: \"512Mi\"\n    defaultRequest:\n      cpu: \"100m\"\n      memory: \"128Mi\"\n    max:\n      cpu: \"4\"\n      memory: \"8Gi\"\n```\n\n> [!IMPORTANT] **Mandatory Defaults**: When defining `min` or `max` limits in a\n> `LimitRange`, you **must** also define corresponding `default` and\n> `defaultRequest` values. If you set a `min` or `max` without defaults, any pod\n> deployed without explicit resource requests\/limits will be rejected by the\n> admission controller.\n\n### 5. Network Isolation\n\nApply default-deny per namespace (see the `gke-workload-security` skill), then\nallow intra-team traffic:\n\n```yaml\n# Allow same-namespace pods to talk + DNS\napiVersion: networking.k8s.io\/v1\nkind: NetworkPolicy\nmetadata:\n  name: allow-same-namespace\n  namespace: team-a\nspec:\n  podSelector: {}\n  ingress:\n  - from:\n    - podSelector: {}\n  egress:\n  - to:\n    - podSelector: {}\n  - to:  # Allow DNS\n    - namespaceSelector: {}\n      podSelector:\n        matchLabels:\n          k8s-app: kube-dns\n    ports:\n    - protocol: UDP\n      port: 53\n```\n\n## Cost Allocation\n\n### Labels for Cost Attribution\n\n```bash\n# Label namespaces for billing\nkubectl label namespace team-a cost-center=engineering\nkubectl label namespace team-b cost-center=data-science\n```\n\n### GKE Cost Allocation\n\nEnable GKE cost allocation to break down costs by namespace and label:\n\n```bash\ngcloud container clusters update <CLUSTER_NAME> --region <REGION> \\\n  --enable-cost-allocation\n```\n\nView in the Cloud Billing Reports page or query the Cloud Billing detailed usage\ncost export in BigQuery.\n","use_cases":["Isolating multiple teams on a single GKE cluster","Implementing least-privilege access control","Setting up resource quotas for team workloads","Configuring network policies for intra-team communication"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/e3c591afe426ea585e4c21799e5199d6d47cd1be\/skills\/cloud\/gke-multitenancy\/SKILL.md","source_commit":"e3c591afe426ea585e4c21799e5199d6d47cd1be","license":null,"version":null,"listing_approved_at":"2026-11-17","created_at":"2026-11-16T16:14:23.000000Z","updated_at":"2026-11-17T10:20:00.000000Z","seo_title":"GKE Multi-Tenancy Setup Guide","seo_description":"Configure GKE multi-tenancy with namespace isolation, RBAC, and resource quotas for team isolation and cost allocation.","seo_keywords":["GKE multi-tenancy setup","GKE namespace isolation","GKE RBAC configuration","GKE resource quotas","GKE network policies"]}}