From 5acb4f76e25987e04d9c3c42581d673b3387c46f Mon Sep 17 00:00:00 2001 From: Lvjiawei Date: Fri, 21 Feb 2020 18:10:44 +0800 Subject: [PATCH] Improve "Installing the Knative CLI" * Make `install kn with Go` more detailed. * Give example on how to run kn using container. --- docs/install/install-kn.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/install/install-kn.md b/docs/install/install-kn.md index 73d3b0a9a1..66a6fe59a0 100644 --- a/docs/install/install-kn.md +++ b/docs/install/install-kn.md @@ -26,6 +26,26 @@ To install the `kn` Client, you must download the executable binary for your sys You must place the executable binary in your system path, and make sure that it is executable. +## Install `kn` using Go +**Prerequisite:** Building `kn` requires Go v1.14 or newer. You will first need a working Go environment. +1. Check out the [Client repository](https://github.com/knative/client): + ```bash + git clone https://github.com/knative/client.git + cd client/ + ``` +1. Build an executable binary: + ```bash + hack/build.sh -f + ``` +1. Move `kn` into your system path, and verify that `kn` commands are working properly. For example: + ```bash + kn version + ``` + +## Install `kn` using brew + +For macOs, you can [install kn using brew.](https://github.com/knative/homebrew-client) + ## `kn` container images The `kn` container images are available for users who require these for additional use cases. For example, if you want to use the `kn` container image with [Tekton](https://github.com/tektoncd/catalog/tree/master/kn). @@ -34,3 +54,16 @@ Links to either the nightly container image or the latest stable container image - [Nightly container image](https://gcr.io/knative-nightly/knative.dev/client/cmd/kn) - [Latest release](https://gcr.io/knative-releases/knative.dev/client/cmd/kn) + +You can run `kn` from a container image. For example: + ```bash + docker run --rm -v "$HOME/.kube/config:/root/.kube/config" gcr.io/knative-releases/knative.dev/client/cmd/kn:latest service list + ``` + +## Using `kn` with Tekton + +You can also [run kn using Tekton](https://github.com/tektoncd/catalog/tree/master/kn). + +## What's next +To learn more about using `kn`, see the [documentation](https://github.com/knative/client/blob/master/docs/cmd/kn.md). +