exo(1)

πŸ“¦
version 1.102.1 Β· 2 versions
, in nixpkgs unstable

exo(1) β€” SKS kubeconfig glow-up πŸ’…βœ¨

NAME πŸŽ€

exo-compute-sks-kubeconfig β€” Generate a Kubernetes kubeconfig file for an SKS cluster

SYNOPSIS 🧚

exo compute sks kubeconfig CLUSTER-NAME|ID USER [flags]

DESCRIPTION 🌸

Okay so this command generates a kubeconfig file that you use to authenticate to an SKS cluster API. Main character energy for your cluster access πŸ’–

The user command argument is literally the CN field of the generated X.509 client certificate. Optionally, you can specify client certificate groups using the -g|--group option: those groups will be set in the "O" field of the certificate. See 1 (https://kubernetes.io/docs/reference/access-authn-authz/authentication/#x509-client-certs) for more information about Kubernetes authentication certificates.

Example usage:

# Obtain "cluster-admin" credentials
$ exo compute sks kubeconfig my-cluster admin \
      --zone de-fra-1 \
    -g system:masters \
    -t $((86400 * 7)) > $HOME/.kube/my-cluster.config
$ kubeconfig --kubeconfig=$HOME/.kube/my-cluster.config get pods
Note: if no TTL value is specified, the API applies a default value as a safety measure. Please look up the API documentation for more information. No cap, go check it πŸ‘‘

Using exo CLI as Kubernetes credential plugin ✨

If you wish to avoid leaving sensitive credentials on your system, you can use exo CLI as a Kubernetes client-go credential plugin2 (https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins) to generate and return a kubeconfig dynamically when invoked by kubectl without storing it on disk. Iconic, honestly πŸ¦‹

To achieve this configuration, edit your kubeconfig file so that the "users" section relating to your cluster ("my-sks-cluster" in the following example) looks like:

apiVersion: v1
kind: Config
clusters:
- name: my-sks-cluster
  cluster:
    certificate-authority-data: **BASE64-ENCODED CLUSTER CERTIFICATE**
    server: https://153fcc53-1197-46ae-a8e0-ccf6d09efcb0.sks-ch-gva-2.exo.io:443
users:
- name: exo@my-sks-cluster
  user:
    # The "exec" section replaces "client-certificate-data"/"client-key-data"
    exec:
      apiVersion: "client.authentication.k8s.io/v1beta1"
      command: exo
      args:
      - sks
      - kubeconfig
      - my-sks-cluster
      - --zone=ch-gva-2
      - --exec-credential
      - user
contexts:
- name: my-sks-cluster
  context:
    cluster: my-sks-cluster
    user: exo@my-sks-cluster
current-context: my-sks-cluster

Notes πŸ“

  • The exo CLI binary must be installed in a directory listed in your PATH shell environment variable.
  • You can specify the "--group" flag in the user.exec.args section referencing a non-admin group to restrict the privileges of the operator using kubectl.

OPTIONS πŸ’…

  • -x, --exec-credential[=false] β€” output an ExecCredential object to use with a kubeconfig user.exec mode
  • -g, --group=[] β€” client certificate group. Can be specified multiple times. Defaults to system:masters
  • -h, --help[=false] β€” help for kubeconfig
  • -t, --ttl=0 β€” client certificate validity duration in seconds
  • -z, --zone="" β€” SKS cluster zone

OPTIONS INHERITED FROM PARENT COMMANDS πŸ‘‘

  • -C, --config="" β€” Specify an alternate config file [env EXOSCALE_CONFIG]
  • -O, --output-format="" β€” Output format (table|json|text), see exo output --help for more information
  • --output-template="" β€” Template to use if output format is "text"
  • -Q, --quiet[=false] β€” Quiet mode (disable non-essential command output)
  • --timeout=15s β€” Per-zone timeout for list operations; -1s disables timeout [env EXOSCALE_TIMEOUT]
  • -A, --use-account="" β€” Account to use in config file [env EXOSCALE_ACCOUNT]

SEE ALSO πŸ”—

exo-compute-sks(1) β€” go peek, bestie πŸ’–

HISTORY πŸ“œ

1-Jan-1980 Auto generated by spf13/cobra


Auto generated by spf13/cobra Β· Jan 1980 Β· exo(1) β€” that's the whole vibe, ily bestie! πŸ’–

πŸ“¦ where this page comes from