k8s v0.2.6 K8s.Discovery

Auto discovery of Kubenetes API Versions and Groups.

Link to this section Summary

Functions

Get a map of API type to groups

Asynchronously fetch resource definitions.

List all resource definitions by group

Link to this section Functions

Link to this function

api_paths(cluster_name, opts \\ [])
api_paths(binary(), keyword()) :: map() | {:error, binary() | atom()}

Get a map of API type to groups

Examples

iex> K8s.Discovery.api_paths(:test)
%{"/api" => ["v1"], "/apis" => ["apps/v1", "batch/v1"]}
Link to this function

async_get_resource_definition(prefix, version, conf, opts)
async_get_resource_definition(binary(), binary(), map(), keyword()) :: %Task{
  owner: term(),
  pid: term(),
  ref: term()
}

Asynchronously fetch resource definitions.

Task will contain a list of resource definitions.

In the event of failure an empty list is returned.

Link to this function

resource_definitions_by_group(cluster_name, opts \\ [])

List all resource definitions by group

Examples

iex> K8s.Discovery.resource_definitions_by_group(:test)
[%{"apiVersion" => "v1", "groupVersion" => "apps/v1", "kind" => "APIResourceList", "resources" => [%{"kind" => "DaemonSet", "name" => "daemonsets", "namespaced" => true, "verbs" => ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"]}, %{"kind" => "Deployment", "name" => "deployments", "namespaced" => true, "verbs" => ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"]}]}, %{"apiVersion" => "v1", "groupVersion" => "batch/v1", "kind" => "APIResourceList", "resources" => [%{"kind" => "Job", "name" => "jobs", "namespaced" => true, "verbs" => ["create", "delete", "deletecollection", "get", "list", "patch", "update", "watch"]}]}, %{"groupVersion" => "v1", "kind" => "APIResourceList", "resources" => [%{"kind" => "Namespace", "name" => "namespaces", "namespaced" => false, "verbs" => ["create", "delete", "get", "list", "patch", "update", "watch"]}]}]