Skip to content

A kubectl plugin for rendering the Kubernetes server version.

License

Notifications You must be signed in to change notification settings

bmuschko/kubectl-server-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubectl server-version CircleCI Go Report Card

A simple kubectl plugin for displaying the Kubernetes server version. This project is meant to demonstrate the use of the Go-based Kubernetes client API invoked from a kubectl plugin. Therefore, the plugin has not been registered with the kubectl plugin manager krew.

Building the binary from source

The project requires Go 1.11 or higher as dependencies are defined with the help of Go Modules. First, activate Go Modules by setting the relevant environment variable. Next, create the platform-specific binary with the build command.

$ export GO111MODULES=on
$ go build -o kubectl-server_version

Binaries for a wide range of other platforms can be created with the help of GoReleaser.

$ goreleaser release --skip-validate --snapshot --rm-dist

To release a new version of the binaries to GitHub Releases, create a Git tag and remove the relevant flags in the command above.

Installation

The binary must be placed on the $PATH named kubectl-server_version. Ensure that the binary has execution permissions. For more information, see the official documentation on kubectl plugins.

Usage

Run the command server-version to render the Kubernetes server version.

$ kubectl server-version
Hello from Kubernetes server with version v1.10.11!

The subcommand version renders the version of the released binary.

$ kubectl server-version version
kubectl server-version v0.2.0

About

A kubectl plugin for rendering the Kubernetes server version.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages