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.6.3. Creating serverless applications using the kn CLI
The following procedure describes how you can create a basic serverless application using the kn
CLI.
Prerequisites
- OpenShift Serverless Operator and Knative Serving are installed on your cluster.
-
You have installed
kn
CLI.
Procedure
Create the Knative service by entering the following command:
kn service create <service_name> --image <image> --env <key=value>
$ kn service create <service_name> --image <image> --env <key=value>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow kn service create hello --image docker.io/openshift/hello-openshift --env RESPONSE="Hello Serverless!"
$ kn service create hello --image docker.io/openshift/hello-openshift --env RESPONSE="Hello Serverless!"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow