Repository: traefik/traefik (language: go)

Issue:
Incorrect name of router generated from Ingress
### Welcome!

- [X] Yes, I've searched similar issues on [GitHub](https://github.com/traefik/traefik/issues) and didn't find any.
- [X] Yes, I've searched similar issues on the [Traefik community forum](https://community.traefik.io) and didn't find any.

### What did you do?

Assume we have an Ingress as:

```yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: bar-name
  namespace: foo-namespace
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: web
spec:
  rules:
  - host: example.org
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: example
            port:
              name: http
```

Expected name of this router:
`foo-namespace-bar-name-example-org-example@kubernetes`.


### What did you see instead?

Actual name of this router in dashboard:
`bar-name-foo-namespace-example-org-example@kubernetes`.

The `name` and `namespace` are misplaced.

### What version of Traefik are you using?

Traefik: 2.8.0
Installed by Helm chart: traefik-10.24.0

### What is your environment & configuration?

```yaml
providers:
  kubernetesCRD:
    enabled: true
  kubernetesIngress:
    enabled: true
```


### If applicable, please paste the log output in DEBUG level

_No response_


Discussion / hints:

Fix patch:
diff --git a/pkg/provider/kubernetes/ingress/kubernetes.go b/pkg/provider/kubernetes/ingress/kubernetes.go
index 3f7011730d..5605f97b90 100644
--- a/pkg/provider/kubernetes/ingress/kubernetes.go
+++ b/pkg/provider/kubernetes/ingress/kubernetes.go
@@ -304,7 +304,7 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl
 				serviceName := provider.Normalize(ingress.Namespace + "-" + pa.Backend.Service.Name + "-" + portString)
 				conf.HTTP.Services[serviceName] = service
 
-				routerKey := strings.TrimPrefix(provider.Normalize(ingress.Name+"-"+ingress.Namespace+"-"+rule.Host+pa.Path), "-")
+				routerKey := strings.TrimPrefix(provider.Normalize(ingress.Namespace+"-"+ingress.Name+"-"+rule.Host+pa.Path), "-")
 				routers[routerKey] = append(routers[routerKey], loadRouter(rule, pa, rtConfig, serviceName))
 			}
 		}


Test patch:
diff --git a/integration/testdata/rawdata-ingress-label-selector.json b/integration/testdata/rawdata-ingress-label-selector.json
index 66d3b095ea..4978357145 100644
--- a/integration/testdata/rawdata-ingress-label-selector.json
+++ b/integration/testdata/rawdata-ingress-label-selector.json
@@ -28,7 +28,7 @@
 				"traefik"
 			]
 		},
-		"test-ingress-default-whoami-test-whoami@kubernetes": {
+		"default-test-ingress-whoami-test-whoami@kubernetes": {
 			"entryPoints": [
 				"web"
 			],
@@ -92,7 +92,7 @@
 			},
 			"status": "enabled",
 			"usedBy": [
-				"test-ingress-default-whoami-test-whoami@kubernetes"
+				"default-test-ingress-whoami-test-whoami@kubernetes"
 			],
 			"serverStatus": {
 				"http://10.42.0.2:80": "UP",
diff --git a/integration/testdata/rawdata-ingress.json b/integration/testdata/rawdata-ingress.json
index 920154fcc1..2943e4cbd0 100644
--- a/integration/testdata/rawdata-ingress.json
+++ b/integration/testdata/rawdata-ingress.json
@@ -28,29 +28,29 @@
 				"traefik"
 			]
 		},
