quay.io/rhdevelopers/blue-green-canary crashloops
Describe the bug
Running the quay.io/rhdevelopers/blue-green-canary from the example from the tutorial:
kn service create blue-green-canary \
--image=quay.io/rhdevelopers/blue-green-canary \
--env BLUE_GREEN_CANARY_COLOR="#6bbded" \
--env BLUE_GREEN_CANARY_MESSAGE="Hello"
crashloops
oc logs blue-green-canary-00001-deployment-7675bb595d-5q74s shows
exec /deployments/run-java.sh: permission denied
To Reproduce Steps to reproduce the behavior:
- Install Serverless operator and Knative Serving
- Run
kn service create blue-green-canary \
--image=quay.io/rhdevelopers/blue-green-canary \
--env BLUE_GREEN_CANARY_COLOR="#6bbded" \
--env BLUE_GREEN_CANARY_MESSAGE="Hello"
- Notice the ksvc doesn't become Ready and the pod crashloops
Expected behavior The example image should start and work as described in the tutorial
Additional context Serverless 1.25.0-1 on OpenShift 4.11
@lordofthejars can you help us here ? Who is currently the best PoC for getting fixes for the Knative tutorial ?
@rhuss I've encountered this as well. It is caused by incorrect permissions of the script run-java.sh on the container image:
# ls -la /deployments/
-r-xr-----. 1 1001 root 19272 Apr 19 2020 run-java.sh
Since on OpenShift a container is executed with an arbitrary user, it will not have the permission to execute the shell script. This can be fixed by creating a new image based on the original one with this Dockerfile:
FROM quay.io/rhdevelopers/blue-green-canary
USER root
RUN chown -R 1001:0 /deployments && chgrp -R 0 /deployments && chmod -R g=u /deployments && chmod a+x /deployments/run-java.sh
USER 1001
You can also directly try quay.io/rh_ee_fcharett/blue-green-canary (built from the above), but since the base image from 2020 now has a few critical vulnerabilities, I guess it should be preferable to build a new one from the original sources.
Updating now