Trebejo.Kubernetes (Trebejo v1.0.0)

Copy Markdown View Source

Thin wrapper over kubectl for common operations.

All kubectl invocations are routed through Arrea.Command.execute/2 with validate: false. Arguments are shell-quoted before being joined into the final command line.

For richer Kubernetes integration (CRUD, watchers, label selectors) consider using :k8s or the official client libraries.

Summary

Functions

Applies a Kubernetes manifest YAML.

Checks if kubectl is available and the cluster responds.

Deletes a Kubernetes resource by name and kind.

Lists the pods in a namespace.

Functions

apply(manifest_path, opts \\ [])

@spec apply(
  String.t(),
  keyword()
) :: :ok | {:error, term()}

Applies a Kubernetes manifest YAML.

available?()

@spec available?() :: boolean()

Checks if kubectl is available and the cluster responds.

delete(kind, name, namespace, opts \\ [])

@spec delete(String.t(), String.t(), String.t(), keyword()) :: :ok | {:error, term()}

Deletes a Kubernetes resource by name and kind.

pods(namespace, opts \\ [])

@spec pods(
  String.t(),
  keyword()
) :: {:ok, String.t()} | {:error, term()}

Lists the pods in a namespace.

Returns {:ok, output} or {:error, reason}.