Search code examples
openshiftopenshift-originopenshift-enterprise

setting up microcks in openshift


I am trying to set up microcks in the openshift.. I am just using the free starter from openshift at the https://console.starter-us-west-2.openshift.com/console/catalog

In the http://microcks.github.io/installing/openshift/ , the command is given as below

oc new-app --template=microcks-persistent --param=APP_ROUTE_HOSTNAME=microcks-microcks.192.168.99.100.nip.io --param=KEYCLOAK_ROUTE_HOSTNAME=keycloak-microcks.192.168.99.100.nip.io --param=OPENSHIFT_MASTER=https://192.168.99.100:8443 --param=OPENSHIFT_OAUTH_CLIENT_NAME=microcks-client

In that , how can i find the route for my project ? my project is called testcoolers . so what will be instead microcks-microcks.192.168.99.100.nip.io? I guess something will replace 192.168.99.100.nip.io same with keycloak hostname ?also what will be the Public OpenShift master address? Its now https://192.168.99.100:8443


Solution

  • Installing Microcks appears to assume some level of OpenShift familiarity. Also, there are several restrictions that make this not an ideal install for OpenShift Online Starter, but it can definitely still be made to work.

    # Create the template within your namespace
    oc create -f https://raw.githubusercontent.com/microcks/microcks/master/install/openshift/openshift-persistent-full-template-https.yml
    
    # Deploy the application from the template, be sure to replace <NAMESPACE> with your proper namespace
    oc new-app --template=microcks-persistent-https \
        --param=APP_ROUTE_HOSTNAME=microcks-<NAMESPACE>.7e14.starter-us-west- 2.openshiftapps.com \
        --param=KEYCLOAK_ROUTE_HOSTNAME=keycloak-<NAMESPACE>.7e14.starter-us-west-2.openshiftapps.com \
        --param=OPENSHIFT_MASTER=https://api.starter-us-west-2.openshift.com \
        --param=OPENSHIFT_OAUTH_CLIENT_NAME=microcks-client \
        --param=MONGODB_VOL_SIZE=1Gi \
        --param=MEMORY_LIMIT=384Mi \
        --param=MONGODB_MEMORY_LIMIT=384Mi
    
    # The ROUTE params above are still necessary for the variables, but in Starter, you can't specify a hostname in a route, so you'll have to manually create the routes
    oc create route edge microcks --service=microcks --insecure-policy=Redirect
    oc create route edge keycloak --service=microcks-keycloak --insecure-policy=Redirect
    

    You should also see an error about not being able to create the OAuthClient. This is expected because you don't have permissions to create this for the whole cluster. You will instead need to manually create a user in KeyCloak.

    I was able to get this to successfully deploy and logged in on OpenShift Online Starter, so use the comments if you struggle at all.