kubernetes / ingress-nginx

Ingress-NGINX Controller for Kubernetes
https://kubernetes.github.io/ingress-nginx/
Apache License 2.0
16.91k stars 8.14k forks source link

AWS nginx-ingress-controller context error #11489

Open psp123123 opened 1 week ago

psp123123 commented 1 week ago

Bug Report

resource URL:https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.1/deploy/static/provider/aws/nlb-with-tls-termination/deploy.yaml

What happened:

A clear and concise description of what the bug is.

In the documentation, the configuration example for ingress-nginx controller ports includes two containerPort entries set to 80, which causes a port conflict error:

ports:
  - containerPort: 80
    name: http
    protocol: TCP
  - containerPort: 80
    name: https
    protocol: TCP
  - containerPort: 2443
    name: tohttps
    protocol: TCP
  - containerPort: 8443
    name: webhook
    protocol: TCP

What you expected to happen: The https service should be configured to use port 443 to avoid a port conflict with the http service.

How to reproduce it (as minimally and precisely as possible): Follow the documentation to set up ingress-nginx controller using the provided configuration. Deploy the configuration in a Kubernetes cluster. Observe the pod creation failure due to port conflict. Anything else we need to know?: No additional information.

Environment: Kubernetes version (use kubectl version): v1.21.0 Ingress-NGINX version: 0.47.0 Cloud provider or hardware configuration: GKE OS (e.g: cat /etc/os-release): Ubuntu 20.04 Suggested Fix: Update the documentation to correctly set the https service to use port 443:

yaml

ports:
  - containerPort: 80
    name: http
    protocol: TCP
  - containerPort: 443
    name: https
    protocol: TCP
  - containerPort: 2443
    name: tohttps
    protocol: TCP
  - containerPort: 8443
    name: webhook
    protocol: TCP

This will ensure the https service is correctly configured and avoids port conflict.

k8s-ci-robot commented 1 week ago

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository.
longwuyuan commented 1 week ago

@psp123123 the template of a new bug report here asks several questions and you have not answered them. So its hard to understand the small important details of the issue you are reporting. Very recently I have tested the manifest you linked and it worked for that other user.

The manifest you linked is for the use case of terminating TLS on the NLB instead of on the controller. In that use case the traffic is not HTTPS for LB to backend.

If you want to talk more about this, then first edit the issue and answer the questions that are visible in the template of a new bug report. Include

That will help readers analyse the data you post and make comments based on data

/remove-kind bug /kind support /triage needs-information

psp123123 commented 1 week ago

Okay, here's my issue. I might not have described it clearly. When I'm deploying the Nginx Ingress controller on EKS, after modifying the template file from this link with my required information, I encounter an error during the apply phase:

image

Although it's not an error since Kubernetes ignores it and generates a warning, I'm not sure what impact it will have in practice if both configurations are using port 80.

psp123123 commented 1 week ago

this is the context

image
psp123123 commented 1 week ago
image

my cluster is normal on AWS-EKS