Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 2. Configuring the Knative CLI


You can customize your Knative (kn) CLI setup by creating a config.yaml configuration file. You can give this configuration by using the --config flag, otherwise the CLI picks up the configuration from a default location.

The default configuration location conforms to the Cross-Desktop Group (XDG) Base Directory Specification, and is different for UNIX systems and Windows systems.

2.1. Knative CLI configuration file locations and structure

Default configuration file locations for the Knative (kn) CLI across different operating systems and an overview of the configuration file structure and key fields.

For UNIX systems:

  • If the XDG_CONFIG_HOME environment variable is set, the default configuration location that the Knative (kn) CLI looks for is $XDG_CONFIG_HOME/kn.
  • If the XDG_CONFIG_HOME environment variable is not set, the Knative (kn) CLI looks for the configuration in the home directory of the user at $HOME/.config/kn/config.yaml.

For Windows systems, the default Knative (kn) CLI configuration location is %APPDATA%\kn.

You get an output similar to the following example:

plugins:
  path-lookup: true
  directory: ~/.config/kn/plugins
eventing:
  sink-mappings:
  - prefix: svc
    group: core
    version: v1
    resource: services
plugins.path-lookup
Specifies whether the Knative (kn) CLI should look for plugins in the PATH environment variable. This is a boolean configuration option. The default value is false.
plugins.directory
Specifies the directory where the Knative (kn) CLI looks for plugins. The default path depends on the operating system, as described earlier. This can be any directory that is visible to the user.
eventing.sink-mappings
The sink-mappings spec defines the Kubernetes addressable resource that is used when you use the --sink flag with a Knative (kn) CLI command.
sink-mappings.prefix
The prefix you want to use to describe your sink. svc for a service, channel, and broker are predefined prefixes for the Knative (kn) CLI.
sink-mappings.group
The API group of the Kubernetes resource.
sink-mappings.version
The version of the Kubernetes resource.
sink-mappings.resource
The plural name of the Kubernetes resource type. For example, services or brokers.
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2026 Red Hat
Nach oben