k8s v0.3.2 K8s.Cluster.Group

Kubernetes API Groups

Link to this section Summary

Functions

Finds a resource definition by api version and (name or kind).

Insert/Update a cluster's group/resource definitions.

Get the REST resource name for a kubernetes Kind.

Returns a list of all resources in a given groupVersion

Link to this section Functions

Link to this function

find_resource(cluster, api_version, name_or_kind)
find_resource(atom(), binary(), atom() | binary()) ::
  {:ok, map()}
  | {:error, :cluster_not_registered, atom()}
  | {:error, :unsupported_resource, binary()}
  | {:error, :unsupported_api_version, binary()}

Finds a resource definition by api version and (name or kind).

Link to this function

insert_all(cluster, resources_by_group)
insert_all(atom(), map()) :: boolean()

Insert/Update a cluster's group/resource definitions.

Link to this function

resource_name_for_kind(cluster, api_version, name_or_kind)
resource_name_for_kind(atom(), binary(), binary()) ::
  {:ok, binary()}
  | {:error, :cluster_not_registered, atom()}
  | {:error, :unsupported_resource, binary()}
  | {:error, :unsupported_api_version, binary()}

Get the REST resource name for a kubernetes Kind.

Since K8s.Operation is abstracted away from a specific cluster, when working with kubernetes resource Maps and specifying "kind" the K8s.Operation.Path module isn't able to determine the correct path. (It will generate things like /api/v1/Pod instead of api/v1/pods).

Also accepts REST resource name in the event they are provided, as it may be known in the event of subresources.

Link to this function

resources_by_group(cluster, api_version)
resources_by_group(atom(), binary()) ::
  {:ok, [map()]}
  | {:error, :cluster_not_registered, atom()}
  | {:error, :unsupported_api_version, binary()}

Returns a list of all resources in a given groupVersion