Packages
k8s
2.0.3
2.8.0
2.7.0
2.6.2
2.6.1
2.6.0
2.5.0
2.4.2
2.4.1
2.4.0
2.3.0
2.2.0
2.1.1
2.1.0
2.0.3
2.0.2
2.0.1
2.0.0
2.0.0-rc.6
2.0.0-rc.5
2.0.0-rc.4
2.0.0-rc.3
2.0.0-rc.2
2.0.0-rc.1
2.0.0-rc.0
1.2.1
1.2.0
1.1.10
1.1.9
1.1.8
1.1.7
1.1.6
1.1.5
1.1.4
1.1.3
1.1.2
1.1.1
1.1.0
1.0.0
1.0.0-rc1
0.5.2
0.5.1
0.5.0
0.5.0-rc.2
0.5.0-rc.1
0.4.0
0.3.2
0.3.1
0.3.0
0.2.13
0.2.12
0.2.11
0.2.10
0.2.9
0.2.8
0.2.7
retired
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
0.1.3
Kubernetes API Client for Elixir
Current section
Files
Jump to
Current section
Files
lib/k8s.ex
defmodule K8s do
@moduledoc "Kubernetes API Client for Elixir"
@doc false
@spec http_provider() :: module()
@deprecated "Call K8s.default_http_provider/0 instead"
def http_provider, do: default_http_provider()
@doc "Returns the default HTTP Provider"
@spec default_http_provider() :: module()
def default_http_provider do
Application.get_env(:k8s, :http_provider, K8s.Client.MintHTTPProvider)
end
@doc """
Returns the _default_ driver for discovery.
Each `K8s.Conn` can have its own driver set. If unset, this value will be used.
Defaults to `K8s.Discovery.Driver.HTTP`
## Example mix config
In the example below `dev` and `test` clusters will use the File driver, while `prod` will use the HTTP driver.
Cluster names can be atoms or strings, but are internally stored as strings.
```elixir
use Mix.Config
config :k8s,
discovery_driver: K8s.Discovery.Driver.File,
discovery_opts: [config: "test/support/discovery/example.json"]
```
"""
@spec default_discovery_driver() :: module()
def default_discovery_driver do
Application.get_env(:k8s, :discovery_driver, K8s.Discovery.Driver.HTTP)
end
@doc """
Returns default opts for the discovery driver. This is also configurable per `K8s.Conn`
"""
@spec default_discovery_opts() :: Keyword.t()
def default_discovery_opts do
Application.get_env(:k8s, :discovery_opts, [])
end
@doc """
Returns the default CAStore
"""
@spec default_cacertfile() :: module()
def default_cacertfile do
Application.get_env(:k8s, :cacertfile, CAStore.file_path())
end
@doc false
@spec websocket_provider() :: module()
def websocket_provider do
Application.get_env(:k8s, :websocket_provider, K8s.Client.WebSocketProvider)
end
end