import * as k8s from '@kubernetes/client-node'; /** * Label selector builder utility */ export declare class LabelSelector { private selectors; /** * Add an equality-based selector (key=value) */ equals(key: string, value: string): this; /** * Add an inequality-based selector (key!=value) */ notEquals(key: string, value: string): this; /** * Add a set-based selector (key in (value1,value2)) */ in(key: string, values: string[]): this; /** * Add a set-based selector (key notin (value1,value2)) */ notIn(key: string, values: string[]): this; /** * Add an existence-based selector (key exists) */ exists(key: string): this; /** * Add a non-existence-based selector (!key) */ notExists(key: string): this; /** * Build the label selector string */ build(): string; } /** * Field selector builder utility */ export declare class FieldSelector { private selectors; /** * Add a field selector */ field(path: string, value: string): this; /** * Add a field not equals selector */ fieldNotEquals(path: string, value: string): this; /** * Select by name */ name(name: string): this; /** * Select by namespace */ namespace(namespace: string): this; /** * Select by status phase (for pods) */ phase(phase: string): this; /** * Build the field selector string */ build(): string; } /** * Resource patch builder utility */ export declare class PatchBuilder { private patches; /** * Add a JSON patch operation */ add(path: string, value: any): this; /** * Remove a JSON patch operation */ remove(path: string): this; /** * Replace a JSON patch operation */ replace(path: string, value: any): this; /** * Copy a JSON patch operation */ copy(from: string, path: string): this; /** * Move a JSON patch operation */ move(from: string, path: string): this; /** * Test a JSON patch operation */ test(path: string, value: any): this; /** * Build the JSON patch array */ build(): any[]; } /** * Resource metadata utilities */ export declare class MetadataUtils { /** * Generate a unique name with a random suffix */ static generateName(prefix: string): string; /** * Add or update labels on a resource */ static addLabels(resource: T, labels: { [key: string]: string; }): T; /** * Add or update annotations on a resource */ static addAnnotations(resource: T, annotations: { [key: string]: string; }): T; /** * Add owner reference to a resource */ static addOwnerReference(resource: T, owner: k8s.KubernetesObject, controller?: boolean, blockOwnerDeletion?: boolean): T; /** * Check if a resource has a specific label */ static hasLabel(resource: k8s.KubernetesObject, key: string, value?: string): boolean; /** * Check if a resource has a specific annotation */ static hasAnnotation(resource: k8s.KubernetesObject, key: string, value?: string): boolean; /** * Get resource age in milliseconds */ static getAge(resource: k8s.KubernetesObject): number; /** * Format resource age as human-readable string */ static formatAge(resource: k8s.KubernetesObject): string; } /** * Container utilities */ export declare class ContainerUtils { /** * Create a basic container spec */ static createContainer(name: string, image: string, options?: { command?: string[]; args?: string[]; env?: k8s.V1EnvVar[]; ports?: k8s.V1ContainerPort[]; resources?: k8s.V1ResourceRequirements; volumeMounts?: k8s.V1VolumeMount[]; }): k8s.V1Container; /** * Add environment variable to container */ static addEnvVar(container: k8s.V1Container, name: string, value?: string, valueFrom?: k8s.V1EnvVarSource): k8s.V1Container; /** * Add port to container */ static addPort(container: k8s.V1Container, containerPort: number, options?: { name?: string; protocol?: string; hostPort?: number; }): k8s.V1Container; /** * Set container resources */ static setResources(container: k8s.V1Container, requests?: { cpu?: string; memory?: string; }, limits?: { cpu?: string; memory?: string; }): k8s.V1Container; } /** * Pod template utilities */ export declare class PodTemplateUtils { /** * Create a basic pod template spec */ static createPodTemplateSpec(containers: k8s.V1Container[], options?: { labels?: { [key: string]: string; }; annotations?: { [key: string]: string; }; restartPolicy?: string; serviceAccountName?: string; volumes?: k8s.V1Volume[]; nodeSelector?: { [key: string]: string; }; tolerations?: k8s.V1Toleration[]; affinity?: k8s.V1Affinity; }): k8s.V1PodTemplateSpec; /** * Add init container to pod template */ static addInitContainer(podTemplate: k8s.V1PodTemplateSpec, initContainer: k8s.V1Container): k8s.V1PodTemplateSpec; /** * Add volume to pod template */ static addVolume(podTemplate: k8s.V1PodTemplateSpec, volume: k8s.V1Volume): k8s.V1PodTemplateSpec; } /** * Service utilities */ export declare class ServiceUtils { /** * Create a service spec for a deployment or pods */ static createServiceSpec(selector: { [key: string]: string; }, ports: Array<{ port: number; targetPort: number | string; protocol?: string; name?: string; }>, type?: 'ClusterIP' | 'NodePort' | 'LoadBalancer' | 'ExternalName'): k8s.V1ServiceSpec; } /** * Deployment utilities */ export declare class DeploymentUtils { /** * Create a deployment spec */ static createDeploymentSpec(replicas: number, selector: { [key: string]: string; }, template: k8s.V1PodTemplateSpec, strategy?: k8s.V1DeploymentStrategy): k8s.V1DeploymentSpec; } //# sourceMappingURL=ResourceUtils.d.ts.map