View Source K8s.Client.Runner.Stream.Watch (k8s v2.5.0)

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

Summary

Functions

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

Types

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

Functions

Link to this function

stream(conn, operation, http_opts)

View Source

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

Example

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