Open ahus1 opened 4 months ago
/triage accepted This is a similar to of 9030
Unfortunately, what is know is that the field "ingress.spec.defaultBackend"
is not working. Since this issue is about a spec further down in that field, we can conclude that the triage for this issue is accepted.
Because the flag "--default-backend-service"
passed to the controller works now, it can be considered a workaround.
There is some info in that other issue that the problem was caused by this PR https://github.com/kubernetes/ingress-nginx/pull/8825 . I will create a issue to explore reverting what that PR changed
@Gacko any comments
@rikatz @strongjz @tao12345666333 if it is as simple as reverting https://github.com/kubernetes/ingress-nginx/pull/8825, would you want to review/consider it
@harry1064 any comments
/retitle field ingress.spec.defaultBackend.service.port.number is broken
This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach #ingress-nginx-dev
on Kubernetes Slack.
i can't reproduce this in kind, this is my yaml:
apiVersion: v1
kind: Pod
metadata:
name: app
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- name: http
containerPort: 80
resources:
limits:
cpu: "0.1"
memory: "100Mi"
requests:
cpu: "0.1"
memory: "100Mi"
---
apiVersion: v1
kind: Service
metadata:
labels:
app: nginx
name: app
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: nginx
type: ClusterIP
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
labels:
app: nginx
name: app
spec:
defaultBackend:
service:
name: app
port:
number: 80
ingressClassName: nginx
rules:
- host: localhost
http:
paths:
- backend:
service:
name: app
port:
number: 80
path: /
pathType: Prefix
What happened:
I've set up Minikube with nginx ingress and ssl-passthrough. When I specify in the ingress the port name it works, but it doesn't work when specifying the port number.
What you expected to happen:
I expected specifying a port number in the Ingress would work as well.
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
Kubernetes version (use
kubectl version
):Environment: minikube version: v1.33.1
How to reproduce this issue:
Ingress that doesn't work (note that "port.number" is set)
Ingress that works (note that "port.name" is set):
Service
Configuration logged by Nginx. You'll see that in one of the configs the PassthroughBackends has set port 0 when it is broken, and a port 8443 when it works.