Chapter 10. Installing the OpenShift Serverless Logic Knative Workflow plugin
OpenShift Serverless Logic provides a plugin named kn-workflow
for the Knative CLI, enabling you to set up a local workflow project using the command line.
10.1. Installing the OpenShift Serverless Logic Knative Workflow plugin for Linux Copy linkLink copied to clipboard!
If you are using a Linux distribution that does not have RPM or another package manager installed, you can install the Knative Workflow plugin as a binary file.
Prerequisites
-
You have installed the Knative (
kn
) command-line interface (CLI). For more information, see the Installing the Knative CLI documentation. If you are not using RHEL or Fedora, ensure that the libc library is installed in a directory on your path.
ImportantIf the libc library is not available, you might see the following error when you run commands:
kn: No such file or directory
$ kn: No such file or directory
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
-
Download the latest
tar
archive suitable for your environment, from the Serverless Logic download mirror page. Extract the Knative Workflow plugin binary file by running the following command:
tar xvzf <tar_archive>
$ tar xvzf <tar_archive>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Rename the extracted Knative Workflow plugin binary file to
kn-workflow
by running the following command:mv <filename> kn-workflow
$ mv <filename> kn-workflow
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
kn-workflow
command as the Knative CLI plugin:Make the binary file executable by running the following command:
chmod +x <path/to/downloaded/kn-workflow>
$ chmod +x <path/to/downloaded/kn-workflow>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the
kn-workflow
binary file to the/usr/local/bin
, or a directory on yourPATH
by running the following command:mv <path/to/downloaded/kn-workflow> /usr/local/bin/kn-workflow
$ mv <path/to/downloaded/kn-workflow> /usr/local/bin/kn-workflow
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run the following command to verify that the
kn-workflow
plugin is installed successfully:kn plugin list
$ kn plugin list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.2. Installing the OpenShift Serverless Logic Knative Workflow plugin for macOS Copy linkLink copied to clipboard!
If you are using macOS, you can install the Knative Workflow plugin as a binary file.
On macOS, some systems might block the application from running due to security policies. To fix this issue, click System Preferences
Prerequisites
-
You have installed the Knative (
kn
) command-line interface (CLI). For more information, see the Installing the Knative CLI documentation.
Procedure
-
Download the latest
tar
archive suitable for your environment, from the Serverless Logic download mirror page. Extract the Knative Workflow plugin binary file by running the following command:
tar xvzf <tar_archive>
$ tar xvzf <tar_archive>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Rename the extracted Knative Workflow plugin binary file to
kn-workflow
by running the following command:mv <filename> kn-workflow
$ mv <filename> kn-workflow
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
kn-workflow
command as the Knative CLI plugin:Make the binary file executable by running the following command:
chmod +x <path/to/downloaded/kn-workflow>
$ chmod +x <path/to/downloaded/kn-workflow>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Move the
kn-workflow
binary file to the/usr/local/bin
, or a directory on yourPATH
by running the following command:mv <path/to/downloaded/kn-workflow> /usr/local/bin/kn-workflow
$ mv <path/to/downloaded/kn-workflow> /usr/local/bin/kn-workflow
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run the following command to verify that the
kn-workflow
plugin is installed successfully:kn plugin list
$ kn plugin list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.3. Installing the OpenShift Serverless Logic Knative Workflow plugin for Windows Copy linkLink copied to clipboard!
If you are using Windows, you can install the Knative Workflow plugin as a binary file.
Prerequisites
-
You have installed the Knative (
kn
) command-line interface (CLI). For more information, see the Installing the Knative CLI documentation.
Procedure
-
Download the latest
zip
archive suitable for your environment, from the Serverless Logic download mirror page. Extract the Knative Workflow plugin binary file using PowerShell by running the following command:
Expand-Archive -Path <filename>.zip -DestinationPath <destination>
$ Expand-Archive -Path <filename>.zip -DestinationPath <destination>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Rename the extracted Knative Workflow plugin binary file to
kn-workflow
by running the following command:Rename-Item -Path <destination>\<filename>.exe -NewName kn-workflow.exe
$ Rename-Item -Path <destination>\<filename>.exe -NewName kn-workflow.exe
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the
kn-workflow
command as the Knative CLI plugin:On Windows, files with a
.exe
extension are treated as executable by default, so you do not need to change permissions.Copy the
kn-workflow
binary file to a directory in yourPATH
by running the following command:Copy-Item -Path <destination>\kn-workflow.exe -Destination "C:\Program Files\kn-workflow.exe"
$ Copy-Item -Path <destination>\kn-workflow.exe -Destination "C:\Program Files\kn-workflow.exe"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run the following command to verify that the
kn-workflow
plugin is installed successfully:kn plugin list
$ kn plugin list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
10.4. Installing the OpenShift Serverless Logic Knative Workflow plugin using the artifacts image Copy linkLink copied to clipboard!
Prerequisites
-
You have installed the Knative (
kn
) CLI. For more information, see the Installing the Knative CLI documentation. - You have installed Podman on your local machine.
Procedure
Download the Knative Workflow plugin using the
logic-kn-workflow-cli-artifacts-rhel8
image by running the following commands:Log in to the Red Hat Registry by running the following command:
podman login registry.redhat.io
$ podman login registry.redhat.io
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You can use your Red Hat Customer Portal account or a registry service account.
Set a variable for
KN_IMAGE
to start thelogic-kn-workflow-cli-artifacts-rhel8
image by running the following command:export KN_IMAGE=registry.redhat.io/openshift-serverless-1/logic-kn-workflow-cli-artifacts-rhel8:1.33.0
$ export KN_IMAGE=registry.redhat.io/openshift-serverless-1/logic-kn-workflow-cli-artifacts-rhel8:1.33.0
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set a variable for
KN_CONTAINER_ID
by running the following command:export KN_CONTAINER_ID=$(podman run -di $KN_IMAGE)
$ export KN_CONTAINER_ID=$(podman run -di $KN_IMAGE)
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy the Knative Workflow plugin binary file by running the following command:
podman cp $KN_CONTAINER_ID:<path_to_binary> .
$ podman cp $KN_CONTAINER_ID:<path_to_binary> .
Copy to Clipboard Copied! Toggle word wrap Toggle overflow where
<path_to_binary>
is the path to the file for your environment:Expand Environment Path to binary file Linux amd64 architecture
/usr/share/kn/linux_amd64/kn-workflow-linux-amd64.tar.gz
Linux arm64 architecture
/usr/share/kn/linux_arm64/kn-workflow-linux-arm64.tar.gz
macOS amd64 architecture
/usr/share/kn/macos_amd64/kn-workflow-macos-amd64.tar.gz
macOS arm64 architecture
/usr/share/kn/macos_arm64/kn-workflow-macos-arm64.tar.gz
Windows amd64 architecture
/usr/share/kn/windows/kn-workflow-windows-amd64.zip
Stop the container by running the following command:
podman stop $KN_CONTAINER_ID
$ podman stop $KN_CONTAINER_ID
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the container by running the following command:
podman rm $KN_CONTAINER_ID
$ podman rm $KN_CONTAINER_ID
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Extract the selected Knative Workflow plugin binary file by running the following command:
tar xvzf kn-workflow-linux-amd64.tar.gz
$ tar xvzf kn-workflow-linux-amd64.tar.gz
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Rename the Knative Workflow plugin binary file to
kn-workflow
by running the following command:mv kn kn-workflow
$ mv kn kn-workflow
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Install the
kn-workflow
command as a plugin of the Knative CLI by running the following commands:Copy the
kn-workflow
binary file to a directory in your PATH, such as/usr/local/bin
, and ensure the file name iskn-workflow
:cp path/to/downloaded/kn-workflow /usr/local/bin/kn-workflow
$ cp path/to/downloaded/kn-workflow /usr/local/bin/kn-workflow
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make the binary file executable:
chmod +x /usr/local/bin/kn-workflow
$ chmod +x /usr/local/bin/kn-workflow
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run the following command to verify that the
kn-workflow
plugin is installed successfully:kn plugin list
$ kn plugin list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After installing the plugin, you can use
kn-workflow
to run the related subcommands.Aliases to use workflow subcommand
kn-workflow
kn-workflow
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output of
kn-workflow help
commandCopy to Clipboard Copied! Toggle word wrap Toggle overflow