k8s v0.3.1 K8s.Client.Runner.Wait
Waiting functionality for K8s.Client
.
Note: This is built using repeated GET operations rather than using a watch operation w/ fieldSelector
.
Link to this section Summary
Functions
Continually perform a GET based operation until a condition is met.
Link to this section Types
Link to this type
t()
t()
t() :: %K8s.Client.Runner.Wait{
eval: any() | (any() -> any()),
find: [binary()] | (any() -> any()),
processor: (map(), map() -> {:ok, map()} | {:error, binary()}),
sleep: pos_integer(),
timeout: pos_integer(),
timeout_after: NaiveDateTime.t()
}
t() :: %K8s.Client.Runner.Wait{ eval: any() | (any() -> any()), find: [binary()] | (any() -> any()), processor: (map(), map() -> {:ok, map()} | {:error, binary()}), sleep: pos_integer(), timeout: pos_integer(), timeout_after: NaiveDateTime.t() }
A wait configuration
Link to this section Functions
Link to this function
run(op, cluster_name, opts)
Continually perform a GET based operation until a condition is met.
Example
Checking the number of job completions:
op = K8s.Client.get("batch/v1", :job, namespace: "default", name: "sleep")
opts = [find: ["status", "succeeded"], eval: 1, timeout: 60]
resp = K8s.Client.Runner.Wait.run(op, cluster_name, opts)