View Source K8s.Client.Runner.Watch.Stream (k8s v1.1.1)

Watches a K8s.Client.list/3 operation and returns an Elixir Stream of events.

Link to this section Summary

Functions

Watches resources and returns an Elixir Stream of events emmitted by kubernetes.

Link to this section Types

Specs

t() :: %K8s.Client.Runner.Watch.Stream{
  conn: K8s.Conn.t(),
  http_opts: keyword(),
  operation: K8s.Operation.t(),
  remainder: binary(),
  resource_version: binary(),
  resp: HTTPoison.AsyncResponse.t()
}

Link to this section Functions

Link to this function

resource(conn, operation, http_opts)

View Source

Specs

resource(K8s.Conn.t(), K8s.Operation.t(), keyword()) ::
  Enumerable.t() | {:error, any()}

Watches resources and returns an Elixir Stream of events emmitted by kubernetes.

example

Example

iex> {:ok,conn} = K8s.Conn.from_file("~/.kube/config", [context: "docker-desktop"])
...> op = K8s.Client.list("v1", "Namespace")
...> K8s.Client.Runner.Watch.Stream.resource(conn, op, []) |> Stream.map(&IO.inspect/1) |> Stream.run()