k8s v0.3.1 K8s.Cluster.Registry

Register resource definitions for K8s.Cluster

Link to this section Summary

Functions

Add or update a cluster to use with K8s.Client

Add or update a new cluster to use with K8s.Client

Registers clusters automatically from all configuration sources.

Returns a specification to start this module under a supervisor.

Schedules a re-registration of all clusters.

Link to this section Functions

Link to this function

add(cluster, conf)
add(atom(), K8s.Conf.t()) :: {:ok, atom()} | {:error, atom()}

Add or update a cluster to use with K8s.Client

Examples

iex> conf = K8s.Conf.from_file("./test/support/kube-config.yaml")
...> K8s.Cluster.Registry.add(:test_cluster, conf)
{:ok, :test_cluster}
Link to this function

add!(cluster, conf)
add!(atom(), K8s.Conf.t()) :: any() | no_return()

Add or update a new cluster to use with K8s.Client

Examples

iex> conf = K8s.Conf.from_file("./test/support/kube-config.yaml")
...> K8s.Cluster.Registry.add!(:test_cluster, conf)
:test_cluster
Link to this function

auto_register_clusters!()
auto_register_clusters!() :: no_return()

Registers clusters automatically from all configuration sources.

See the usage guide for more details on configuring connection details.

Examples

By default a cluster will attempt to use the ServiceAccount assigned to the pod:

config :k8s,
  clusters: %{
    default: %{}
  }

Configuring a cluster using a k8s config:

config :k8s,
  clusters: %{
    default: %{
      conf: "~/.kube/config"
      conf_opts: [user: "some-user", cluster: "prod-cluster"]
    }
  }
Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

schedule(milliseconds)
schedule(pos_integer()) :: reference()

Schedules a re-registration of all clusters.

Link to this function

start_link(opts)
start_link(Keyword.t()) :: GenServer.on_start()