Open adrianmoisey opened 1 year 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.
/remove-kind bug
Does this seem like your use case https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/#wildcard-ingresses
I don't think so. We do use the --metrics-per-host=false
option
The particular tag we're worried about is service
, which is the backend service that is bring routed to, not the host
Can you test with /test as a specific path and see if the issue is the same? There may be an issue with pathType and the same path, /, the controller may not be differianating them.
Also can you try this in the latest relase, 1.8.1?
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.
Can you test with /test as a specific path and see if the issue is the same? There may be an issue with pathType and the same path, /, the controller may not be differianating them.
Adding a /test path that is an exact match works as expected. I think the problem is exactly as you say, the controller isn't differentiating between them.
Also can you try this in the latest relase, 1.8.1?
I've tested with 1.10.0 and still get this issue
I think I understand what is happening here. I plan to submit a PR if that is fine with you
/assign
What happened:
When defining two backends, as such:
We only get metrics for the
service-a
backend.What you expected to happen:
To be able to get metrics for each backend.
NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.):
Kubernetes version (use
kubectl version
):Environment:
Cloud provider or hardware configuration: AWS (via kOps)
OS (e.g. from /etc/os-release): Ubuntu 20.04.5 LTS
Kernel (e.g.
uname -a
): 5.15.0-1031-awsInstall tools: kOps
Please mention how/where was the cluster created like kubeadm/kops/minikube/kind etc.
Basic cluster related info:
kubectl version
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.8", GitCommit:"0ce7342c984110dfc93657d64df5dc3b2c0d1fe9", GitTreeState:"clean", BuildDate:"2023-03-15T13:33:02Z", GoVersion:"go1.19.7", Compiler:"gc", Platform:"linux/amd64"}kubectl get nodes -o wide
Ubuntu 20.04.5 LTS 5.15.0-1031-aws containerd://1.6.18How was the ingress-nginx-controller installed: Installed via Helm using ArgoCD
Current State of the controller: Controller is running and working as expected, except for this metric
Current state of ingress object, if applicable: All Ingress objects are fine and the controller handles requests fine.
How to reproduce this issue: Create an ingress object with multiple
/
paths, of different types. Send traffic to both matches/
and/test
. Look at resulting metrics.Anything else we need to know:
I looked at the resulting configuration and compared them to see if I can find the issue. This seems to highlight the bug:
This config is fine, except that
set $service_name
is the same in both.It seems that the problem is happening around here:
Which I think comes from https://github.com/kubernetes/ingress-nginx/blob/controller-v1.3.0/internal/ingress/controller/template/template.go#L1061-L1149
I think the expected diff is as such: