client/docs
Roland Huß a7d1bc9dc0 feat(service create): Wait for a service to be ready when its created (#156)
* feat(service create): Added --no-wait and --wait-timeout

By default, `kn service create` blocks until the service is either
created or an error occured during service creation.

With the option --no-wait the behaviour can be switched to an
async mode so that that kn returns immediately after the service is
created without waiting for a successful Ready status condition.

The timeout for how long to wait can be configured with --wait-timeout
If a timeout occur, that doesn't mean that the service is not created,
but the wait just returns. The default value is 60 seconds.

In wait mode, print out the service URL as a last line (so that it can be used together with `tail -1`) to extract the service URL after the service is created.

Fixes #54

* chore(service create): Tolerate if obeservedGeneration has not been set yet during startup

* chore(service create): Refactored based on review comments

* Introduced an --async flag (replacing --wait and --no-wait)
* Added proper retry handling on the list watch
* Updated help message

* chore(service wait): Added a new test for sync behaviour
2019-06-28 05:57:06 -07:00
..
cmd feat(service create): Wait for a service to be ready when its created (#156) 2019-06-28 05:57:06 -07:00
README.md Renames revision 'get' to 'list' (#180) 2019-06-13 13:56:51 -07:00
plugins.md Adds Cobra generated docs and means to generate them and first cut of other docs (#93) 2019-05-06 17:39:36 -07:00
workflows.md Renames service 'get' to 'list' (#179) 2019-06-13 13:56:43 -07:00

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.

Alternately, check out the client repository, and type:

go install ./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
  • 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.

Commands

See the generated documentation.

Service Management

A Knative service is the embodiment of a serverless workload. Generally in the form of a collection of containers running in a group of pods in the underlying Kubernetes cluster. Each Knative service associates with a collection of revisions which represents the evolution of that service.

With the Kn CLI a user can list, create, delete, and update Knative services. The detail reference of each sub-command under the service command shows the options and flags for this group of commands.

Examples:

# Create a new service from an image

kn service create mysvc --env KEY1=VALUE1 --env KEY2=VALUE2 --image dev.local/ns/image:latest

You are able to also specify the requests and limits of both CPU and memory when creating a service. See service create command reference for additional details.

# List existing services in the 'default' namespace of your cluster

kn service list

You can also list services from all namespaces or specific namespace using flags: --all-namespaces and --namespace mynamespace. See service list command reference for additional details.

Revision Management

A Knative revision is a "snapshot" of the specification of a service. For instance, when a Knative service is created with environment variable FOO=bar a revision is added to the service. When later the environment variable is changed to baz or additional variables are added, a new revision is created. When the image the service is running is changed to a new digest, a new revision is created.

With the revision command group you can list and describe the current revisions on a service.

Examples:

# Listing a service's revision

kn revision list --service srvc # CHECK this since current command does not have --service flag

Utilities

These are commands that provide some useful information to the user.

  • The kn help command displays a list of the commands with helpful information.
  • The kn version command will display the current version of the kn build including date and Git commit revision.
  • The kn completion command will output a BASH completion script for kn to allow command completions with tabs.

Common Flags

For every Kn command you can use these optional common additional flags:

  • -h or --help to display specific help for that command
  • --config string which specifies the Kn config file (default is $HOME/.kn.yaml)
  • --kubeconfig string which specifies the kubectl config file (default is $HOME/.kube/config)