Skip to content

feat: Add Inspektor Gadget for real-time observabllity #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2025

Conversation

mqasimsarfraz
Copy link
Member

@mqasimsarfraz mqasimsarfraz commented Jul 22, 2025

This PR integrates Inspektor Gadget into aks-mcp, allowing to observer and troubleshoot AKS clusters. Some of the capabilities this bring include:

It allows both running the observations for a duration (foreground) or starting the observation (background) and getting the results later on.

Fixes: #22

Tools

  • inspektor_gadget - Real-time observability tool for Kubernetes clusters, allowing users to manage gadgets for monitoring and debugging

More gadgets can be integrated base on the use-case.

Features (AI generated)

🔧 Core Capabilities:

  • Deploy/Undeploy Inspektor Gadget via Helm charts
  • Real-time Monitoring of network, file, and process activity
  • Continuous Observation with start/stop/collect workflow
  • Kubernetes-aware filtering by namespace, pod, container
    📊 Available Gadgets:
  • Network: observe_tcp, observe_dns, top_tcp
  • File System: observe_file_open, top_file
  • Process: observe_process_execution, observe_signal, observe_system_calls
    🎯 Key Features:
  • Zero-instrumentation cluster debugging
  • Kubernetes metadata enrichment (pod names, namespaces, labels)
  • Flexible filtering by namespace, pod, container, or custom criteria
  • Live debugging with continuous monitoring support
  • Performance analysis with top-style aggregated views

Demo

aks-mcp-inspektor-gadget-demo.mp4

cc: @flyth / @blanquicet / @mauriciovasquezbernal

@mqasimsarfraz mqasimsarfraz force-pushed the qasim/inspektor-gadget branch from bce3e8e to e551ed4 Compare July 23, 2025 11:53
@mqasimsarfraz mqasimsarfraz changed the title Add Inspektor Gadget tools feat: Add Inspektor Gadget tools Jul 23, 2025
@mqasimsarfraz mqasimsarfraz changed the title feat: Add Inspektor Gadget tools feat: Add Inspektor Gadget for real-time observabllity Jul 23, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2025

Codecov Report

❌ Patch coverage is 32.78008% with 486 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@f9b507c). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/components/inspektorgadget/handlers.go 35.34% 130 Missing and 31 partials ⚠️
...ternal/components/inspektorgadget/gadgetmanager.go 1.25% 157 Missing ⚠️
internal/components/inspektorgadget/gadgets.go 29.72% 98 Missing and 6 partials ⚠️
internal/components/inspektorgadget/helpers.go 40.00% 51 Missing ⚠️
internal/server/server.go 0.00% 12 Missing ⚠️
internal/config/config.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #86   +/-   ##
=======================================
  Coverage        ?   31.14%           
=======================================
  Files           ?       52           
  Lines           ?     4906           
  Branches        ?        0           
=======================================
  Hits            ?     1528           
  Misses          ?     3313           
  Partials        ?       65           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mqasimsarfraz mqasimsarfraz force-pushed the qasim/inspektor-gadget branch 5 times, most recently from 2e6750e to e56c01e Compare July 23, 2025 16:45
@mqasimsarfraz mqasimsarfraz marked this pull request as ready for review July 23, 2025 16:56
@feiskyer
Copy link
Member

@mqasimsarfraz thanks for the PR. Could you combine all of those tools into a single one?

The MCP server now has 70 tools, which is too much. We are working to consolidate the toolsets and combine them together into a set of grouped tools.

@mqasimsarfraz mqasimsarfraz force-pushed the qasim/inspektor-gadget branch 2 times, most recently from 463675c to cad7246 Compare July 25, 2025 10:30
@mqasimsarfraz
Copy link
Member Author

mqasimsarfraz commented Jul 25, 2025

@mqasimsarfraz thanks for the PR. Could you combine all of those tools into a single one?

The MCP server now has 70 tools, which is too much. We are working to consolidate the toolsets and combine them together into a set of grouped tools.

Hi @feiskyer, Thanks for the quick review! I reworked the changes to reduce the number of tools. It now has inspektor_gadget as troubleshooting tool and inspektor_gadget_deploy_undeploy to manage Inspektor Gadget deployment. I would prefer to keep the deployment tool separate from troubleshooting tool but given the deployment tool is just a wrapper around helm we can also return an error so LLM can decide to install it via helm tool? (not sure if that is user friendly). What do you think?

Please feel free to have another look, the CI is green now as well!

Edit: After some thought, I agree that having a single MCP tool makes sense. So, I’ve moved everything under the inspektor-gadget tool. With proper validation, the LLM seems to handle things well, and prompts can give us more control if needed.

@mqasimsarfraz mqasimsarfraz force-pushed the qasim/inspektor-gadget branch 2 times, most recently from 4b8d4b2 to 5ae95e3 Compare July 25, 2025 21:36
Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
@mqasimsarfraz mqasimsarfraz force-pushed the qasim/inspektor-gadget branch from 5ae95e3 to c05c76c Compare July 27, 2025 12:02
Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for merging all the tools together, it is really helpful to reduce number of tools.

@feiskyer feiskyer merged commit 2b0f2ac into Azure:main Jul 28, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate with Inspektor Gadget MCP
3 participants