Skip to content
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

Ingresses in different namespaces with the same name are not differentiated #8

Open
zach-flaglerhealth opened this issue May 7, 2024 · 0 comments

Comments

@zach-flaglerhealth
Copy link

Our current deployment process has the ingress simply named {{app name}}-http-ingress, and since we have multiple namespaces ({{app name}}-{{environment}}), this is normally fine for most of our purposes.

We have two ingress controllers that each live in their own namespace.

However, the Dashboard's usage of namespace is the controller's namespace. In our case, that means the current "Controller Class" and "Namespace" options filter on essentially the same thing. The "Ingress" filter will then filter on just the name of the ingress (as it should!) but will end up pulling data from multiple namespaces.

My solution is that I added a new variable, exported_namespace (rough JSON definition):

{
	"datasource":
	{
		"type": "prometheus",
		"uid": "prometheus"
	},
	"definition": "label_values(exported_namespace)",
	"label": "Source Namespace",
	"name": "exported_namespace",
	"query":
	{
		"qryType": 1,
		"query": "label_values(exported_namespace)",
		"refId": "PrometheusVariableQueryEditor-VariableQuery"
	},
	"type": "query"
}

and then had to go through each of the other panels and add , exported_namespace=~"$exported_namespace" as part of the query for a given panel.

I may try cleaning it up a bit and submitting it as a PR. I also had to do the $__interval to $__rate_interval change as mentioned in #7 (comment).

Also, it does seem like the version at https://grafana.com/grafana/dashboards/14314-kubernetes-nginx-ingress-controller-nextgen-devops-nirvana/ is version 27, as opposed to this repo's version 29. Not sure what's up with that, but the warning on the Grafana page did help me find this updated one, so thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant