bonny v0.4.1 Bonny.Server.Scheduler.Binding

Kubernetes binding interface.

Currently undocumented in Kubernetes docs.

Link to this section Summary

Functions

Performs a POST HTTP request against the pod's binding subresource.

Returns a map representing a Binding kubernetes resource

Link to this section Functions

Link to this function

create(binding, cluster)
create(map(), atom()) ::
  {:ok, HTTPoison.Response.t()} | {:error, HTTPoison.Error.t()}

Performs a POST HTTP request against the pod's binding subresource.

/api/v1/namespaces/{NAMESPACE}/pods/{POD}/binding

Link to this function

new(pod, node)
new(map(), map()) :: map()

Returns a map representing a Binding kubernetes resource

Example

iex> pod = %{"metadata" => %{"name" => "nginx", "namespace" => "default"}}
...> node = %{"metadata" => %{"name" => "kewl-node"}}
iex> Bonny.Server.Scheduler.Binding.new(pod, node)
%{"apiVersion" => "v1", "kind" => "Binding", "metadata" => %{"name" => "nginx", "namespace" => "default"}, "target" => %{"apiVersion" => "v1", "kind" => "Node", "name" => "kewl-node"}}