Skip to main content
Glama

create_deployment

Deploy Kubernetes applications by specifying name, image, namespace, and replica count. Simplifies cluster management within the MCP Kubernetes Server environment.

Instructions

Create a Kubernetes deployment with specified name, image, namespace and replicas

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
imageYes
nameYes
namespaceNodefault
replicasNo

Implementation Reference

  • kubernetes.py:190-190 (registration)
    Registration of the 'create_deployment' tool using the @mcp.tool() decorator.
    @mcp.tool()
  • The main handler function for the 'create_deployment' tool. It uses kubectl to create a deployment with the given parameters.
    async def create_deployment(name: str, image: str, namespace: str = "default", replicas: int = 1) -> dict: """Create a Kubernetes deployment with specified name, image, namespace and replicas""" try: # Apply the deployment cmd = ["kubectl", "create", "deploy", name, "--replicas", str(replicas), "--image", image, "-n", namespace] result = subprocess.run(cmd, capture_output=True, text=True, check=True) return {"message": f"Deployment {name} created successfully in namespace {namespace}", "details": result.stdout} except subprocess.CalledProcessError as e: return {"error": f"Failed to create deployment: {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