Skip to content

Commit 7d67dd0

Browse files
authored
Merge pull request #2923 from port-labs/update-auto-heal-k8-pods-to-use-new-tool-call
Update AI agent documentation for Kubernetes pod healing
2 parents 1cf2625 + d05d5e3 commit 7d67dd0

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

docs/guides/all/heal-unhealthy-k8s-pods.md

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,20 +1107,6 @@ Next, we will create an AI agent that analyzes pod health issues and creates com
11071107
"properties": {
11081108
"description": "AI agent specialized in diagnosing and automatically fixing unhealthy Kubernetes workloads. Monitors pod health, identifies root causes, and applies appropriate fixes.",
11091109
"status": "active",
1110-
"allowed_blueprints": [
1111-
"k8s_workload",
1112-
"k8s_pod",
1113-
"k8s_replicaSet",
1114-
"k8s_namespace",
1115-
"k8s_cluster"
1116-
],
1117-
"allowed_actions": [
1118-
"get_k8s_pod_logs",
1119-
"restart_k8s_workload",
1120-
"scale_k8s_workload",
1121-
"update_k8s_workload_config",
1122-
"create_k8s_fix_pr"
1123-
],
11241110
"prompt": "You are a Kubernetes healing AI agent with access to comprehensive SDLC data and pod logs.\n\n**Your healing process:**\n1. **FIRST - Get Logs**: Always start by retrieving pod logs using the get_k8s_pod_logs action to understand what's actually happening\n2. **Analyze with Context**: Combine log data with SDLC information (recent deployments, code changes, configuration updates) to build a complete picture\n3. **Intelligent Diagnosis**: Based on logs and context, determine the root cause (crashes, resource constraints, configuration issues, etc.)\n4. **Targeted Fix**: Execute only the specific action that will resolve the issue:\n - Restart for crashes and transient issues\n - Scale for resource constraints (CPU/memory)\n - Update config for resource limit issues\n - Create PR for complex fixes requiring code changes\n5. **Explain Your Actions**: Always explain what you found in the logs and why you chose the specific fix in your response",
11251111
"execution_mode": "Automatic",
11261112
"conversation_starters": [
@@ -1130,13 +1116,25 @@ Next, we will create an AI agent that analyzes pod health issues and creates com
11301116
"Scale up resources for this memory-constrained workload",
11311117
"What's causing this ImagePullBackOff error?",
11321118
"Why are my pods stuck in Pending state?"
1119+
],
1120+
"tools": [
1121+
"^(list|get|search|track|describe)_.*",
1122+
"run_get_k8s_pod_logs",
1123+
"run_restart_k8s_workload",
1124+
"run_scale_k8s_workload",
1125+
"run_update_k8s_workload_config",
1126+
"run_create_k8s_fix_pr"
11331127
]
11341128
},
11351129
"relations": {}
11361130
}
11371131
```
11381132
</details>
11391133

1134+
:::tip MCP Enhanced Capabilities
1135+
The AI agent uses MCP (Model Context Protocol) enhanced capabilities to automatically discover important and relevant blueprint entities via its tools. The `^(list|get|search|track|describe)_.*` pattern allows the agent to access and analyze related entities across your entire software catalog, including Kubernetes resources, recent deployments, code changes, runbooks, and history logs. This gives the agent rich SDLC context to make intelligent healing decisions. Additionally, we explicitly add the remediation action tools (`run_get_k8s_pod_logs`, `run_restart_k8s_workload`, etc.), which the agent calls sequentially to diagnose and fix unhealthy workloads.
1136+
:::
1137+
11401138
5. Click `Create` to save the agent.
11411139

11421140
## Set up automation

0 commit comments

Comments
 (0)