k8s v0.5.2 K8s.Conn.Auth.Exec

Cluster authentication for kube configs using an exec section.

Useful for Kubernetes clusters running on AWS which use IAM authentication (eg. the aws-iam-authenticator binary). An applicable kube config may look something like this:

# ...
users:
- name: staging-user
  user:
    exec:
      # API version to use when decoding the ExecCredentials resource. Required.
      apiVersion: client.authentication.k8s.io/v1alpha1

      # Command to execute. Required.
      command: aws-iam-authenticator

      # Arguments to pass when executing the plugin. Optional.
      args:
      - token
      - -i
      - staging

      # Environment variables to set when executing the plugin. Optional.
      env:
      - name: "FOO"
        value: "bar"

Link to this section Summary

Functions

"Generate" a token using the exec config in kube config.

Link to this section Types

Link to this type

t()

t() :: %K8s.Conn.Auth.Exec{
  args: [String.t()],
  command: String.t(),
  env: %{name: String.t(), value: String.t()}
}

Link to this section Functions

Link to this function

generate_token(config)

generate_token(t()) ::
  {:ok, binary()} | {:error, binary() | atom(), {:exec_fail, binary()}}

"Generate" a token using the exec config in kube config.