kubectl_create
Create Kubernetes resources from YAML manifests, files, or subcommand inputs, with options for dry-run validation, namespaces, labels, and output formats.
Instructions
Create Kubernetes resources using various methods (from file or using subcommands)
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "kubectl_create"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Name of the resource to create | |
| port | No | Port that the container exposes | |
| image | No | Image to use for the containers in the deployment | |
| dryRun | No | If true, only validate the resource, don't actually execute the operation | |
| labels | No | Labels to apply to the resource (e.g. ["key1=value1", "key2=value2"]) | |
| output | No | Output format. One of: json|yaml|name|go-template|template|jsonpath|jsonpath-as-json. The template formats take their template inline, e.g. 'jsonpath={.metadata.name}'. | yaml |
| command | No | Command to run in the container | |
| context | No | Kubeconfig Context to use for the command (optional - defaults to null) | |
| suspend | No | Whether to suspend the CronJob | |
| tcpPort | No | Port pairs for tcp service (e.g. ["80:8080", "443:8443"]) | |
| filename | No | Path to a YAML file to create resources from. The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use 'manifest' to pass the file's contents instead. | |
| fromFile | No | Path to file for creating configmap/secret (e.g. ["key1=/path/to/file1", "key2=/path/to/file2"]). The path is read on the machine running the MCP server, so it is rejected when the server runs over a remote (SSE/Streamable HTTP) transport; use "fromFileContent" to pass file contents directly instead. | |
| manifest | No | YAML manifest to create resources from | |
| replicas | No | Number of replicas to create for the deployment | |
| schedule | No | Cron schedule expression for the CronJob (e.g. "*/5 * * * *") | |
| validate | No | If true, validate resource schema against server schema | |
| namespace | No | Kubernetes namespace | default |
| secretType | No | Type of secret to create (generic, docker-registry, tls) | |
| annotations | No | Annotations to apply to the resource (e.g. ["key1=value1", "key2=value2"]) | |
| fromLiteral | No | Key-value pair for creating configmap (e.g. ["key1=value1", "key2=value2"]) | |
| serviceType | No | Type of service to create (clusterip, nodeport, loadbalancer, externalname) | |
| resourceType | No | Type of resource to create (namespace, configmap, deployment, service, etc.) | |
| fromFileContent | No | Inline file contents for creating a configmap/secret, provided by the client instead of a server-side path (e.g. [{"key": "app.conf", "content": "..."}]). Safe on all transports; use this instead of "fromFile" on remote (SSE/Streamable HTTP) servers. |