Este contenido no está disponible en el idioma seleccionado.
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 using the artifacts image Copiar enlaceEnlace copiado en el portapapeles!
Prerequisites
-
You have installed the Knative (
kn) CLI. - You have installed Podman on your local machine.
Procedure
Download the Knative Workflow plugin using the
logic-kn-workflow-cli-artifacts-rhel8image 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.ioCopy 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_IMAGEto start thelogic-kn-workflow-cli-artifacts-rhel8image 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.0Copy to Clipboard Copied! Toggle word wrap Toggle overflow Set a variable for
KN_CONTAINER_IDby 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.gzLinux arm64 architecture
/usr/share/kn/linux_arm64/kn-workflow-linux-arm64.tar.gzmacOS amd64 architecture
/usr/share/kn/macos_amd64/kn-workflow-macos-amd64.tar.gzmacOS arm64 architecture
/usr/share/kn/macos_arm64/kn-workflow-macos-arm64.tar.gzWindows amd64 architecture
/usr/share/kn/windows/kn-workflow-windows-amd64.zipStop the container by running the following command:
podman stop $KN_CONTAINER_ID
$ podman stop $KN_CONTAINER_IDCopy 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_IDCopy 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.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow Rename the Knative Workflow plugin binary file to
kn-workflowby running the following command:mv kn kn-workflow
$ mv kn kn-workflowCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Install the
kn-workflowcommand as a plugin of the Knative CLI by running the following commands:Copy the
kn-workflowbinary 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-workflowCopy 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-workflowCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Run the following command to verify that the
kn-workflowplugin is installed successfully:kn plugin list
$ kn plugin listCopy to Clipboard Copied! Toggle word wrap Toggle overflow After installing the plugin, you can use
kn-workflowto run the related subcommands.Aliases to use workflow subcommand
kn-workflow
kn-workflowCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output of
kn-workflow helpcommandCopy to Clipboard Copied! Toggle word wrap Toggle overflow