2

When experimenting with Openshift v3 - I could create and deploy a very simple webapplication with Wildfly & postgres.

When trying to create a very simple SpringBoot application (as a WAR) with Mysql (with 1 table), the MySql volume storage immediately exceeds the quota. As a result the very simple application cannot run properly.

Error creating: pods "springbootmysql-8-" is forbidden: exceeded quota: compute-resources, requested: limits.cpu=1,limits.memory=512Mi, used: limits.cpu=2,limits.memory=1Gi, limited: limits.cpu=2,limits.memory=1Gi 19 times in the last 11 minutes

Update: now I configured both pod's with 480Mi memory - the memory quota's are not exceeded.

I now get an error message stoping the build and deployment:

Error creating: pods "springbootmysql6-2-" is forbidden: exceeded quota: compute-resources, requested: limits.cpu=957m,limits.memory=490Mi, used: limits.cpu=1914m,limits.memory=980Mi, limited: limits.cpu=2,limits.memory=1Gi

tm1701
  • 7,307
  • 17
  • 79
  • 168

1 Answers1

2

On OpenShift Online Starter, if running both a database and frontend with both using 512MB each, you only have enough resources to use the Recreate deployment strategy. You will need to go into the deployment configuration for the front end and change the deployment strategy from Rolling to Recreate.

If after making the change it is still having the same issue, scale down the number of replicas of the front end to 0, and then back to 1. This will ensure that Kubernetes is not stuck in the prior state since it was still trying to deploy under the old settings. Things should then be okay.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
  • The deployment strategy only comes into play when you are forcing a new deployment or deploying an updated version. While your application is chugging along fine, it will handle requests as normal. I don't know about second question. – Graham Dumpleton Sep 14 '17 at 14:05
  • When I create the applicaction, no storage/volume claim is made. When I create a mysql database, then 1 have to use a volume/persistent capacity of 1Gi. But ... then my quotas are exceeded!! I added the message to my initial description. How to continue? – tm1701 Sep 14 '17 at 15:34
  • Does your Java application actually need persistent storage? If all data is in the database, it will not need one. If it does need a persistent volume, if using Starter tier, things will get complicated as you only get one and you can't mount that across multiple applications because the volume type can only be mounted on one node in the cluster at a time and there is ni guarantee they will always be on the same node. – Graham Dumpleton Sep 15 '17 at 13:31
  • In Starter tier you would have to start messing with custom resource definitions to run both the database and Java application in the same pod so they will always run together and so use one persistent volume. – Graham Dumpleton Sep 15 '17 at 13:32
  • Can this be the problem? I installed a small demo SpringBoot via Java/WIldfly. A Mysql database 1 Gi. I get this error message. I have put it also in my main question. ---- Error creating: pods "springbootmysql6-2-" is forbidden: exceeded quota: compute-resources, requested: limits.cpu=957m,limits.memory=490Mi, used: limits.cpu=1914m,limits.memory=980Mi, limited: limits.cpu=2,limits.memory=1Gi – tm1701 Sep 15 '17 at 18:46
  • F I N A L L Y it works. The 1 Gi exceeeding quota is only a warning. Also reshuffling the pom.xml to work with Wildfly helped. See this great answer: https://stackoverflow.com/a/26588699/3143823 – tm1701 Sep 16 '17 at 09:01