Skip to content

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

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

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

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

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.

We use analytics and cookies to understand site traffic. Information about your use of our site is shared with Google for that purpose. Learn more.