CLI tools¶
Choose a tool for your goal, then follow a task guide or use its command reference. The descriptions below explain the tools' roles; this page is not a command catalog.
Accomplish a task¶
- Install CLI tools or install the Functions CLI/plugin.
- Connect CLI tools to a cluster and verify read access before changing resources.
- Follow the Serving Quickstart for a guided first Service, or choose a Functions task for an existing project.
Understand the tools¶
Use kubectl when working with Kubernetes manifests, kn for Knative resource workflows, and func for function-project workflows. The tool-specific sections below describe these boundaries. For the Functions model, read How Knative Functions fits together.
Look up details¶
kncommand reference andfunccommand reference — maintained in their respective repositories; the links follow the documentation release branch when configured, otherwisemain. Check a reference matching your installed binary when looking up flags.- kn configuration-file reference — configuration locations and mappings.
- kn plugins — plugin catalog and installation options.
- Kubernetes kubectl reference — Kubernetes-maintained command documentation.
kubectl¶
You can use kubectl 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 Install and Set Up kubectl.
kn¶
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
The core kn resource commands do not install Knative components such as Serving or Eventing. Separately installed plugins can add installation workflows: the Knative Operator plugin provides commands such as kn operator install. Follow the Operator CLI installation guide for that administrator workflow.
Additional resources¶
- See Installing
kn. - See the upstream
kncommand reference for subcommands and flags.
func¶
The func CLI enables you to create, build, and deploy Knative Functions without the need to create or modify YAML files directly.
Additional resources¶
- See Installing Knative Functions.
- See the upstream
funccommand reference for subcommands and flags. - Choose a workflow from the Functions task guides.
Connecting CLI tools to your cluster¶
Follow Connect CLI tools to a cluster to select a kubeconfig/context and verify access with kubectl and kn.
A kubeconfig defines cluster connections and credentials; kn's separate configuration file defines CLI preferences. KUBECONFIG and --kubeconfig concern cluster access, while kn --config selects the kn preferences file. They are not interchangeable.
Using kubeconfig files with your platform¶
Provider-specific links are retained in the cluster-access guide's Using kubeconfig files with your platform section.