This is a cache of https://docs.openshift.com/container-platform/4.3/serverless/installing_serverless/installing-kn.html. It is a snapshot of the page at 2024-11-23T02:19:18.679+0000.
Installing the Knative <strong>cli</strong> - Installing OpenShift Serverless | Serverless applications | OpenShift Container Platform 4.3
×

kn does not have its own login mechanism. To log in to the cluster, you must install the oc cli and use oc login.

Installation options for the oc cli will vary depending on your operating system.

For more information on installing the oc cli for your operating system and logging in with oc, see the cli getting started documentation.

Installing the kn cli using the OpenShift Container Platform web console

Once the OpenShift Serverless Operator is installed, you will see a link to download the kn cli for Linux, macOS and Windows from the Command Line Tools page in the OpenShift Container Platform web console.

You can access the Command Line Tools page by clicking the question circle icon in the top right corner of the web console and selecting Command Line Tools in the drop down menu.

Procedure
  1. Download the kn cli from the Command Line Tools page.

  2. Unpack the archive:

    $ tar -xf <file>
  3. Move the kn binary to a directory on your PATH.

  4. Check your path:

    $ echo $PATH

    If you do not use RHEL or Fedora, ensure that libc is installed in a directory on your library path. If libc is not available, you might see the following error when you run cli commands:

    $ kn: No such file or directory

Installing the kn cli for Linux using an RPM

For Red Hat Enterprise Linux (RHEL), you can install kn as an RPM if you have an active OpenShift Container Platform subscription on your Red Hat account.

Procedure
  1. Enter the command:

    # subscription-manager register
  2. Enter the command:

    # subscription-manager refresh
  3. Enter the command:

    # subscription-manager attach --pool=<pool_id> (1)
    1 Pool ID for an active OpenShift Container Platform subscription
  4. Enter the command:

    # subscription-manager repos --enable="openshift-serverless-1-for-rhel-8-x86_64-rpms"
  5. Enter the command:

    # yum install openshift-serverless-clients

Installing the kn cli for Linux

For Linux distributions, you can download the cli directly as a tar.gz archive.

Procedure
  1. Download the cli.

  2. Unpack the archive:

    $ tar -xf <file>
  3. Move the kn binary to a directory on your PATH.

  4. Check your path:

    $ echo $PATH

    If you do not use RHEL or Fedora, ensure that libc is installed in a directory on your library path. If libc is not available, you might see the following error when you run cli commands:

    $ kn: No such file or directory

Installing the kn cli for macOS

kn for macOS is provided as a tar.gz archive.

Procedure
  1. Download the cli.

  2. Unpack and unzip the archive.

  3. Move the kn binary to a directory on your PATH.

  4. Check your path:

    $ echo $PATH

Installing the kn cli for Windows

The cli for Windows is provided as a zip archive.

Procedure
  1. Download the cli.

  2. Unzip the archive with a ZIP program.

  3. Move the kn binary to a directory on your PATH.

  4. To check your PATH, open the Command Prompt and enter:

    C:\> path