Overview

Skill Level: Any Skill Level

In this recipe we are going deploy an knative app in OCP 4.2 containing Cloud Pak for Application 4.0

Here we are going to focus more on "Virtual Service not ready" error while deploying knative app.

Ingredients

Cloud Pak for App v4.0 installed on Red Hat OpenShift Container Platform V.4.2 and it is running.

Step-by-step

  1. Previous Recipe

    As we are more focusing on Virtual Service not ready error here, we will not be discussing about versioning concepts. You can see the previous recipe on Deploying Knative app using the below url to understand about the versioning and all.

    https://developer.ibm.com/recipes/tutorials/deploying-serverless-application-using-knative-in-openshift-cp4a/

     

     

  2. About Helloworld Application

    We are going to use this hello-world application to demonstrate the Serverless deployment using Knative.

    1-Knative-App

    You can also refer the same in https://docs.openshift.com/container-platform/4.2/serverless/getting-started-knative-services.html

  3. Deploying Knative Application

    1) Login into OpenShift.

    oc login https://52.117.AAA.BBB.nip.io:8443 –token=7QJvowNjE2uEbsadfdasfklaCpC3Bk

     

    2) Create a new project

    oc new-project gandhi

     

    3) Deploy k-native application

    kubectl apply –filename sample.yaml

  4. Viewing error in the deployment

    1) View all the available resources after the service is created. You can see some resources are with uninitialized error.

    kubectl get ksvc,revision,route,pod,configuration,svc,all

     

    2-GetAll-Before

     

    2) Oc describe shows the error “Virtual service is not ready“.

    3-VirtualService-NotReady-Error

     

  5. Fixing error in the deployment

    1) Add this new project gandhi into ServiceMeshMemberRoll using the below command.

    oc edit ServiceMeshMemberRoll default -n istio-system

     

    4-ServiceMeshMemberRoll

     

    2) Now the knative application status becomes ready and application is accessible..

    kubectl get ksvc,revision,route,pod,configuration,svc,all

     

     

    5-GetAll-After

     

  6. Access the application

    1) Access the application in the browser and see the results.

    6-Output

Join The Discussion