* spelling: additional Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: bindings Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: blocked Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: bootstrap Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: channel Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: channel Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: commands Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: comparison Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: configuration Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: controller Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: convert Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: desired Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: dynamic Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: entry Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: execute Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: explicit Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: hardcoded Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: information Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: inject Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: item Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: kubectl Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: latest Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: message Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: namespace Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: namespaces Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: output Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: overriding Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: parameters Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: revision Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: separated Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: separator Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: service Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: specified Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: specifies Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: splitting Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: subscription Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: trigger Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unknown Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: unstructured Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * spelling: workflow Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * chore: Address golinter complaint for (c *MockKnServingClient) GetBaseRevision Signed-off-by: Josh Soref <jsoref@users.noreply.github.com> * chore: update changelog for spelling fixes (#1057) |
||
|---|---|---|
| .. | ||
| cmd | ||
| dev | ||
| operations | ||
| plugins | ||
| traffic | ||
| workflows | ||
| DEVELOPMENT.md | ||
| README.md | ||
README.md
kn
kn is the Knative command line interface (CLI).
Getting Started
Installing kn
You can grab the latest nightly binary executable for:
Put it on your system path, and make sure it's executable.
Alternatively, check out the client repository, and type:
go install ./cmd/kn
To use the kn container image:
- Nightly:
gcr.io/knative-nightly/knative.dev/client/cmd/kn - Latest release:
gcr.io/knative-releases/knative.dev/client/cmd/kn
Connecting to your cluster
You'll need a kubectl-style config file to connect to your cluster.
- Starting minikube writes this file (or gives you an appropriate context in an existing config file)
- Instructions for Google GKE
- Instructions for Amazon EKS
- Instructions for IBM IKS
- Instructions for Red Hat OpenShift
- Or contact your cluster administrator
kn will pick up your kubectl config file in the default location of
$HOME/.kube/config. You can specify an alternate kubeconfig connection file
with --kubeconfig, or the env var $KUBECONFIG, for any command.
Kn Config
There are a set of configuration parameters you can setup to better customize
kn. For example, you can specify where your kn plugins are located and how
they are found, and you can specify the prefix for your addressable sink
objects. The kn configuration file is meant to capture these configuration
options. Let's explore this file's location, and the options you are able to
change with it.
Location
The default location kn looks for config is under the home directory of the
user at $HOME/.config/kn/config.yaml. It is not created for you as part of the
kn installation. You can create this file elsewhere and use the --config
flag to specify its path.
Options
Below are the options you can specify in the kn config file.
-
pluginsDirwhich is the same as the persistent flag--plugins-dirand specifies the kn plugins directory. It defaults to:~/.config/kn/plugins. By using the persistent flag (when you issue a command) or by specifying the value in theknconfig, a user can select which directory to findknplugins. It can be any directory that is visible to the user. -
lookupPluginsInPathwhich is the same as the persistent flag--lookup-plugins-in-pathand specifies ifknshould look for plugins anywhere in the specifiedPATHenvironment variable. This is a boolean configuration option and the default value isfalse. -
sinkdefines your prefix to refer to Kubernetes addressable resources. To configure a sink prefix, define following in the config file:prefix: Prefix you want to describe your sink as.serviceorsvc(serving.knative.dev/v1) andbroker(eventing.knative.dev/v1alpha1) are predefined prefixes inkn. These predefined prefixes can be overridden by values in configuration file.group: The APIGroup of Kubernetes resource.version: The version of Kubernetes resources.resource: The plural name of Kubernetes resources (for example: services).
For example, the following kn config will look for kn plugins in the user's
PATH and also execute plugin in ~/kn/.config/plugins. It also defines a sink
prefix myprefix which refers to brokers in eventing.knative.dev/v1alpha1.
With this configuration, you can use myprefix:default to describe a Broker
default in kn command line.
cat ~/.config/kn/config.yaml
lookupPluginsInPath: true
pluginsdir: ~/.config/kn/plugins
sink:
- prefix: myprefix
group: eventing.knative.dev
version: v1alpha1
resource: brokers
Commands
- See the generated documentation
- See the documentation on managing
kn
Plugins
Kn supports plugins, which allow you to extend the functionality of your kn
installation with custom commands as well as shared commands that are not part
of the core distribution of kn. See the
plugins documentation for more information.