I am having issue deploying application on EKS. Current application is processing PDF files and should provide response in swagger. It works well for smaller file but when there is the large request it is just drops connection with below errors.
CORS Network Failure URL scheme must be "http" or "https" for CORS request.
Or 502 bad gateway if exposed with ingress nginx. I tried both with ingress nginx and direct SVC type LB for k8s it's same issue. However if I do docker build just locally and run the same image on my local mac it is working just fine issues seems to be happening only on kubernetes environment.
FROM ubuntu:20.04
WORKDIR /app/ai
RUN apt-get update -y
RUN apt-get install -y python3.8
RUN apt-get install -y python3-pip python-dev build-essential
RUN apt install -y build-essential libssl-dev libffi-dev python3-dev
RUN apt-get install -y python3-venv
RUN apt-get -y install uvicorn
RUN apt-get -y install gunicorn
RUN apt-get install -y curl wget net-tools
RUN apt-get update
RUN apt-get install -y --no-install-recommends libpoppler-cpp0v5 libpoppler-cpp-dev poppler-utils
RUN rm -rf /var/lib/apt/lists/*
COPY ./app /app/ai
RUN pip3 install --upgrade pip setuptools wheel
RUN pip3 install pdf2image
RUN pip install cssutils
RUN pip3 install --no-cache-dir --upgrade -r /app/ai/requirements.txt
RUN adduser --uid 10001 --disabled-password --gecos "" --shell /bin/bash --home /home/versoview_ai versoview_ai
RUN chown -R versoview_ai:versoview_ai /app/ai
RUN chmod 755 /app/ai
USER versoview_ai
EXPOSE 8080
#CMD ["gunicorn", "main:app", "--timeout", "600", "--keep-alive", "0", "--workers", "1", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8080"]
ENTRYPOINT ["uvicorn", "main:app", "--proxy-headers", "--timeout-keep-alive", "1000", "--host", "0.0.0.0", "--port", "8080", "--limit-concurrency", "10000", "--limit-max-requests", "10000", "--backlog", "10000" ]
I tried both as well with uvicorn and guvicorn did not change anything, tried timeouts on guvicorn did not help also tried below annotations on ingress same issue.
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 20000m
nginx.ingress.kubernetes.io/service-upstream: "true"
nginx.ingress.kubernetes.io/proxy-read-timeout: '3600'
nginx.ingress.kubernetes.io/proxy-send-timeout: '3600'
nginx.ingress.kubernetes.io/proxy-connect-timeout: '3600'
kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
Looks like application at some point is loosing connection and it is throwing the error to the LB and it is drops connection. Please suggest on the options if anyone faced similar issue