UNPKG

k8ts

Version:

Powerful framework for building Kubernetes manifests in TypeScript.

52 lines 2.94 kB
import { Resource_Child, Resource_Ref_Min, type Ref2_Of, type Resource_Ref_Keys_Of } from "@k8ts/instruments"; import { Meta } from "@k8ts/metadata"; import { CDK } from "@k8ts/sample-interfaces"; import type { Env_Value } from "../../env/types"; import { v1 } from "../../kinds/default"; import { Container, type Container_Props } from "./container"; import { Pod_Device, type Pod_Device_Backend } from "./volume/devices"; import { Pod_Volume, type Pod_Volume_Backend, type Pod_Volume_Backend_ConfigMap, type Pod_Volume_Backend_Pvc, type Pod_Volume_Backend_Secret } from "./volume/volumes"; export type Pod_Props_Original = Omit<CDK.PodSpec, "containers" | "initContainers" | "volumes">; type Container_Ref<Ports extends string> = Resource_Ref_Min<v1.Pod.Container._> & { __PORTS__: Ports; }; export type Pod_Container_Producer<Ports extends string> = (scope: PodScope) => Iterable<Container_Ref<Ports>>; export interface Pod_Props<Ports extends string> extends Pod_Props_Original { meta?: Meta.Input; $POD: Pod_Container_Producer<Ports>; } export declare class Pod_Template<Ports extends string = string> extends Resource_Child<Pod_Props<Ports>> { get kind(): import("@k8ts/instruments").Kind.Kind<"", "v1", "PodTemplate">; readonly containers: import("doddle").Seq<Container<Ports>>; readonly mounts: import("doddle").Seq<{ mount: import("./container/mounts").Container_Mount; path: string; }>; readonly volumes: import("doddle").Seq<Pod_Device | Pod_Volume<Pod_Volume_Backend>>; readonly ports: import("doddle").Doddle<import("@k8ts/instruments").PortSet<Ports>>; protected __kids__(): (Pod_Device | Pod_Volume<Pod_Volume_Backend> | Container<Ports>)[]; protected __metadata__(): { name: string; labels: Record<string, any>; annotations: Record<string, any>; }; readonly meta: Meta.Meta; protected __submanifest__(): CDK.PodTemplateSpec; } export declare class PodScope { private readonly _parent; constructor(_parent: Pod_Template); Container<Ports extends string, Env extends { [key in keyof Env]: { $backend: Ref2_Of; key: Env[key] extends object ? Resource_Ref_Keys_Of<Env[key]["$backend"], string> : never; } | Env_Value; }>(name: string, options: Container_Props<Ports, Env>): Container<Ports>; InitContainer(name: string, options: Container_Props<never>): Container<never>; Volume<const P extends Pod_Volume_Backend_ConfigMap<Ref2_Of<v1.ConfigMap._>>>(name: string, options: P): Pod_Volume<P>; Volume<const P extends Pod_Volume_Backend_Secret<Ref2_Of<v1.Secret._>>>(name: string, options: P): Pod_Volume<P>; Volume<const P extends Pod_Volume_Backend_Pvc<Ref2_Of<v1.PersistentVolumeClaim._>>>(name: string, options: P): Pod_Volume<P>; Device(name: string, options: Pod_Device_Backend): Pod_Device; } export {}; //# sourceMappingURL=pod-template.d.ts.map