Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bmuschko/kubectl-server-version
A kubectl plugin for rendering the Kubernetes server version.
https://github.com/bmuschko/kubectl-server-version
golang kubectl kubectl-plugins kubernetes
Last synced: 22 days ago
JSON representation
A kubectl plugin for rendering the Kubernetes server version.
- Host: GitHub
- URL: https://github.com/bmuschko/kubectl-server-version
- Owner: bmuschko
- License: apache-2.0
- Created: 2019-05-31T17:45:56.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-20T14:07:27.000Z (over 5 years ago)
- Last Synced: 2024-11-02T07:33:09.616Z (2 months ago)
- Topics: golang, kubectl, kubectl-plugins, kubernetes
- Language: Go
- Size: 37.1 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
- awesome-kubectl-plugins - kubectl-server-version
README
= kubectl server-version image:https://circleci.com/gh/bmuschko/kubectl-server-version.svg?style=svg["CircleCI", link="https://circleci.com/gh/bmuschko/kubectl-server-version"] image:https://goreportcard.com/badge/github.com/bmuschko/kubectl-server-version["Go Report Card", link="https://goreportcard.com/report/github.com/bmuschko/kubectl-server-version"]
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 https://github.com/kubernetes-sigs/krew[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.[source,bash]
----
$ export GO111MODULES=on
$ go build -o kubectl-server_version
----Binaries for a wide range of other platforms can be created with the help of https://github.com/goreleaser/goreleaser[GoReleaser].
[source,bash]
----
$ 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 https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/[official documentation on kubectl plugins].== Usage
Run the command `server-version` to render the Kubernetes server version.
[source,bash]
----
$ kubectl server-version
Hello from Kubernetes server with version v1.10.11!
----The subcommand `version` renders the version of the released binary.
[source,bash]
----
$ kubectl server-version version
kubectl server-version v0.2.0
----