This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.第 5 章 Pipelines CLI (tkn)
5.1. Installing tkn 复制链接链接已复制到粘贴板!
Use the tkn CLI to manage Red Hat OpenShift Pipelines from a terminal. The following section describes how to install tkn on different platforms.
You can also find the URL to the latest binaries from the OpenShift Container Platform web console by clicking the ? icon in the upper-right corner and selecting Command Line Tools.
For Linux distributions, you can download the CLI directly as a tar.gz archive.
Procedure
- Download the CLI.
Unpack the archive:
tar xvzf <file>
$ tar xvzf <file>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Place the
tknbinary in a directory that is on yourPATH. To check your
PATH, run:echo $PATH
$ echo $PATHCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For Red Hat Enterprise Linux (RHEL) version 8, you can install the Red Hat OpenShift Pipelines CLI (tkn) as an RPM.
Prerequisites
- You have an active OpenShift Container Platform subscription on your Red Hat account.
- You have root or sudo privileges on your local system.
Procedure
Register with Red Hat Subscription Manager:
subscription-manager register
# subscription-manager registerCopy to Clipboard Copied! Toggle word wrap Toggle overflow Pull the latest subscription data:
subscription-manager refresh
# subscription-manager refreshCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the available subscriptions:
subscription-manager list --available --matches '*pipelines*'
# subscription-manager list --available --matches '*pipelines*'Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the output for the previous command, find the pool ID for your OpenShift Container Platform subscription and attach the subscription to the registered system:
subscription-manager attach --pool=<pool_id>
# subscription-manager attach --pool=<pool_id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the repositories required by Red Hat OpenShift Pipelines:
subscription-manager repos --enable="pipelines-1.1-for-rhel-8-x86_64-rpms"
# subscription-manager repos --enable="pipelines-1.1-for-rhel-8-x86_64-rpms"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
openshift-pipelines-clientpackage:yum install openshift-pipelines-client
# yum install openshift-pipelines-clientCopy to Clipboard Copied! Toggle word wrap Toggle overflow
After you install the CLI, it is available using the tkn command:
tkn version
$ tkn version
For Windows, the tkn CLI is provided as a zip archive.
Procedure
- Download the CLI.
- Unzip the archive with a ZIP program.
-
Add the location of your
tkn.exefile to yourPATHenvironment variable. To check your
PATH, open the command prompt and run the command:path
C:\> pathCopy to Clipboard Copied! Toggle word wrap Toggle overflow
For macOS, the tkn CLI is provided as a tar.gz archive.
Procedure
- Download the CLI.
- Unpack and unzip the archive.
-
Move the
tknbinary to a directory on your PATH. To check your
PATH, open a terminal window and run:echo $PATH
$ echo $PATHCopy to Clipboard Copied! Toggle word wrap Toggle overflow