UNPKG

k8ts

Version:

Powerful framework for building Kubernetes manifests in TypeScript.

43 lines 2.22 kB
import { Kinded, Producer } from "@k8ts/instruments"; import { CDK } from "../../_imports"; import { api } from "../../kinds"; import { ManifestResource } from "../../node/manifest-resource"; import { Container } from "./container"; import { Device, Volume } from "./volume"; export type PodTemplate<Ports extends string = string> = PodTemplate.PodTemplate<Ports>; export declare namespace PodTemplate { export type PodProps = Omit<CDK.PodSpec, "containers" | "initContainers" | "volumes">; type AbsContainer<Ports extends string> = Kinded<api.v1_.Pod_.Container> & { __PORTS__: Ports; }; export type PodContainerProducer<Ports extends string> = Producer<PodScope, AbsContainer<Ports>>; export type Props<Ports extends string> = PodProps & { $POD: PodContainerProducer<Ports>; }; export type HostPortSpec<Ports extends string> = { [port in Ports]?: { ip?: string; port?: number; }; }; export class PodTemplate<Ports extends string = string> extends ManifestResource<Props<Ports>> { readonly kind: import("@k8ts/instruments").Kind.Kind<"PodTemplate", import("@k8ts/instruments").Kind.Version<"v1", import("@k8ts/instruments").Kind.Group<"">>>; readonly containers: import("doddle").Seq<Container<Ports>>; readonly mounts: import("doddle").Seq<{ mount: Container.Mount.ContainerVolumeMount | Container.Mount.ContainerDeviceMount; path: string; }>; readonly volumes: import("doddle").Seq<Device.PodDevice | Volume>; readonly ports: import("doddle").Doddle<import("@k8ts/instruments").PortSet<Ports>>; } export class PodScope { private readonly _parent; constructor(_parent: PodTemplate); Container<Ports extends string>(name: string, options: Container.Props<Ports>): Container.Container<Ports>; InitContainer(name: string, options: Container.K8tsProps<never>): Container.Container<never>; Volume(name: string, options: Volume.Backend): Volume.PodVolume<Volume.Backend>; Device(name: string, options: Device.Backend): Device.PodDevice; } export {}; } //# sourceMappingURL=pod-template.d.ts.map