View Source K8s.Client.Runner.Stream.Watch (k8s v2.0.0-rc.2)
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
@type t() :: %K8s.Client.Runner.Stream.Watch{ conn: K8s.Conn.t(), http_opts: keyword(), operation: K8s.Operation.t(), remainder: binary(), resource_version: binary() }
Link to this section Functions
@spec stream(K8s.Conn.t(), K8s.Operation.t(), keyword()) :: {:ok, Enumerable.t()} | K8s.Client.Provider.error_t()
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.stream(conn, op, []) |> Stream.map(&IO.inspect/1) |> Stream.run()