CLI tools
You can use to apply the YAML files required to install Knative components, and also to create Knative resources, such as services and event sources using YAML.
See .
kn
provides a quick and easy interface for creating Knative resources such as 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.
Note
- See Installing kn.
- See the in Github.
The func
CLI enables you to create, build, and deploy Knative Functions without the need to create or modify YAML files directly.
- See Installing Knative Functions.
- See the in Github.
After you have installed kubectl
or kn
, these tools will search for the kubeconfig
file of your cluster in the default location of , and will use this file to connect to the cluster. A kubeconfig
file is usually automatically created when you create a Kubernetes cluster.
You can also set the environment variable $KUBECONFIG
, and point it to the kubeconfig file.
Using the kn
CLI, you can specify the following options to connect to the cluster:
--kubeconfig
: use this option to point to thekubeconfig
file. This is equivalent to setting the$KUBECONFIG
environment variable.--context
: use this option to specify the name of a context from the existing file. Use one of the contexts from the output ofkubectl config get-contexts
.
Using the
kn
CLI--config
option, for example,kn service list --config path/to/config.yaml
. The default config is at~/.config/kn/config.yaml
.
For more information about kubeconfig
files, see .
Instructions for using files are available for the following platforms:
- Google GKE
- Red Hat OpenShift Cloud Platform
- Starting writes this file automatically, or provides an appropriate context in an existing configuration file.