-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix custom-error-pages file not exist #7728
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@learn0208: This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Welcome @learn0208! |
Hi @learn0208. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What is the issue number/link that this PR fixes ? |
Completed |
# cd images/custom-error-pages/rootfs
# docker build -t defaultbackend:test .
# docker run --rm -p 808:8080 defaultbackend:test .
# curl -H "X-code: 404" 127.0.0.1:808 |
@learn0208 it is very likely that you have a valid and reasonable information updated to this PR. Lets wait for other opinions but I myself do not approve of this PR in its current state. |
We wanted to customize the ingress-nginx error page reponse. Build default-http-backend image from github, but got back was '404 page not found'. So the Dockerfile can be improved, such as adding such a line COPY --from=builder /go/src/k8s.io/ingress-nginx/images/custom-error-pages/www /www Our test step. # kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.4", GitCommit:"67d2fcf276fcd9cf743ad4be9a9ef5828adc082f", GitTreeState:"clean", BuildDate:"2019-09-18T14:51:13Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.4", GitCommit:"67d2fcf276fcd9cf743ad4be9a9ef5828adc082f", GitTreeState:"clean", BuildDate:"2019-09-18T14:41:55Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"} build from https://github.com/kubernetes/ingress-nginx/blob/main/images/custom-error-pages/rootfs/Dockerfile as defaultbackend:test. apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: default-http-backend
labels:
k8s-app: default-http-backend
namespace: ingress-nginx
spec:
replicas: 1
template:
metadata:
labels:
k8s-app: default-http-backend
spec:
terminationGracePeriodSeconds: 60
containers:
- name: default-http-backend
# Any image is permissable as long as:
# 1. It serves a 404 page at /
# 2. It serves 200 on a /healthz endpoint
image: defaultbackend:test
livenessProbe:
httpGet:
path: /healthz
port: 8080
scheme: HTTP
initialDelaySeconds: 30
timeoutSeconds: 5
ports:
- containerPort: 8080
resources:
limits:
cpu: 100m
memory: 200Mi
requests:
cpu: 10m
memory: 20Mi
---
apiVersion: v1
kind: Service
metadata:
name: default-http-backend
namespace: ingress-nginx
labels:
k8s-app: default-http-backend
spec:
ports:
- port: 80
targetPort: 8080
selector:
k8s-app: default-http-backend ingress-nginx information ...
args:
- /nginx-ingress-controller
- --default-backend-service=$(POD_NAMESPACE)/default-http-backend
- --publish-service=$(POD_NAMESPACE)/ingress-nginx-controller
- --election-id=ingress-controller-leader
- --ingress-class=nginx
- --configmap=$(POD_NAMESPACE)/ingress-nginx-controller
... # curl 175.63.100.112
404 page not found get default-http-backend pod log 2021/09/29 09:16:18 format not specified. Using text/html
2021/09/29 09:16:18 unexpected error reading return code: strconv.Atoi: parsing "": invalid syntax. Using 404
2021/09/29 09:16:18 unexpected error opening file: open /www/404.html: no such file or directory
2021/09/29 09:16:18 unexpected error opening file: open /www/4xx.html: no such file or directory
2021/09/29 09:16:18 http: superfluous response.WriteHeader call from main.errorHandler.func1 (main.go:164) rebuild docker image from https://github.com/learn0208/ingress-nginx/blob/main/images/custom-error-pages/rootfs/Dockerfile as defaultbackend:bugfix # kubectl set image deployment/default-http-backend default-http-backend:defaultbackend:bugfix
# curl 175.63.100.112
<span>The page you're looking for could not be found.</span> |
The change is text in response. In my opinion this is not a improvement for most use cases or most users. Also since users can change attributes like image, there is no compelling reason to approve this PR. |
add images |
@longwuyuan maybe I got you wrong here, but no, it's not just a change in the response text. Thing is, that the docker image (without PR) misses the The PR just copies the provided But that is not even all: the PR is incomplete (this also goes to @learn0208): |
/ok-to-test |
cycling back to this. I understand the need but do we, in any case in nginx.tmpl refer to the /www as the custom error pages? (checking here, but let me know if you already know the answer) |
/lgtm We are clearly missing those files inside custom-errors containers. We should probably bump now the image to a new version and promote it, feel free to ping us on #ingress-nginx-dev in Slack (me, @strongjz , @longwuyuan, etc) to know how to proceed next. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: learn0208, rikatz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
#15 pushing manifest for gcr.io/k8s-staging-ingress-nginx/nginx-errors:v20211223-helm-chart-4.0.13-19-g8e9bf7f62@sha256:1d69f28d6412b0f2a6302f9df9a6bc49e83703336a35f95ab109cad10e039120 is the manifest of this one and needs promotion |
Still misses |
Can you add it via a new PR? Thanks! |
Oh I completely missed that request, thanks @lucasfcnunes for taking on. |
What this PR does / why we need it:
Types of changes
Which issue/s this PR fixes
HttpCode error, page not found.
How Has This Been Tested?
Checklist: