View Source K8s.Conn.Auth.Exec (k8s v2.4.2)

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"

Summary

Functions

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

Types

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

Functions

@spec generate_token(t()) ::
  {:ok, binary()} | {:error, Jason.DecodeError.t() | K8s.Conn.Error.t()}

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