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.5. Verifying your serverless application deployment
To verify that your serverless application has been deployed successfully, you must get the application URL created by Knative, and then send a request to that URL and observe the output.
OpenShift Serverless supports the use of both HTTP and HTTPS URLs; however the output from oc get ksvc <service_name>
always prints URLs using the http://
format.
Procedure
Find the application URL by entering:
oc get ksvc <service_name>
$ oc get ksvc <service_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME URL LATESTCREATED LATESTREADY READY REASON hello http://hello-default.example.com hello-4wsd2 hello-4wsd2 True
NAME URL LATESTCREATED LATESTREADY READY REASON hello http://hello-default.example.com hello-4wsd2 hello-4wsd2 True
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Make a request to your cluster and observe the output.
Example HTTP request
curl http://hello-default.example.com
$ curl http://hello-default.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example HTTPS request
curl https://hello-default.example.com
$ curl https://hello-default.example.com
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Hello Serverless!
Hello Serverless!
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional. If you receive an error relating to a self-signed certificate in the certificate chain, you can add the
--insecure
flag to the curl command to ignore the error.重要Self-signed certificates must not be used in a production deployment. This method is only for testing purposes.
Example command
curl https://hello-default.example.com --insecure
$ curl https://hello-default.example.com --insecure
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Hello Serverless!
Hello Serverless!
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Optional. If your OpenShift Container Platform cluster is configured with a certificate that is signed by a certificate authority (CA) but not yet globally configured for your system, you can specify this with the curl command. The path to the certificate can be passed to the curl command by using the
--cacert
flag.Example command
curl https://hello-default.example.com --cacert <file>
$ curl https://hello-default.example.com --cacert <file>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
Hello Serverless!
Hello Serverless!
Copy to Clipboard Copied! Toggle word wrap Toggle overflow