Rails container does not restart properly on OpenShift 4.x
Closed this issue · 2 comments
serhei commented
Expected Behaviour (verified with Minishift 1.34.0 + OpenShift 3.11.0):
Doing an oc rollout
will cleanly restart the Rails container:
$ git clone https://github.com/sclorg/rails-ex
$ oc new-app rails-ex/openshift/templates/rails-postgresql.json -p SOURCE_REPOSITORY_URL=https://github.com/sclorg/rails-ex
$ oc get pods
NAME READY STATUS RESTARTS AGE
postgresql-1-n8b94 1/1 Running 0 20m
rails-postgresql-example-1-build 0/1 Completed 0 20m
rails-postgresql-example-1-tdl2n 1/1 Running 0 17m
$ oc rollout --latest rails-postgresql-example
$ oc get pods
NAME READY STATUS RESTARTS AGE
postgresql-1-n8b94 1/1 Running 0 21m
rails-postgresql-example-1-build 0/1 Completed 0 21m
rails-postgresql-example-2-xrk95 1/1 Running 0 31s
Actual Behaviour (verified with CodeReady Containers 1.2.0 + OpenShift 4.2.8)
On attempting oc rollout
, the -hook-pre
container hangs in 'Pending' state for over 30min:
$ git clone https://github.com/sclorg/rails-ex
$ oc new-app rails-ex/openshift/templates/rails-postgresql.json -p SOURCE_REPOSITORY_URL=https://github.com/sclorg/rails-ex
$ oc get pods
NAME READY STATUS RESTARTS AGE
postgresql-1-46mtk 1/1 Running 0 4m29s
postgresql-1-deploy 0/1 Completed 0 4m46s
rails-postgresql-example-1-build 0/1 Completed 0 4m47s
rails-postgresql-example-1-deploy 1/1 Running 0 48s
rails-postgresql-example-1-hook-pre 0/1 Completed 0 39s
rails-postgresql-example-1-vzmtw 0/1 Running 0 15s
$ oc rollout latest rails-postgresql-example
$ oc get pods
NAME READY STATUS RESTARTS AGE
postgresql-1-46mtk 1/1 Running 0 38m
postgresql-1-deploy 0/1 Completed 0 38m
rails-postgresql-example-1-build 0/1 Completed 0 38m
rails-postgresql-example-1-deploy 0/1 Completed 0 34m
rails-postgresql-example-1-hook-pre 0/1 Completed 0 34m
rails-postgresql-example-1-vzmtw 1/1 Running 0 34m
rails-postgresql-example-2-deploy 1/1 Running 0 33m
rails-postgresql-example-2-hook-pre 0/1 Pending 0 33m
phracek commented
Hi @serhei , During the time we have migrated Rails-Ex application to Deployment.
Can you please verify, if the problem still persists? Thank you.
I see, as well, that you are using rails-postgresql.json
which is ephemeral, would it be possible to test it with rails-postgresql-persistent.json
? Thank you.
phracek commented
Closing this as the whole rail-ex application is working properly in OpenShift 4 environment. see tests.