1

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

Janier
  • 3,982
  • 9
  • 43
  • 96

1 Answers1

2

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.

Will Gordon
  • 3,303
  • 2
  • 11
  • 22
  • Does Microcks install Keyclaok of its own? If i have a another keycloak set up , can i hook it up ? – Janier Apr 05 '19 at 19:36
  • can there be an installation without keycloak? – Janier Apr 05 '19 at 19:54
  • 1
    It looks like there are a few `no-keycloak` templates available: https://github.com/microcks/microcks/tree/master/install/openshift. Just sure to adjust the `oc new-app` params as needed for the new template. – Will Gordon Apr 05 '19 at 20:57
  • your anser works..i tried to deploy it to my corporate on premises openshfit cluster.. the microcs pod is failing and apparently no errors are shows..just a crash loop back off.. How can i find the error? – Janier Apr 05 '19 at 21:01
  • 1
    First, check your project events...there may be a persistent volume not attaching for some reason. Second, check the pod logs themselves (not the deployment logs, they're usually useless). – Will Gordon Apr 05 '19 at 22:49
  • though mongo pod is successful , it has the following error messages 2019-04-05T22:59:20.589+0000 I ACCESS [conn219] Unauthorized: not authorized on admin to execute command { serverStatus: 1, tcmalloc: false } – Janier Apr 05 '19 at 23:00