Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "pack/k8s/scheduler/KubernetesGoalScheduler"

Index

Functions

cleanupJobs

  • cleanupJobs(configuration: Configuration): Promise<void>
  • Delete Kubernetes jobs created by this SDM that have either

    • exceeded their time-to-live, as returned by k8sJobTtl
    • have pod whose first container has exited, indicating the goal has timed out or some other error has occured

    Parameters

    • configuration: Configuration

    Returns Promise<void>

createJobSpec

  • createJobSpec(podSpec: V1PodSpec, podNs: string, gi: GoalInvocation): V1Job

createJobSpecWithAffinity

  • createJobSpecWithAffinity(podSpec: V1PodSpec, gi: GoalInvocation): V1Job

deleteJob

  • deleteJob(job: { name: string; namespace: string }): Promise<void>

deletePods

  • deletePods(job: { name: string; namespace: string }): Promise<void>

isConfiguredInEnv

  • isConfiguredInEnv(...values: string[]): boolean

k8sJobEnv

  • k8sJobEnv(podSpec: V1PodSpec, goalEvent: SdmGoalEvent, context: HandlerContext): V1EnvVar[]

k8sJobGoalName

k8sJobName

  • k8sJobName(podSpec: V1PodSpec, goalEvent: SdmGoalEvent): string

k8sJobTtl

  • k8sJobTtl(cfg?: Configuration): number

killJobFilter

  • killJobFilter(pods: V1Pod[], ttl: number): (j: V1Job) => boolean
  • Return true for jobs that have exceeded the TTL or whose child is in the provided list of pods. Return false otherwise.

    Parameters

    • pods: V1Pod[]
    • ttl: number

    Returns (j: V1Job) => boolean

      • (j: V1Job): boolean
      • Parameters

        • j: V1Job

        Returns boolean

listJobs

  • listJobs(labelSelector?: string): Promise<V1Job[]>
  • List Kubernetes jobs matching the provided label selector. Jobs are listed across all namespaces if configuration.sdm.k8s.job.singleNamespace is not set to false. If that configuration value is not set or set to true, jobs are listed from the namespace provide by readNamespace.

    Parameters

    • Optional labelSelector: string

    Returns Promise<V1Job[]>

    array of Kubernetes jobs matching the label selector

listPods

  • listPods(labelSelector?: string): Promise<V1Pod[]>

readNamespace

  • Read the namespace from the following sources in order. It returns the first truthy value found.

    1. ATOMIST_POD_NAMESPACE environment variable
    2. ATOMIST_DEPLOYMENT_NAMESPACE environment variable
    3. Contents of K8sNamespaceFile
    4. "default"

    service account files. Falls back to the default namespace if no other configuration can be found.

    Returns Promise<string>

rewriteCachePath

  • rewriteCachePath(jobSpec: V1Job, workspaceId: string): void

sanitizeName

  • sanitizeName(name: string): string

zombiePodFilter

  • zombiePodFilter(pod: V1Pod): boolean

Generated using TypeDoc