Skip to main content

Kubernetes management with natural language using GPT-4o and MCP tools

Workflow preview

Workflow preview
100%
Kubernetes management with natural language using GPT-4o and MCP tools preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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 queri...

Best for

  • DevOps automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-mcp.mcpclient, n8n-nodes-mcp.mcpclienttool, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Aadarsh Jain.

Original n8n.io source

1.1 Workflow description

Title
Kubernetes management with natural language using GPT-4o and MCP tools
Workflow name
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:

  1. Cluster Discovery & Context Switching - Automatically lists available clusters from your kubeconfig and switches to the appropriate cluster based on your natural language query
  2. Command Generation - Uses GPT-4o to analyze your request and generate the correct kubectl command with proper flags, selectors, and output formatting
  3. 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

  1. Clone the MCP Server

    git clone https://github.com/aadarshjain/kubectl-mcp-server
    cd kubectl-mcp-server
    
  2. Configure your kubeconfig - Ensure your ~/.kube/config contains all the clusters you want to access

  3. Set up MCP STDIO credentials in n8n

  • Command: /full/path/to/python-package
  • Arguments: /full/path/to/kubectl-mcp-server/server.py
  1. Import the workflow into your n8n instance

  2. Configure OpenAI credentials for the GPT-4o models

  3. Test the workflow using the chat interface with queries like "show pods in [cluster-name]"

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - OpenAI K8s Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 2 - K8s Query Analyzer

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.1

Block 3 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 4 - Kubectl MCP Tool

Type / Role
n8n-nodes-mcp.mcpClient - mcpClient
Config choices
Version 1

Block 5 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 6 - List K8s Clusters

Type / Role
n8n-nodes-mcp.mcpClientTool - mcpClientTool
Config choices
Version 1

Block 7 - K8s Cluster Analyzer

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.1

Block 8 - Switch K8s Context

Type / Role
n8n-nodes-mcp.mcpClient - mcpClient
Config choices
Version 1

Block 9 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Kubernetes management with natural language using GPT-4o and MCP tools
Complexity intermediate
Nodes 11
Categories DevOps, Multimodal AI
Author Aadarsh Jain
Published 11 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7236/7236.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Kubernetes management with natural language using GPT-4o and MCP tools do?

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 queri...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your DevOps, Multimodal AI use case.