JDK 8 support at DIY cartridge in OpenShift

If you want an specific JDK version you can download it and set the environment variables: cd $OPENSHIFT_DATA_DIR wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-x64.tar.gz tar -zxf jdk-8u5-linux-x64.tar.gz export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_05/bin:$PATH export JAVA_HOME=”$OPENSHIFT_DATA_DIR/jdk/jdk1.8.0_05″ Thanks to this cartridge. As @youssef points out, you should also add this lines to .openshift/action_hooks/start: export JAVA_HOME=”$OPENSHIFT_DATA_DIR/jdk/jdk1.8.0_05″ export PATH=$OPENSHIFT_DATA_DIR/jdk1.8.0_05/bin:$PATH UPDATE: now OpenShift … Read more

How can I debug “ImagePullBackOff”?

You can use the ‘describe pod‘ syntax For OpenShift use: oc describe pod <pod-id> For vanilla Kubernetes: kubectl describe pod <pod-id> Examine the events of the output. In my case it shows Back-off pulling image unreachableserver/nginx:1.14.22222 In this case the image unreachableserver/nginx:1.14.22222 can not be pulled from the Internet because there is no Docker registry … Read more

Using env variable in Spring Boot’s application.properties

You don’t need to use java variables. To include system env variables add the following to your application.properties file: spring.datasource.url = ${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_PORT}/”nameofDB” spring.datasource.username = ${OPENSHIFT_MYSQL_DB_USERNAME} spring.datasource.password = ${OPENSHIFT_MYSQL_DB_PASSWORD} But the way suggested by @Stefan Isele is more preferable, because in this case you have to declare just one env variable: spring.profiles.active. Spring will read the … Read more