- Cluster with multiple namespaces (example:
booking-api,payment,search,kube-system). - Conceptually treat the cluster as a container for namespaces and workloads.
- For design notes, group namespaces and use labels or color-coding to mark environments (e.g.,
prod,staging,dev) or functional domains.
- A Kubernetes cluster with multiple namespaces and workloads.
- Common example namespaces:
booking-api,payment,search, andkube-system.
- When whiteboarding, layout the cluster first, then place namespaces, services, and any management/control-plane components around it. Annotate where credentials live (kubeconfig, service accounts) and where audit/logging will be captured.
- Direct, traditional tooling (CLI + libraries)
- Prompt-driven retrieval via a Management Control Plane (MCP) that can optionally call an LLM for summarization or natural-language responses
- Direct, traditional tooling
- Use
kubectlwith simple text processing tools for ad-hoc queries. - Use official client libraries (Python, Go, etc.) for programmatic access.
- You need precise, programmatic access or tight integration into CI/CD.
- Low-latency or frequent queries are required.
- You want to avoid the added complexity of an intermediate control plane.
- Prompt-driven retrieval via an MCP + LLM
- Expose a Management Control Plane (MCP) endpoint that accepts prompts or structured queries.
- The MCP uses available credentials (kubeconfig or in-cluster identity) to query the Kubernetes API and collect metadata.
- Optionally, the MCP passes results to an LLM for summarization, filtering, or to produce a natural-language reply.
- A user or automation submits a prompt to the MCP (example: “List namespaces with label
environment=prodand their pod counts”). - The MCP authenticates to the cluster with its kubeconfig or in-cluster credentials and queries the API.
- The MCP optionally sanitizes or pre-processes the metadata, then may forward it to an LLM for summarization or to produce a user-friendly response.
- The MCP returns the structured results or a human-readable explanation back to the requester.
- Authentication & RBAC
- The MCP must hold kubeconfig or use a service account with least-privilege RBAC to read the required resources.
- Network security
- Secure connectivity between the MCP and the Kubernetes API server (TLS, private networking, firewall rules).
- Data exposure & privacy
- Do not send secrets or other sensitive fields to an LLM. Redact or exclude sensitive fields before any model call.
- Auditability & logging
- The MCP must log queries, the invoking identity, timestamps, and the data returned so you can trace access.
- Rate limiting & caching
- Protect the cluster from excessive queries; consider caching common queries or summaries.
- Governance & policy
- Define which query types are permitted and enforce them at the MCP layer.
Be careful granting LLMs or MCPs wide access to cluster data. Ensure RBAC is least-privilege, redact sensitive fields (e.g., secrets), and keep an audit trail of queries and results.
- Authentication:
kubeconfigor service-account with least-privilege RBAC - Query engine: ability to call CoreV1 and other APIs (CustomResourceDefinitions as needed)
- Sanitization: redaction rules for secrets and sensitive annotations
- Summarization: optional LLM or built-in summarizer for human-friendly output
- Auditing: query logs, requestor identity, and response snapshots
- Extensibility: plugins for different clusters, multi-cluster support, and connectors to observability tools
- “List namespaces with label
environment=prodand pod counts” - “Show deployments in
booking-apiwithreplicas < 2” - “Which namespaces have the label
team=paymentsand what services run there?”
- Draw the Kubernetes cluster at center.
- Surrounding components:
- MCP (with a service account / kubeconfig)
- Optional LLM service (external or integrated)
- Logging / audit sink
- Users or automation (CLI, web UI, chat bot)
- Annotate network paths and RBAC scopes.
- You want natural-language access for non-kubernetes users (product owners, support).
- You need a single control-plane endpoint to centralize queries, redaction, and auditing.
- You need to translate raw metadata into higher-level answers or action items.
- Concise definition of an MCP and the core capabilities required for safe Kubernetes metadata access.
- MCP design patterns and recommended open-source / vendor options.
- A walkthrough: building a simple, safe MCP that queries a cluster and optionally integrates with an LLM for summarization.
- Kubernetes Documentation
- kubernetes-client / python
- client-go (Go client)
- Kubernetes RBAC documentation