Skip to content

Latest commit

 

History

History
47 lines (29 loc) · 1.13 KB

File metadata and controls

47 lines (29 loc) · 1.13 KB

knctl as a kubectl plugin

kubectl recently introduced new CLI plugin mechanism on master branch (not officially released yet).

To try it out, build new kubectl locally from master

$ git clone https://github.com/kubernetes/kubernetes ~/workspace/kubernetes/src/k8s.io/kubernetes

$ export GOPATH=~/workspace/kubernetes/

$ go build k8s.io/kubernetes/cmd/kubectl

$ ./kubectl version

Install knctl by grabbing pre-built binaries from the Releases page

$ shasum -a 256 ~/Downloads/knctl-*
# Compare checksum output to what's included in the release notes

$ mv ~/Downloads/knctl-* /usr/local/bin/kubectl-kn

$ chmod +x /usr/local/bin/kubectl-kn

kubectl will find any binary named kubectl-* on your PATH and consider it as a plugin

$ ./kubectl plugin list

/usr/local/bin/kubectl-kn

List Knative services

$ ./kubectl kn service list

Services in namespace 'default'

Name   Domain                     Annotations  Age
hello  hello.default.example.com  -            1d

1 services