Gestión conversacional de Kubernetes basada en GPT-4o e integración MCP
Este es unDevOps, AIflujo de automatización del dominio deautomatización que contiene 14 nodos.Utiliza principalmente nodos como McpClientTool, Agent, ChatTrigger, LmChatOpenAi, MemoryBufferWindow, combinando tecnología de inteligencia artificial para lograr automatización inteligente. Gestión conversacional de Kubernetes basada en GPT-4o e integraciones MCP
- •Clave de API de OpenAI
Nodos utilizados (14)
Categoría
{
"meta": {
"instanceId": "66f06061721f1f7966ba3bdd29bb7db37d84222e0e73cbdc5057760193ad29bf",
"templateCredsSetupCompleted": true
},
"nodes": [
{
"id": "41c2617e-b606-473d-ac07-ac0c5901935a",
"name": "Al recibir mensaje de chat",
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"position": [
400,
-80
],
"webhookId": "2eb47787-160f-49ad-b98d-1d8ee757765c",
"parameters": {
"options": {}
},
"typeVersion": 1.1
},
{
"id": "be64c331-8fb2-4efd-a10e-beb1938cdb71",
"name": "Agente IA",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
800,
-80
],
"parameters": {
"options": {
"systemMessage": "=You are a Kubernetes assistant connected to an MCP (Model Context Protocol) Server. Your role is to help users monitor, inspect, and troubleshoot Kubernetes resources using the following tools.\ncurrent time is {{ $now.setZone('Asia/Tehran') }}\n\nAvailable Tools:\n1. getEvents(namespace) – Fetch events in the given namespace.\n2. getPodsLogs(namespace, podName) – Retrieve logs for a specific pod.\n3. getResource(namespace, resourceKind, resourceName) – Get details of a specific resource.\n4. createOrUpdateResource(namespace, resourceYaml) – Create or update a resource using full YAML.\n5. getNodeMetrics(nodeName) – Retrieve CPU and memory usage of a node.\n6. getPodMetrics(namespace, podName) – Retrieve CPU and memory usage of a pod.\n7. describeResource(namespace, resourceKind, resourceName) – Detailed description of a resource.\n8. listResources(namespace, resourceKind) – List all resources of a given kind in a namespace. for example{\"Kind\": \"Pod\",\"namespace\": \"x\"}\n9. getAPIResources() – List all supported resource kinds in the cluster.\n\nUsage Rules:\n***keep your answers short and meaningful***\n- Always validate input arguments before calling any tool.\n- Ask the user for any missing information (e.g., namespace, podName, resourceKind).\n- Do not assume defaults; always confirm with the user.\n- Avoid destructive operations unless explicitly instructed (only createOrUpdateResource modifies the cluster).\n- Use getAPIResources() to help the user explore available resource kinds.\n- Respond with concise, plain-language explanations of the results when helpful.\n"
}
},
"typeVersion": 1.8
},
{
"id": "61247bd0-5e76-4165-af70-26c0d605d12f",
"name": "Simple Memoria",
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"position": [
340,
140
],
"parameters": {},
"typeVersion": 1.3
},
{
"id": "f8136d5d-c5db-4c4f-a080-ad65d5ef9aac",
"name": "MCP Client",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
460,
260
],
"parameters": {
"connectionType": "sse"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "47eae87b-f2fa-46d5-9f77-d168e47e9bfe",
"name": "getAPIResources",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
580,
260
],
"parameters": {
"toolName": "getAPIResources",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"method\": \"getAPIResources\",\n \"params\": {\n \"arguments\": {\n \"includeNamespaceScoped\": true,\n \"includeClusterScoped\": true\n }\n }\n}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "648eacf9-436d-44d6-9389-a0a5212071fa",
"name": "listResources",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
740,
260
],
"parameters": {
"toolName": "listResources",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "={\"Kind\": \"{{ $fromAI('Kind', 'Select the kind given by ai agent', 'string') }}\",\n\"namespace\" : \"{{ $fromAI('namespace', 'Select the namespace given by ai agent', 'string') }}\"}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "a62f3378-65fe-4178-9fba-b52ba437ca38",
"name": "describeResource",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
900,
260
],
"parameters": {
"toolName": "describeResource",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "={\"Kind\": \"{{ $fromAI('Kind', 'Select the kind given by ai agent', 'string') }}\",\n\"name\" : \"{{ $fromAI('name', 'Select the name given by ai agent', 'string') }}\",\n\"namespace\" : \"{{ $fromAI('namespace', 'Select the namespace given by ai agent', 'string') }}\"}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "c159ae52-4963-4103-93ad-083230b46da3",
"name": "getPodMetrics",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
1040,
260
],
"parameters": {
"toolName": "getPodMetrics",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "={\"podName\" : \"{{ $fromAI('podName', 'Select the pod name given by ai agent', 'string') }}\",\n\"namespace\" : \"{{ $fromAI('namespace', 'Select the namespace given by ai agent', 'string') }}\"}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "f49b0804-b15a-4a7d-ac9f-44f51795abdf",
"name": "getNodeMetrics",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
1180,
260
],
"parameters": {
"toolName": "getNodeMetrics",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "={\"Name\" : \"{{ $fromAI('Name', 'Select the name given by ai agent', 'string') }}\"}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "decd4807-5dbe-4f65-8bd5-8401ee2b0154",
"name": "createorUpdateResource",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
1340,
240
],
"parameters": {
"toolName": "createResource",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "={\"manifest\" : \"{{ $fromAI('manifest', 'Select the manifest given by ai agent', 'string').trim() }}\",\n\"namespace\" : \"{{ $fromAI('namespace', 'Select the namespace given by ai agent', 'string') }}\"}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "1b1bc11c-565e-46f7-8b38-e74489ea2372",
"name": "getResource",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
1440,
140
],
"parameters": {
"toolName": "getResource",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "={\"kind\": \"{{ $fromAI('kind', 'Select the kind given by ai agent', 'string') }}\",\n\"name\" : \"{{ $fromAI('name', 'Select the name given by ai agent', 'string') }}\",\n\"namespace\" : \"{{ $fromAI('namespace', 'Select the namespace given by ai agent', 'string') }}\"}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "f34b5527-c048-4e6e-b86a-585a586ef8ff",
"name": "getPodsLogs",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
1420,
-20
],
"parameters": {
"toolName": "getPodsLogs",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "={\"Name\" : \"{{ $fromAI('Name', 'Select the name given by ai agent', 'string') }}\",\n\"namespace\" : \"{{ $fromAI('namespace', 'Select the namespace given by ai agent', 'string') }}\"}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "68234560-f7f9-4a6a-9579-497ff458fedc",
"name": "getEvents",
"type": "n8n-nodes-mcp.mcpClientTool",
"position": [
1340,
-160
],
"parameters": {
"toolName": "getEvents",
"operation": "executeTool",
"connectionType": "sse",
"toolParameters": "={\n\"namespace\" : \"{{ $fromAI('namespace', 'Select the namespace given by ai agent', 'string') }}\"}"
},
"credentials": {
"mcpClientSseApi": {
"id": "eyJUyjbc2529AKLS",
"name": "k8s"
}
},
"typeVersion": 1
},
{
"id": "9a20f489-799e-44aa-a6cd-2f68814113a6",
"name": "Modelo de chat OpenAI",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
220,
140
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o-mini"
},
"options": {
"maxTokens": -1
}
},
"credentials": {
"openAiApi": {
"id": "CvwUuKPhahoMTR21",
"name": "OpenAi play ground"
}
},
"typeVersion": 1.2
}
],
"pinData": {},
"connections": {
"68234560-f7f9-4a6a-9579-497ff458fedc": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"f8136d5d-c5db-4c4f-a080-ad65d5ef9aac": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"f34b5527-c048-4e6e-b86a-585a586ef8ff": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"1b1bc11c-565e-46f7-8b38-e74489ea2372": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Simple Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
},
"c159ae52-4963-4103-93ad-083230b46da3": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"648eacf9-436d-44d6-9389-a0a5212071fa": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"f49b0804-b15a-4a7d-ac9f-44f51795abdf": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"47eae87b-f2fa-46d5-9f77-d168e47e9bfe": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"a62f3378-65fe-4178-9fba-b52ba437ca38": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"decd4807-5dbe-4f65-8bd5-8401ee2b0154": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
}
}
}¿Cómo usar este flujo de trabajo?
Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.
¿En qué escenarios es adecuado este flujo de trabajo?
Intermedio - DevOps, Inteligencia Artificial
¿Es de pago?
Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.
Flujos de trabajo relacionados recomendados
Reza Gholizade
@reza-gholizadeI'm a seasoned Solution Architect with expertise in designing and implementing complex, scalable systems across various platforms. With a strong foundation in cloud infrastructure, microservices architecture, Kubernetes, and DevOps practices, they specialize in creating innovative solutions using cutting-edge technologies and tools.
Compartir este flujo de trabajo