Before you begin¶
Prerequisites¶
Install kind
.¶
kind
(Kubernetes in Docker) is a tool for running local Kubernetes clusters using Docker container “nodes”. kind
was primarily designed for testing Kubernetes itself, but may be used for local development.
See Kind website for installation options.
Install kubectl
¶
The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
See the Kubernetes docs for installation options.
Install kn
¶
The Knative CLI kn
provides a quick and easy interface for creating Knative resources such as Knative Services and event sources, without the need to create or modify YAML files directly. kn
also simplifies completion of otherwise complex procedures such as autoscaling and traffic splitting.
Installing the kn
CLI
For macOS, you can install kn
by using Homebrew.
brew install knative/client/kn
You can install kn
by downloading the executable binary for your system and placing it in the system path.
A link to the latest stable binary release is available on the kn
release page.
-
Check out the
kn
client repository:git clone https://github.com/knative/client.git cd client/
-
Build an executable binary:
hack/build.sh -f
-
Move
kn
into your system path, and verify thatkn
commands are working properly. For example:kn version
WARNING: Nightly container images include features which may not be included in the latest Knative release and are not considered to be stable.
Links to images are available here:
You can run kn
from a container image. For example:
docker run --rm -v "$HOME/.kube/config:/root/.kube/config" gcr.io/knative-releases/knative.dev/client/cmd/kn:latest service list
NOTE: Running kn
from a container image does not place the binary on a permanent path. This procedure must be repeated each time you want to use kn
.
For more complex installations, such as nightly releases, see Install kn
Installing the Knative Sandbox¶
The fastest way to get started with Knative locally is to use the Knative on Kind (konk) script. We call this the "Knative Sandbox" and it's perfect for local deployments and general hacking.
Install the Knative Sandbox
curl -sL install.konk.dev | bash
What does the Knative Sandbox script do?
Below is a description of each of the scripts which are run by the Knative Sandbox, we've also provided each script as an independent curl
command.
-
Checks to see that you have Kind installed and creates a Cluster called "knative" + some port-forwarding magic to simplify local DNS via
01-kind.sh
curl -sL https://raw.githubusercontent.com/csantanapr/knative-kind/master/01-kind.sh | sh
-
Installs Knative Serving with Kourier as the networking layer and nip.io as the DNS
02-serving.sh
curl -sL https://raw.githubusercontent.com/csantanapr/knative-kind/master/02-serving.sh | sh
-
Installs Knative Eventing with an In-Memory Channels and In-Memory Broker on the "knative" Cluster via
04-eventing.sh
curl -sL https://raw.githubusercontent.com/csantanapr/knative-kind/master/03-eventing.sh | sh