View Source K8s.Conn (k8s v1.1.1)

Handles authentication and connection configuration details for a Kubernetes cluster.

Link to this section Summary

Types

t()
  • cluster_name - The cluster name if read from a kubeconfig file
  • user_name - The user name if read from a kubeconfig file
  • url - The Kubernetes API URL

Functions

Reads configuration details from a kubernetes config file.

Generates configuration from kubernetes service account.

Link to this section Types

Specs

t() :: %K8s.Conn{
  auth: auth_t(),
  ca_cert: String.t() | nil,
  cluster_name: String.t() | nil,
  discovery_driver: module(),
  discovery_opts: Keyword.t(),
  http_provider: module(),
  insecure_skip_tls_verify: boolean(),
  middleware: K8s.Middleware.Stack.t(),
  url: String.t(),
  user_name: String.t() | nil
}
  • cluster_name - The cluster name if read from a kubeconfig file
  • user_name - The user name if read from a kubeconfig file
  • url - The Kubernetes API URL

Link to this section Functions

Link to this function

from_file(config_file, opts \\ [])

View Source

Specs

from_file(
  binary(),
  keyword()
) :: {:ok, t()} | {:error, :enoent | K8s.Conn.Error.t()}

Reads configuration details from a kubernetes config file.

Defaults to current-context.

options

Options

  • context sets an alternate context
  • cluster set or override the cluster read from the context
  • user set or override the user read from the context
  • discovery_driver module name to use for discovery
  • discovery_opts options for discovery module

Specs

from_service_account() :: {:ok, t()} | {:error, :enoent | K8s.Conn.Error.t()}

Generates configuration from kubernetes service account.

kubernetes.io :: Accessing the API from a Pod

Link to this function

from_service_account(service_account_path)

View Source

Specs

from_service_account(String.t()) ::
  {:ok, t()} | {:error, :enoent | K8s.Conn.Error.t()}