postmanlabs / httpbin

HTTP Request & Response Service, written in Python + Flask.
https://httpbin.org
ISC License
12.83k stars 1.82k forks source link

httpbin in Openshift can't started #654

Open codeofthesymbol opened 3 years ago

codeofthesymbol commented 3 years ago

Hi guys, i need help here..i deploy my httpbin container in my openshift environment..but it got crashloopback.i check in the log, it show something like this

[2021-09-23 04:46:11 +0000] [1] [INFO] Starting gunicorn 19.9.0 [2021-09-23 04:46:11 +0000] [1] [ERROR] Retrying in 1 second. [2021-09-23 04:46:12 +0000] [1] [ERROR] Retrying in 1 second. [2021-09-23 04:46:13 +0000] [1] [ERROR] Retrying in 1 second. [2021-09-23 04:46:14 +0000] [1] [ERROR] Retrying in 1 second. [2021-09-23 04:46:15 +0000] [1] [ERROR] Retrying in 1 second. [2021-09-23 04:46:16 +0000] [1] [ERROR] Can't connect to ('0.0.0.0', 80)

what causing this issue? and how to solve it?

i use yaml file in this link

https://raw.githubusercontent.com/istio/istio/release-1.11/samples/httpbin/httpbin.yaml

nielsole commented 2 years ago

just add the following to your deployment:

args: ["gunicorn", "-b", "0.0.0.0:8080", "httpbin:app", "-k", "gevent"]
nielsole commented 2 years ago

or build your own docker image:

FROM kennethreitz/httpbin
CMD ["gunicorn", "-b", "0.0.0.0:8080", "httpbin:app", "-k", "gevent"]
hawksight commented 1 year ago

Assuming you don't want to go and build your own version of this, I think the command you need is:

oc adm policy add-scc-to-user anyuid system:serviceaccount:<namespace>:<sa_name>
# eg for "httpbin" SA in "httpbin" project
oc adm policy add-scc-to-user anyuid system:serviceaccount:httpbin:httpbin