k8s v0.5.2 K8s.Client.Runner.Watch

K8s.Client runner that will watch a resource or resources and stream results back to a process.

Link to this section Summary

Functions

Watch a resource or list of resources. Provide the stream_to option or results will be stream to self().

Watch a resource or list of resources from a specific resource version. Provide the stream_to option or results will be stream to self().

Link to this section Functions

Watch a resource or list of resources. Provide the stream_to option or results will be stream to self().

Note: Current resource version will be looked up automatically.

Examples

{:ok, conn} = K8s.Conn.lookup(:test)
operation = K8s.Client.list("v1", "Namespace")
{:ok, reference} = Watch.run(operation, conn, stream_to: self())
{:ok, conn} = K8s.Conn.lookup(:test)
operation = K8s.Client.get("v1", "Namespace", [name: "test"])
{:ok, reference} = Watch.run(operation, conn, stream_to: self())

Watch a resource or list of resources from a specific resource version. Provide the stream_to option or results will be stream to self().

Examples

{:ok, conn} = K8s.Conn.lookup(:test)
operation = K8s.Client.list("v1", "Namespace")
resource_version = 3003
{:ok, reference} = Watch.run(operation, conn, resource_version, stream_to: self())
{:ok, conn} = K8s.Conn.lookup(:test)
operation = K8s.Client.get("v1", "Namespace", [name: "test"])
resource_version = 3003
{:ok, reference} = Watch.run(operation, conn, resource_version, stream_to: self())