k8s v0.4.0 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
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, conn)
add(cluster, conn)
add(atom(), K8s.Conn.t()) :: {:ok, atom()} | {:error, atom()}
add(atom(), K8s.Conn.t()) :: {:ok, atom()} | {:error, atom()}
Add or update a cluster to use with K8s.Client
Examples
iex> conn = K8s.Conn.from_file("./test/support/kube-config.yaml")
...> K8s.Cluster.Registry.add(:test_cluster, conn)
{:ok, :test_cluster}
Link to this function
auto_register_clusters()
auto_register_clusters()
auto_register_clusters() :: nil
auto_register_clusters() :: nil
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: %{
conn: "~/.kube/config"
conn_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(milliseconds)
schedule(pos_integer()) :: reference()
schedule(pos_integer()) :: reference()
Schedules a re-registration of all clusters.
Link to this function
start_link(opts)
start_link(opts)
start_link(Keyword.t()) :: GenServer.on_start()
start_link(Keyword.t()) :: GenServer.on_start()