K8s.Client.Runner.Watch (k8s v1.0.0-rc1) View Source

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

Link to this function

run(conn, operation, http_opts)

View Source

Specs

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.from_file("test/support/kube-config.yaml")
operation = K8s.Client.list("v1", "Namespace")
{:ok, reference} = Watch.run(conn, operation, stream_to: self())
{:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
operation = K8s.Client.get("v1", "Namespace", [name: "test"])
{:ok, reference} = Watch.run(conn, operation, stream_to: self())
Link to this function

run(conn, operation, rv, http_opts)

View Source

Specs

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.from_file("test/support/kube-config.yaml")
operation = K8s.Client.list("v1", "Namespace")
resource_version = 3003
{:ok, reference} = Watch.run(conn, operation, resource_version, stream_to: self())
{:ok, conn} = K8s.Conn.from_file("test/support/kube-config.yaml")
operation = K8s.Client.get("v1", "Namespace", [name: "test"])
resource_version = 3003
{:ok, reference} = Watch.run(conn, operation, resource_version, stream_to: self())