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
add(cluster, conf)
add(atom(), K8s.Conf.t()) :: {:ok, atom()} | {:error, atom()}
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}
add!(cluster, conf)
add!(atom(), K8s.Conf.t()) :: any() | no_return()
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
auto_register_clusters!()
auto_register_clusters!() :: no_return()
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"]
}
}
child_spec(init_arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
schedule(milliseconds)
schedule(pos_integer()) :: reference()
schedule(pos_integer()) :: reference()
Schedules a re-registration of all clusters.
start_link(opts)
start_link(Keyword.t()) :: GenServer.on_start()
start_link(Keyword.t()) :: GenServer.on_start()