/** * The four Kubernetes API calls the budget run makes from inside the * cluster, with the pod's service account: list running pods (nodes per * container), list nodes (Receivers for the `*` row), and get and replace the * policy ConfigMap. Node's https module and the mounted service-account * token and CA, so the image needs no kubectl. * * RBAC the CronJob manifest grants (scheduler-manifest-emitter.ts): * `list` on pods cluster-wide, `get` and `update` on the one ConfigMap by * name. */ export interface PodPlacement { nodeName?: string; containers?: string[]; /** Values of `K8S_CONFIGMAP` in the pod's container env: a Receiver names its policy ConfigMap there. */ policyConfigMaps?: string[]; } export interface ConfigMapState { data: Record; resourceVersion: string; } export interface K8sApi { /** Running pods, cluster-wide or in one namespace. */ listRunningPods(namespace?: string): Promise; getConfigMap(namespace: string, name: string): Promise; /** Replace the ConfigMap's data, failing on a concurrent write (resourceVersion). */ replaceConfigMap(namespace: string, name: string, data: Record, resourceVersion: string): Promise; } /** The namespace this pod runs in, from the mounted service account. */ export declare function podNamespace(): string | undefined; /** An API client for the cluster this process runs in, or undefined outside a cluster. */ export declare function inClusterK8sApi(env?: NodeJS.ProcessEnv): K8sApi | undefined;