Kubernetes Management with Natural Language using GPT-4o and MCP Tools
Who is this for?
This workflow is designed for DevOps engineers, platform engineers, and Kubernetes administrators who want to interact with their Kubernetes clusters through natural language queries in n8n. It's perfect for teams who need quick cluster insights without memorizing complex kubectl commands or switching between multiple cluster contexts manually.
How it works?
The workflow operates in three intelligent stages:
Cluster Discovery & Context Switching - Automatically lists available clusters from your kubeconfig and switches to the appropriate cluster based on your natural language query Command Generation - Uses GPT-4o to analyze your request and generate the correct kubectl command with proper flags, selectors, and output formatting Command Execution - Executes the generated kubectl command against your selected cluster and returns the results
The workflow supports multi-cluster environments and can handle queries like: "Show me all pods in production cluster" "List failing deployments in production" "Get pod details in kube-system namespace"
Setup
Clone the MCP Server git clone https://github.com/aadarshjain/kubectl-mcp-server cd kubectl-mcp-server
Configure your kubeconfig - Ensure your ~/.kube/config contains all the clusters you want to access
Set up MCP STDIO credentials in n8n Command: /full/path/to/python-package Arguments: /full/path/to/kubectl-mcp-server/server.py
Import the workflow into your n8n instance
Configure OpenAI credentials for the GPT-4o models
Test the workflow using the chat interface with queries like "show pods in [cluster-name]"
Related Templates
Use OpenRouter in n8n versions <1.78
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot...
Task Deadline Reminders with Google Sheets, ChatGPT, and Gmail
Intro This template is for project managers, team leads, or anyone who wants to automatically remind teammates of tasks ...
🤖 Build Resilient AI Workflows with Automatic GPT and Gemini Failover Chain
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. How it works This...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments