interface Pods {
    create(
        podRef: PodRef,
        labels: Record<string, string>,
        containerName: ContainerName,
        containerImage: string,
        containerCommand: string[],
        startupProbeCommand: string[],
    ): Promise<Pod>;
    list(namespace: NamespaceName, labels: string[]): Promise<V1Pod[]>;
    listForAllNamespaces(labels: string[]): Promise<Pod[]>;
    read(podRef: PodRef): Promise<V1Pod>;
    readByRef(podRef: PodRef): Pod;
    waitForReadyStatus(
        namespace: NamespaceName,
        labels?: string[],
        maxAttempts?: number,
        delay?: number,
    ): Promise<V1Pod[]>;
    waitForRunningPhase(
        namespace: NamespaceName,
        labels: string[],
        maxAttempts: number,
        delay: number,
        podItemPredicate?: (items: V1Pod) => boolean,
    ): Promise<V1Pod[]>;
}

Implemented by

Methods

  • Create a pod

    Parameters

    • podRef: PodRef

      the reference to the pod

    • labels: Record<string, string>

      list of label records where the key is the label name and the value is the label value

    • containerName: ContainerName

      the name of the container

    • containerImage: string

      the image of the container

    • containerCommand: string[]

      the command to run in the container

    • startupProbeCommand: string[]

      the command to run in the startup probe

    Returns Promise<Pod>

    the pod that was created

  • List all the pods across all namespaces with the given labels

    Parameters

    • labels: string[]

      list of labels

    Returns Promise<Pod[]>

    list of pods

  • Check if pod's ready status is true

    Parameters

    • namespace: NamespaceName

      namespace

    • Optionallabels: string[]

      pod labels

    • OptionalmaxAttempts: number

      maximum attempts to check

    • Optionaldelay: number

      delay between checks in milliseconds

    Returns Promise<V1Pod[]>

  • Check if pod's phase is running

    Parameters

    • namespace: NamespaceName

      namespace

    • labels: string[]

      pod labels

    • maxAttempts: number

      maximum attempts to check

    • delay: number

      delay between checks in milliseconds

    • OptionalpodItemPredicate: (items: V1Pod) => boolean

      pod item predicate

    Returns Promise<V1Pod[]>