#kubernetes #kubeconfig #openshift #refresh-token

app kman

A Kubeconfig MANager that allows you to easily refresh oauth tokens

2 unstable releases

0.2.0 Nov 20, 2024
0.1.0 Nov 19, 2024

#310 in Command line utilities

Download history 232/week @ 2024-11-15 59/week @ 2024-11-22 3/week @ 2024-11-29 13/week @ 2024-12-06

307 downloads per month

MIT license

20KB
291 lines

kman

A very specific Kubeconfig MANager...

What is it

It's simple; kman helps you in updating (expired) Kubernetes oauth tokens in your kubeconfig. This way you retain a minimal amount of contexts that you can properly name & identify.

A bit more information on the problem it solves can be found in this issue.

How do I install it

Cargo

  1. Make sure you have Rust & Cargo installed: https://www.rust-lang.org/tools/install
  2. Run cargo install kman
  3. You can have "automatic" updates by periodically running cargo update

Direct binary installation

[!WARNING] The binary does not have self-updating capabilities (yet), so you'll have to manually update with new releases

  1. Download a binary from the releases section.
  2. Add the binary to your $PATH

How do I use it

A Kubeconfig MANager that allows you to easily refresh oauth tokens

Usage: kman [OPTIONS] [COMMAND]

Commands:
  list     Lists all contexts
  select   Select context to use
  refresh  Refresh context token
  help     Print this message or the help of the given subcommand(s)

Options:
  -v, --verbose...  Increase logging verbosity
  -q, --quiet...    Decrease logging verbosity
  -h, --help        Print help
  -V, --version     Print version

You can specify a Kubeconfig file other than the default ($HOME/.kube/config) using the KUBECONFIG environment variable

Releases

  1. Update version number in Cargo.toml
  2. Add a new tag & create a Github release
  3. Update the change log with git-cliff using git cliff -o CHANGELOG.md
  4. Run cargo publish

TODO's

  • CI & releases
  • Proper error handling
  • Logging
  • Tests
  • Find easier way to refresh token (less manual actions)
  • Incorporate in brew

Dependencies

~11–20MB
~291K SLoC