-		"test-ingress-default-whoami-test-whoami@kubernetes": {
+		"default-test-ingress-https-whoami-test-https-whoami@kubernetes": {
 			"entryPoints": [
 				"web"
 			],
 			"service": "default-whoami-http",
-			"rule": "Host(`whoami.test`) \u0026\u0026 PathPrefix(`/whoami`)",
+			"rule": "Host(`whoami.test.https`) \u0026\u0026 PathPrefix(`/whoami`)",
 			"status": "enabled",
 			"using": [
 				"web"
 			]
 		},
-		"test-ingress-https-default-whoami-test-https-whoami@kubernetes": {
+		"default-test-ingress-whoami-test-whoami@kubernetes": {
 			"entryPoints": [
 				"web"
 			],
 			"service": "default-whoami-http",
-			"rule": "Host(`whoami.test.https`) \u0026\u0026 PathPrefix(`/whoami`)",
+			"rule": "Host(`whoami.test`) \u0026\u0026 PathPrefix(`/whoami`)",
 			"status": "enabled",
 			"using": [
 				"web"
 			]
 		},
-		"whoami-drop-route-default-whoami-test-drop-drop@kubernetes": {
+		"default-whoami-drop-route-whoami-test-drop-drop@kubernetes": {
 			"entryPoints": [
 				"web"
 			],
@@ -61,7 +61,7 @@
 				"web"
 			]
 		},
-		"whoami-keep-route-default-whoami-test-keep-keep@kubernetes": {
+		"default-whoami-keep-route-whoami-test-keep-keep@kubernetes": {
 			"entryPoints": [
 				"web"
 			],
@@ -125,8 +125,8 @@
 			},
 			"status": "enabled",
 			"usedBy": [
-				"whoami-drop-route-default-whoami-test-drop-drop@kubernetes",
-				"whoami-keep-route-default-whoami-test-keep-keep@kubernetes"
+				"default-whoami-drop-route-whoami-test-drop-drop@kubernetes",
+				"default-whoami-keep-route-whoami-test-keep-keep@kubernetes"
 			],
 			"serverStatus": {
 				"http://XXXX": "UP",
@@ -147,8 +147,8 @@
 			},
 			"status": "enabled",
 			"usedBy": [
-				"test-ingress-default-whoami-test-whoami@kubernetes",
-				"test-ingress-https-default-whoami-test-https-whoami@kubernetes"
+				"default-test-ingress-https-whoami-test-https-whoami@kubernetes",
+				"default-test-ingress-whoami-test-whoami@kubernetes"
 			],
 			"serverStatus": {
 				"http://10.42.0.10:80": "UP",
diff --git a/integration/testdata/rawdata-ingressclass.json b/integration/testdata/rawdata-ingressclass.json
index 53db99cef4..0944a7cffc 100644
--- a/integration/testdata/rawdata-ingressclass.json
+++ b/integration/testdata/rawdata-ingressclass.json
@@ -28,7 +28,7 @@
 				"traefik"
 			]
 		},
-		"whoami-keep-route-default-whoami-test-keep-keep@kubernetes": {
+		"default-whoami-keep-route-whoami-test-keep-keep@kubernetes": {
 			"entryPoints": [
 				"web"
 			],
@@ -92,7 +92,7 @@
 			},
 			"status": "enabled",
 			"usedBy": [
-				"whoami-keep-route-default-whoami-test-keep-keep@kubernetes"
+				"default-whoami-keep-route-whoami-test-keep-keep@kubernetes"
 			],
 			"serverStatus": {
 				"http://10.42.0.4:80": "UP",
diff --git a/pkg/provider/kubernetes/ingress/kubernetes_test.go b/pkg/provider/kubernetes/ingress/kubernetes_test.go
index 58d8226a98..c096578fcc 100644
--- a/pkg/provider/kubernetes/ingress/kubernetes_test.go
+++ b/pkg/provider/kubernetes/ingress/kubernetes_test.go
@@ -1696,7 +1696,7 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
 				HTTP: &dynamic.HTTPConfiguration{
 					Middlewares: map[string]*dynamic.Middleware{},
 					Routers: map[string]*dynamic.Router{
-						"example-com-testing-bar": {
+						"testing-example-com-bar": {
 							Rule:    "PathPrefix(`/bar`)",
 							Service: "testing-service-bar-8080",
 						},
@@ -1724,7 +1724,7 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
 				HTTP: &dynamic.HTTPConfiguration{
 					Middlewares: map[string]*dynamic.Middleware{},
 					Routers: map[string]*dynamic.Router{
-						"example-com-testing-foo": {
+						"testing-example-com-foo": {
 							Rule:    "PathPrefix(`/foo`)",
 							Service: "testing-service-foo-8080",
 						},