Skip to main content
Glama

get_daemonsets

Retrieve all DaemonSets in a specified Kubernetes namespace to monitor and manage cluster-wide pod deployments.

Instructions

Get all daemonsets in the specified namespace

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
namespaceNodefault

Implementation Reference

  • The handler function for the 'get_daemonsets' tool. It uses kubectl to fetch DaemonSets in the specified namespace (default: 'default') as JSON, or returns an error dictionary if the command fails.
    @mcp.tool() async def get_daemonsets(namespace: str = "default") -> dict: """Get all daemonsets in the specified namespace""" try: cmd = ["kubectl", "get", "daemonsets", "-n", namespace, "-o", "json"] result = subprocess.run(cmd, capture_output=True, text=True, check=True) return json.loads(result.stdout) except subprocess.CalledProcessError as e: return {"error": f"Failed to get daemonsets: {str(e)}"}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/abhijeetka/mcp-k8s-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server