View Source kuberlnetes (kuberlnetes v0.1.0)

kuberlnetes A low level kubernetes api helper - primarlily for applications that interact with the kubernetes api from inside the cluster.

Link to this section Summary

Functions

Deletes the given resource
Loads the current-context from ~/.kube/config
Initiates a GET request against the configured kubernetes api server or raises an error if the server is not configured correctly.
Configures a server using the service account
Returns the current datetime in the kubernetes MicroTime format see: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#microtime-v1-meta
Initiates a PATCH request against the configured kubernetes api server or raises an error if the server is not configured correctly. see: server()
Initiates a POST request against the configured kubernetes api server or raises an error if the server is not configured correctly. see: server()
Closes an active watch process when not running in a supervision tree.
Returns all currently active watch processes

Link to this section Types

-type http_status_err() :: 300..600.
-type kube_cfg_options() :: #{path => string(), context => string(), cache => boolean()}.
-type maybe(T) :: T | undefined.
-type mutation_request() :: #{path => string(), body => map() | binary()}.
-type options() :: #{server => server() | undefined}.
-type resp_with_body() :: {ok, map()} | {error, http_status_err()}.
-type server() :: #server{}.

Link to this section Functions

-spec delete(Path, Opts) -> {ok, Body} when Path :: string(), Opts :: options(), Body :: map().
Deletes the given resource
-spec from_config(Options) -> server() when Options :: kube_cfg_options().
Loads the current-context from ~/.kube/config
-spec from_raw(string()) -> server().
-spec get(Path) -> {ok, Body} when Path :: string(), Body :: map().
-spec get(Path, Opts) -> {ok, Body} when Path :: string(), Opts :: options(), Body :: map().
Initiates a GET request against the configured kubernetes api server or raises an error if the server is not configured correctly.
Link to this function

headers(Server, AdditionalHeaders)

View Source
-spec in_cluster() -> server().
Configures a server using the service account
-spec microtime_now() -> binary().
Returns the current datetime in the kubernetes MicroTime format see: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#microtime-v1-meta
-spec patch(Request, Opts) -> {ok, Body}
         when Request :: mutation_request(), Opts :: options(), Body :: map().
Initiates a PATCH request against the configured kubernetes api server or raises an error if the server is not configured correctly. see: server()
-spec post(Request, Opts) -> {ok, Body}
        when Request :: mutation_request(), Opts :: options(), Body :: map().
Initiates a POST request against the configured kubernetes api server or raises an error if the server is not configured correctly. see: server()
-spec watch(Opts) -> Result when Opts :: kuberlnetes_watch:watch_opts(), Result :: {ok, pid()}.
-spec watch_close(Pid) -> Result when Pid :: pid(), Result :: ok.
Closes an active watch process when not running in a supervision tree.
-spec watches() -> Result when Result :: [pid()].
Returns all currently active watch processes