Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Releases: clusterise/kubectl-repl

1.7 – Quality of Life improvements

19 Mar 14:44
a55cff9
Compare
Choose a tag to compare

Changes since last stable release (1.6):

  • Empty lines and lines beginning with a comment (#) are no longer send to the underlying kubectl (#12, #13)

Many thanks to @walfie for the changes! 🥇

Complete changelog since the previous release: 1.6...1.7

This release is also available as a Docker image:
https://hub.docker.com/r/mikulas/kubectl-repl/

1.6 – Compatibility with kubectl plugins

09 Jan 08:24
Compare
Choose a tag to compare

Changes since last stable release (1.4):

  • Improved placement of context and namespace options in the final bash command
    • Formerly, kubectl-repl used to insert those options directly after kubectl such as kubectl --namespace=default plugin-name. This was however incompatible with kubectl plugins (see https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/).
    • Now the options are placed after the command names, but before other options. Continuing with the previous example, now the final command would be kubectl plugin-name --namespace=default.
  • Fixes #10 Objects with hyphens seem to break

A practical example of a kubectl plugin is an executable named kubectl-old somewhere in your $PATH such as this:

#!/usr/bin/env bash
set -eu
kubectl get "$@" --sort-by=.metadata.creationTimestamp

That allows you to call kubectl old pods (get pods sorted by creation time) in addition to the original kubectl get pods (sorted by name). In kubectl-repl, this of course simplifies to invoking old pods.
Note the the plugin cannot be called kubectl-get-sorted for example, because the builtin commands cannot be overshadowed even when the longest executable filename rule would take place.

Complete changelog since the previous release: 1.4...1.6

This release is also available as a Docker image:
https://hub.docker.com/r/mikulas/kubectl-repl/

1.5

04 Jan 18:22
Compare
Choose a tag to compare
1.5 Pre-release
Pre-release

recalled

1.4 – Column support

08 Jul 08:49
Compare
Choose a tag to compare

Changes since last stable release (1.1):

  • Added indexed variables. Now it's possible to access all columns in the output.
    • The syntax is $var:index, eg $1:2` to access the second column of first variable.
    • The main short syntax $var still works (and will always work). It defaults to $var:1.
    • This is meant mostly for non-standard output, such as --all-namespaces which puts namespace on the first column and unique resource name on the second column.
# beta kube-system get pods --all-namespaces
  	NAMESPACE        NAME                READY STATUS   RESTARTS  AGE
$1 	kube-monitoring  logspout-ds-9l4pw   1/1   Running  36        4d
$2 	kube-monitoring  logspout-ds-b2pws   1/1   Running  9         3d
$3 	kube-monitoring  logspout-ds-gs4nv   1/1   Running  0         4d
# beta kube-system ; echo $1
kube-monitoring
# beta kube-system ; echo $1:2
logspout-ds-9l4pw
  • Support for cluster switching #3
    • A new -context=string flag was introduced, which passed the context to all invoked kubectl commands. This greatly simplifies managing multiple clusters: an operator can have multiple shells opened at once with different contexts.
    • Example usage: ./kubectl-repl -context=beta
  • GCP / GKE Not supported #8
    • Repl wrapped every command around kubectl, but namespace selector communicated directly with the cluster through the golang SDK. In 2830fe3 this was refactored to also use kubectl. This solves many issues, including authentication and state persistence with KUBECONFIG.
  • If machine output is detected (json, yaml), lines are not prefixed and saved to variables. Same with --help.
  • Similarity matching fixes.
  • Added autocomplete dictionary to Docker rlwrap.

Complete changelog since the previous release: 1.1...1.4

This release is also available as a Docker image:
https://hub.docker.com/r/mikulas/kubectl-repl/

1.3-alpha – GCP support, Context setter

03 Jul 07:14
Compare
Choose a tag to compare

resolved issues:

  • Support for cluster switching #3
    • A new -context=string flag was introduced, which passed the context to all invoked kubectl commands. This greatly simplifies managing multiple clusters: an operator can have multiple shells opened at once with different contexts.
    • Example usage: ./kubectl-repl -context=beta
  • GCP / GKE Not supported #8
    • Repl wrapped every command around kubectl, but namespace selector communicated directly with the cluster through the golang SDK. In 2830fe3 this was refactored to also use kubectl. This solves many issues, including authentication and state persistence with KUBECONFIG.

1.2-alpha.2 – (recalled release)

02 Jul 07:25
Compare
Choose a tag to compare
Pre-release

This is a botched release with broken features, removed

Original content
  • removed dynamic watch mode introduced in alpha 1

    • The output was too wonky and the utility was minimal.
  • added support for KUBECONFIG env variable

    • Consists of two parts, separated by a colon (:). The first part sets path to kube config (defaults to $HOME/.kube/config). The other part overrides current context.
    • Example: KUBECONFIG="$PROJECT/kubecfg.yaml:prod" use context prod defined in custom config

Wrapper for kubectl-repl with context as inline parameter:

#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'

if [[ $# -ne 1 ]]; then
    echo "Usage: $0 context"
    exit 1
fi

CTX="$1"
export KUBECONFIG="$HOME/.kube/config:$CTX"
rlwrap kubectl-repl

1.2-alpha – Quality of Life improvements

23 Dec 10:10
Compare
Choose a tag to compare
  • dynamic watch mode

    • Overrides existing lines based on first column, which is assumed to be an identifier. This greatly simplifies the output as it's immediately obvious how many resources exist and what state they are in. 9a44cf9
  • if machine output is detected (json, yaml), lines are not prefixed and saved to variables

  • similarity matching fixes

1.1 – Container fixes

24 Oct 07:05
Compare
Choose a tag to compare

resolved issues:

  • docker container now contains kubectl - Thanks to /u/preflightsiren
  • readme now correctly refers to ~/.kube instead of .kops

No changes were made to the REPL itself.

Complete changelog since the previous release: 1.0...1.1

This release is also available as a Docker container:
https://hub.docker.com/r/mikulas/kubectl-repl/

1.0 – Release

22 Oct 18:26
Compare
Choose a tag to compare

resolved issues:

  • Stream support for --watch and --follow #6
  • Interactive commands are unavailable (exec -it) #7
  • Int signal (^C) now only kills invoked process, not whole repl
  • Stderr is no longer silenced in get commands
  • Add -version flag

While version 1.0 is considered stable, it's feature set is not fixed and will evolve. REPL should only be used for interactive work, not in scripts. For that, either use kubernetes api directly or kubectl yaml/json output.

Complete changelog since the previous release: 0.2...1.0

This release is also available as a Docker container:
https://hub.docker.com/r/mikulas/kubectl-repl/

0.2 – Public prerelease

16 Oct 12:30
Compare
Choose a tag to compare
Pre-release

resolved issues:

  • Variable substitution boundaries #5

new features:

Complete changelog since the previous release: 0.1...0.2

This release is also available as a Docker container:
https://hub.docker.com/r/mikulas/kubectl-repl/