Skip to content

Kubernetes RBAC Permissions Mapping

(Updated for v0.2.0)

This page documents the mapping between the Model Context Protocol (MCP) tools exposed by @nogoo9/no-crd and the corresponding Kubernetes RBAC permissions they require.

The server dynamically checks these permissions at startup (unless disabled via DISABLE_PERMISSION_CHECKS=true) and only enables tools for which the active service account has sufficient RBAC access.

Resource: configmaps

Required VerbAssociated MCP ToolsDescription / Purpose
createcreate_templateSave a new pod template definition as a ConfigMap.
deletedelete_templateDelete a stored pod template ConfigMap.
getcreate_pod_from_template, get_templateRead template pod specifications stored in ConfigMaps.
listlist_templatesFind ConfigMaps registered as reusable pod templates.
updateupdate_templateModify metadata, annotations, or specifications of an existing template.

Resource: namespaces

Required VerbAssociated MCP ToolsDescription / Purpose
listlist_namespacesDiscover namespaces in the cluster (only required in cluster access mode).

Resource: pods

Required VerbAssociated MCP ToolsDescription / Purpose
createcreate_pod, create_pod_from_template, spawn_workspaceProvision and deploy new pods or workspace sandboxes.
deletedelete_pod, stop_workspaceTerminate and clean up pods or workspace sandboxes.
getget_podRetrieve detailed JSON spec for a specific pod.
listlist_pods, list_workspacesRetrieve lists of pods or agent workspace pods.
patchpatch_podStrategic merge patch labels, annotations, or resource requests/limits.

Resource: pods/log

Required VerbAssociated MCP ToolsDescription / Purpose
getget_pod_logsRetrieve standard output/error logs from pod containers.

RBAC YAML Examples

Here are the complete Kubernetes manifests required to run the MCP server in either Cluster Mode (cluster-wide access) or Namespaced Mode (single namespace access).

1. Cluster Mode RBAC

Use this configuration when the MCP server needs to orchestrate workspaces and retrieve templates across multiple namespaces.

ClusterRole Configuration (mcp-cluster-role.yaml)

yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: nogoo-mcp-cluster-role
rules:
  # Pod orchestration & workspace management
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list", "watch", "create", "delete", "patch", "update"]
  # Pod log streams
  - apiGroups: [""]
    resources: ["pods/log"]
    verbs: ["get"]
  # Namespace auto-discovery
  - apiGroups: [""]
    resources: ["namespaces"]
    verbs: ["get", "list"]
  # ConfigMap-based pod templates
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["get", "list", "create", "update", "patch", "delete"]
  # IAM-role service account provisioning
  - apiGroups: [""]
    resources: ["serviceaccounts"]
    verbs: ["get", "list", "create", "update", "patch", "delete"]

ServiceAccount & Binding

yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: nogoo-mcp-sa
  namespace: nogoo9
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: nogoo-mcp-cluster-binding
subjects:
  - kind: ServiceAccount
    name: nogoo-mcp-sa
    namespace: nogoo9
roleRef:
  kind: ClusterRole
  name: nogoo-mcp-cluster-role
  apiGroup: rbac.authorization.k8s.io

2. Namespaced Mode RBAC

Use this configuration if the MCP server's operations are locked down to a single target namespace. The server will restrict pod lifecycle, templates, and permissions queries strictly to that namespace, and namespace listing operations (list_namespaces) will be bypassed.

Role Configuration (mcp-namespaced-role.yaml)

yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: nogoo-mcp-namespaced-role
  namespace: nogoo9
rules:
  # Pod orchestration & workspace management
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list", "watch", "create", "delete", "patch", "update"]
  # Pod log streams
  - apiGroups: [""]
    resources: ["pods/log"]
    verbs: ["get"]
  # ConfigMap-based pod templates
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["get", "list", "create", "update", "patch", "delete"]
  # IAM-role service account provisioning
  - apiGroups: [""]
    resources: ["serviceaccounts"]
    verbs: ["get", "list", "create", "update", "patch", "delete"]

ServiceAccount & Binding

yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: nogoo-mcp-sa
  namespace: nogoo9
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: nogoo-mcp-namespaced-binding
  namespace: nogoo9
subjects:
  - kind: ServiceAccount
    name: nogoo-mcp-sa
    namespace: nogoo9
roleRef:
  kind: Role
  name: nogoo-mcp-namespaced-role
  apiGroup: rbac.authorization.k8s.io