mcp-server-kubernetes
Version:
MCP server for interacting with Kubernetes clusters via kubectl
157 lines (156 loc) • 6.33 kB
TypeScript
import { KubernetesManager } from "../types.js";
export declare const kubectlCreateSchema: {
readonly name: "kubectl_create";
readonly description: "Create Kubernetes resources using various methods (from file or using subcommands)";
readonly inputSchema: {
readonly type: "object";
readonly properties: {
readonly dryRun: {
type: "boolean";
description: string;
default: boolean;
};
readonly output: {
readonly type: "string";
readonly enum: readonly ["json", "yaml", "name", "go-template", "go-template-file", "template", "templatefile", "jsonpath", "jsonpath-as-json", "jsonpath-file"];
readonly description: "Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file";
readonly default: "yaml";
};
readonly validate: {
readonly type: "boolean";
readonly description: "If true, validate resource schema against server schema";
readonly default: true;
};
readonly manifest: {
readonly type: "string";
readonly description: "YAML manifest to create resources from";
};
readonly filename: {
readonly type: "string";
readonly description: "Path to a YAML file to create resources from";
};
readonly resourceType: {
readonly type: "string";
readonly description: "Type of resource to create (namespace, configmap, deployment, service, etc.)";
};
readonly name: {
readonly type: "string";
readonly description: "Name of the resource to create";
};
readonly namespace: {
type: "string";
description: string;
default: string;
};
readonly fromLiteral: {
readonly type: "array";
readonly items: {
readonly type: "string";
};
readonly description: "Key-value pair for creating configmap (e.g. [\"key1=value1\", \"key2=value2\"])";
};
readonly fromFile: {
readonly type: "array";
readonly items: {
readonly type: "string";
};
readonly description: "Path to file for creating configmap (e.g. [\"key1=/path/to/file1\", \"key2=/path/to/file2\"])";
};
readonly secretType: {
readonly type: "string";
readonly enum: readonly ["generic", "docker-registry", "tls"];
readonly description: "Type of secret to create (generic, docker-registry, tls)";
};
readonly serviceType: {
readonly type: "string";
readonly enum: readonly ["clusterip", "nodeport", "loadbalancer", "externalname"];
readonly description: "Type of service to create (clusterip, nodeport, loadbalancer, externalname)";
};
readonly tcpPort: {
readonly type: "array";
readonly items: {
readonly type: "string";
};
readonly description: "Port pairs for tcp service (e.g. [\"80:8080\", \"443:8443\"])";
};
readonly image: {
readonly type: "string";
readonly description: "Image to use for the containers in the deployment";
};
readonly replicas: {
readonly type: "number";
readonly description: "Number of replicas to create for the deployment";
readonly default: 1;
};
readonly port: {
readonly type: "number";
readonly description: "Port that the container exposes";
};
readonly schedule: {
readonly type: "string";
readonly description: "Cron schedule expression for the CronJob (e.g. \"*/5 * * * *\")";
};
readonly suspend: {
readonly type: "boolean";
readonly description: "Whether to suspend the CronJob";
readonly default: false;
};
readonly command: {
readonly type: "array";
readonly items: {
readonly type: "string";
};
readonly description: "Command to run in the container";
};
readonly labels: {
readonly type: "array";
readonly items: {
readonly type: "string";
};
readonly description: "Labels to apply to the resource (e.g. [\"key1=value1\", \"key2=value2\"])";
};
readonly annotations: {
readonly type: "array";
readonly items: {
readonly type: "string";
};
readonly description: "Annotations to apply to the resource (e.g. [\"key1=value1\", \"key2=value2\"])";
};
readonly context: {
type: "string";
description: string;
default: string;
};
};
readonly required: readonly [];
};
};
export declare function kubectlCreate(k8sManager: KubernetesManager, input: {
dryRun?: boolean;
output?: string;
validate?: boolean;
manifest?: string;
filename?: string;
resourceType?: string;
name?: string;
namespace?: string;
fromLiteral?: string[];
fromFile?: string[];
secretType?: "generic" | "docker-registry" | "tls";
serviceType?: "clusterip" | "nodeport" | "loadbalancer" | "externalname";
tcpPort?: string[];
image?: string;
replicas?: number;
port?: number;
command?: string[];
labels?: string[];
annotations?: string[];
schedule?: string;
suspend?: boolean;
context?: string;
}): Promise<{
content: {
type: string;
text: string;
}[];
}>;