GitXplorerGitXplorer
n

kubectl-duck

public
4 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
b8b38774f63bffb844dc66626bcd07a3e29d2b56

adding duck.knative.dev/binding

committed 5 years ago
Unverified
e7ea41880327aa01686af67d046a8195f73df233

adding duck.knative.dev/podspecable

committed 5 years ago
Unverified
c68a731e3252cc3ed89ef6e31a963bcc7a10be19

propage feedback from krew back to parent repo.

committed 5 years ago
Unverified
f9495190edae7d7fcd6ca98d123cfd6bbe4ef38d

adding krew.

committed 5 years ago
Unverified
56ce13980037a3fc9f7334d6d09d22c8272b12b9

adding todo.

committed 5 years ago
Unverified
900c52813ab5fa93ea5e6ff1e94d4a4e517822bc

add readme example.

committed 5 years ago

README

The README file for this repository.

kubectl-duck

Ducktyping support for kubectl.

GoDoc Go Report Card

Work in progress.

Installation

Use krew plugin manager to install,

kubectl krew install duck
kubectl duck --help

Or manually,

kubectl-duck can be installed via:

go get github.com/n3wscott/kubectl-duck/cmd/kubectl-duck

To update your installation:

go get -u github.com/n3wscott/kubectl-duck/cmd/kubectl-duck

Usage

kubectl-duck has two command at the moment: list and get

List

List CustomResourceDefinitions that implement ducktypes.

Usage:
  kubectl-duck list [flags]

Examples:

  To list the known ducktypes:
  $ kubectl duck list

  To list which resources a given ducktype maps to:
  $ kubectl duck list <ducktype>


Flags:
  -h, --help   help for list

Global Flags:
  -v, --v Level   number for the log level verbosity

Examples

$ kubectl duck list
NAME                                SHORT NAME    SELECTOR
duck.knative.dev/source             source        duck.knative.dev/source=true
messaging.knative.dev/subscribable  subscribable  messaging.knative.dev/subscribable=true
duck.knative.dev/addressable        addressable   duck.knative.dev/addressable=true
$ kubectl duck list addressable
NAME                                    KIND             DUCK         CREATED AT
brokers.eventing.knative.dev            Broker           addressable  66d
channels.messaging.knative.dev          Channel          addressable  66d
inmemorychannels.messaging.knative.dev  InMemoryChannel  addressable  66d
parallels.flows.knative.dev             Parallel         addressable  60d
parallels.messaging.knative.dev         Parallel         addressable  66d
routes.serving.knative.dev              Route            addressable  66d
sequences.flows.knative.dev             Sequence         addressable  60d
sequences.messaging.knative.dev         Sequence         addressable  66d
services.serving.knative.dev            Service          addressable  66d
tasks.n3wscott.com                      Task             addressable  62d

Get

Get the resource instances related to a ducktype.

Usage:
  kubectl-duck get [flags]

Examples:

  To get resource instances that are of the given ducktype:
  $ kubectl duck get [ducktype]


Flags:
  -h, --help   help for get

Global Flags:
  -v, --v Level   number for the log level verbosity

Examples

$ kubectl duck get addressable
 Broker brokers.eventing.knative.dev/v1alpha1
 NAMESPACE  NAME            READY  REASON  AGE
 default    Broker/default  True           62d
 
 
 InMemoryChannel inmemorychannels.messaging.knative.dev/v1alpha1
 NAMESPACE  NAME                                 READY  REASON  AGE
 default    InMemoryChannel/default-kne-ingress  True           60d
 default    InMemoryChannel/default-kne-trigger  True           60d
 
 
 
 Route routes.serving.knative.dev/v1
 NAMESPACE  NAME                  READY  REASON  AGE
 default    Route/classifier      True           60d
 default    Route/even            True           60d
 default    Route/odd             True           60d
 
 
 Service services.serving.knative.dev/v1
 NAMESPACE  NAME                READY  REASON  AGE
 default    Service/classifier  True           60d
 default    Service/even        True           60d
 default    Service/odd         True           60d

TODO:

  • [] Add support for dynamic ducktype lookup.
  • [] Add support for known ducktypes local file.

Authors

Scott Nichols @n3wscott.

License

Apache 2.0. See LICENSE.