This is a cache of https://docs.openshift.com/serverless/1.30/knative-serving/getting-started/verifying-application-deployment.html. It is a snapshot of the page at 2024-11-24T16:58:31.151+0000.
Verifying application deployment - Getting started with Knative Serving | Serving | Red Hat OpenShift Serverless 1.30
×

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 always prints URLs using the http:// format.

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 always prints URLs using the http:// format.

Prerequisites
  • OpenShift Serverless Operator and Knative Serving are installed on your cluster.

  • You have installed the oc CLI.

  • You have created a Knative service.

Prerequisites
  • Install the OpenShift CLI (oc).

Procedure
  1. Find the application URL:

    $ oc get ksvc <service_name>
    Example output
    NAME       URL                                   LATESTCREATED    LATESTREADY      READY   REASON
    showcase   http://showcase-default.example.com   showcase-00001   showcase-00001   True
  2. Make a request to your cluster and observe the output.

    Example HTTP request (using HTTPie tool)
    $ http showcase-default.example.com
    Example HTTPS request
    $ https showcase-default.example.com
    Example output
    HTTP/1.1 200 OK
    Content-Type: application/json
    Server: Quarkus/2.13.7.Final-redhat-00003 Java/17.0.7
    X-Config: {"sink":"http://localhost:31111","greet":"Ciao","delay":0}
    X-Version: v0.7.0-4-g23d460f
    content-length: 49
    
    {
        "artifact": "knative-showcase",
        "greeting": "Ciao"
    }
  3. Optional. If you don’t have the HTTPie tool installed on your system, you can likely use curl tool instead:

    Example HTTPS request
    $ curl http://showcase-default.example.com
    Example output
    {"artifact":"knative-showcase","greeting":"Ciao"}
  4. Optional. If you receive an error relating to a self-signed certificate in the certificate chain, you can add the --verify=no flag to the HTTPie command to ignore the error:

    $ https --verify=no showcase-default.example.com
    Example output
    HTTP/1.1 200 OK
    Content-Type: application/json
    Server: Quarkus/2.13.7.Final-redhat-00003 Java/17.0.7
    X-Config: {"sink":"http://localhost:31111","greet":"Ciao","delay":0}
    X-Version: v0.7.0-4-g23d460f
    content-length: 49
    
    {
        "artifact": "knative-showcase",
        "greeting": "Ciao"
    }

    Self-signed certificates must not be used in a production deployment. This method is only for testing purposes.

  5. 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:

    $ curl https://showcase-default.example.com --cacert <file>
    Example output
    {"artifact":"knative-showcase","greeting":"Ciao"}