kubectl_create
Create Kubernetes resources via YAML files or subcommands, with dry-run and output format options.
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 |
|---|---|---|---|
| dryRun | No | If true, only validate the resource, don't actually execute the operation | |
| output | No | Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file | yaml |
| validate | No | If true, validate resource schema against server schema | |
| manifest | No | YAML manifest to create resources from | |
| filename | No | Path to a YAML file to create resources from | |
| resourceType | No | Type of resource to create (namespace, configmap, deployment, service, etc.) | |
| name | No | Name of the resource to create | |
| namespace | No | Kubernetes namespace | default |
| fromLiteral | No | Key-value pair for creating configmap (e.g. ["key1=value1", "key2=value2"]) | |
| fromFile | No | Path to file for creating configmap (e.g. ["key1=/path/to/file1", "key2=/path/to/file2"]) | |
| secretType | No | Type of secret to create (generic, docker-registry, tls) | |
| serviceType | No | Type of service to create (clusterip, nodeport, loadbalancer, externalname) | |
| tcpPort | No | Port pairs for tcp service (e.g. ["80:8080", "443:8443"]) | |
| image | No | Image to use for the containers in the deployment | |
| replicas | No | Number of replicas to create for the deployment | |
| port | No | Port that the container exposes | |
| schedule | No | Cron schedule expression for the CronJob (e.g. "*/5 * * * *") | |
| suspend | No | Whether to suspend the CronJob | |
| command | No | Command to run in the container | |
| labels | No | Labels to apply to the resource (e.g. ["key1=value1", "key2=value2"]) | |
| annotations | No | Annotations to apply to the resource (e.g. ["key1=value1", "key2=value2"]) | |
| context | No | Kubeconfig Context to use for the command (optional - defaults to null) |