application-gateway-kubernetes-ingress icon indicating copy to clipboard operation
application-gateway-kubernetes-ingress copied to clipboard

Implementing rule-priority annotation. #1268

Open cmendible opened this issue 3 years ago • 12 comments
trafficstars

Checklist

  • [x] The title of the PR is clear and informative
  • [ ] If applicable, the changes made in the PR have proper test coverage
  • [x] Issues addressed by the PR are mentioned in the description followed by Fixes.

Description

Enables Request Routing Rule Priority support through the new appgw.ingress.kubernetes.io/rule-priority annotation.

Have not created tests yet, because first I want to get feedback about the current implementation.

Fixes

#1268

cmendible avatar Feb 11 '22 10:02 cmendible

what happens if two ingresses have same priority?

akshaysngupta avatar Feb 15 '22 06:02 akshaysngupta

what happens if two ingresses have same priority?

Missed that one! I added the check for that case in getListenerPriorities --> 27dfb60

cmendible avatar Feb 15 '22 07:02 cmendible

get this committed, without priority settings for basic HTTP and HTTPs listeners that routing will behave erratically, based on the configuration order as submitted to ARM.

If priority is enabled on 1 listener, priority must also be defined on all other listeners

ghost avatar Apr 22 '22 19:04 ghost

go vet is failing here:

cmd/appgw-ingress/main.go:228:2: misuse of unbuffered os.Signal channel as argument to signal.Notify

which is note related to this PR code.

cmendible avatar Apr 23 '22 07:04 cmendible

Any ETA on when we can expect this?

sgerace avatar May 20 '22 17:05 sgerace

Please note that this also resolves #884.

sgerace avatar May 31 '22 14:05 sgerace

This change is currently blocking us from implementing AGIC for our product. Is it correct to assume this is just stuck waiting for a code review?

christiaanderidder avatar Jun 20 '22 10:06 christiaanderidder

I'm stuck here too, I have a route /api*, /ws* and a default /, only the default works

ricardomomm avatar Jun 23 '22 16:06 ricardomomm

@akshaysngupta can you take a look at this one?

Thanks!

cmendible avatar Jul 04 '22 08:07 cmendible

I'm stuck here too, I have a route /api*, /ws* and a default /, only the default works

Have you looked at this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: go-server-ingress-affinity
  namespace: test-ag
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/cookie-based-affinity: "true"
    appgw.ingress.kubernetes.io/cookie-based-affinity-distinct-name: "true"
spec:
  rules:
  - http:
      paths:
      - path: /affinity1/
        pathType: Exact
        backend:
          service:
            name: affinity-service
            port:
              number: 80
      - path: /affinity2/
        pathType: Exact
        backend:
          service:
            name: affinity-service
            port:
              number: 80

From : https://azure.github.io/application-gateway-kubernetes-ingress/annotations/#backend-path-prefix

naioja avatar Jul 04 '22 13:07 naioja

I'm stuck here too, I have a route /api*, /ws* and a default /, only the default works

Have you looked at this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: go-server-ingress-affinity
  namespace: test-ag
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/cookie-based-affinity: "true"
    appgw.ingress.kubernetes.io/cookie-based-affinity-distinct-name: "true"
spec:
  rules:
  - http:
      paths:
      - path: /affinity1/
        pathType: Exact
        backend:
          service:
            name: affinity-service
            port:
              number: 80
      - path: /affinity2/
        pathType: Exact
        backend:
          service:
            name: affinity-service
            port:
              number: 80

From : https://azure.github.io/application-gateway-kubernetes-ingress/annotations/#backend-path-prefix

not sure how this can help me with the priority, all 3 routes that I have a in different ingresses, I manager to get it to work with the workaround provided in https://github.com/Azure/application-gateway-kubernetes-ingress/issues/884. But thanks anyway, my ws endpoint is signalR and I'll need affinity for redis scaleout

ricardomomm avatar Jul 04 '22 13:07 ricardomomm

I'm waiting for this annotation since it at least provide a workaround when using wildcast and exact host. and Prioritization by hashing is very confusing and can easily cause prod accidents.

foo.bar *.bar

2743d2 avatar Jul 19 '22 02:07 2743d2

When can we expect to see this change available?

rennerg avatar Dec 30 '22 19:12 rennerg

+1

When can we expect to see this change available?

ssrahul96 avatar Jan 09 '23 10:01 ssrahul96

+2

When can we expect to see this change available?

zgqit avatar Jan 09 '23 11:01 zgqit

When can we expect to see this change available?

manikg321 avatar Jan 09 '23 14:01 manikg321

@cmendible @akshaysngupta this feature is not compatible with appgw.ingress.kubernetes.io/ssl-redirect: "true" annotation because same priority is applied to http and https rule.

E0728 08:28:52.784935       1 controller.go:142] network.ApplicationGatewaysClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ApplicationGatewayRequestRoutingRulePriorityMustBeUnique" Message="Priority must be unique across all the request routing rules. Rules /subscriptions/123456789/resourceGroups/ReG_aks-some-cluster/providers/Microsoft.Network/applicationGateways/aks-some-cluster-app-gateway-1/requestRoutingRules/rr-51aea8d877768c8759ff3cda6ba516f4 and /subscriptions/123456789/resourceGroups/ReG_aks-some-cluster/providers/Microsoft.Network/applicationGateways/aks-some-cluster-app-gateway-1/requestRoutingRules/rr-9ffe3bf76fbc4d64f6671769450bcf69 cannot have the same priority 10000." Details=[]

maxarndt avatar Jul 28 '23 09:07 maxarndt

I'm not sure if the documentation is updated for this annotation. https://azure.github.io/application-gateway-kubernetes-ingress/annotations/

juanpgarces avatar Jan 23 '24 14:01 juanpgarces

@cmendible @akshaysngupta this feature is not compatible with appgw.ingress.kubernetes.io/ssl-redirect: "true" annotation because same priority is applied to http and https rule.

E0728 08:28:52.784935       1 controller.go:142] network.ApplicationGatewaysClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ApplicationGatewayRequestRoutingRulePriorityMustBeUnique" Message="Priority must be unique across all the request routing rules. Rules /subscriptions/123456789/resourceGroups/ReG_aks-some-cluster/providers/Microsoft.Network/applicationGateways/aks-some-cluster-app-gateway-1/requestRoutingRules/rr-51aea8d877768c8759ff3cda6ba516f4 and /subscriptions/123456789/resourceGroups/ReG_aks-some-cluster/providers/Microsoft.Network/applicationGateways/aks-some-cluster-app-gateway-1/requestRoutingRules/rr-9ffe3bf76fbc4d64f6671769450bcf69 cannot have the same priority 10000." Details=[]

@maxarndt Is this compatibility still a problem?

Laykou avatar Mar 26 '24 07:03 Laykou

@Laykou yes, it is:

E0326 09:00:49.636303       1 controller.go:142] network.ApplicationGatewaysClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ApplicationGatewayRequestRoutingRulePriorityMustBeUnique" Message="Priority must be unique across all the request routing rules. Rules /subscriptions/123456/resourceGroups/ReG_foo-bar/providers/Microsoft.Network/applicationGateways/foo-bar-app-gateway-1/requestRoutingRules/rr-51aea8d877768c8759ff3cda6ba516f4 and /subscriptions/123456/resourceGroups/ReG_foo-bar/providers/Microsoft.Network/applicationGateways/foo-bar-app-gateway-1/requestRoutingRules/rr-9ffe3bf76fbc4d64f6671769450bcf69 cannot have the same priority 10000." Details=[]
E0326 09:00:49.636316       1 worker.go:62] Error processing event.network.ApplicationGatewaysClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="ApplicationGatewayRequestRoutingRulePriorityMustBeUnique" Message="Priority must be unique across all the request routing rules. Rules /subscriptions/123456/resourceGroups/ReG_foo-bar/providers/Microsoft.Network/applicationGateways/foo-bar-app-gateway-1/requestRoutingRules/rr-51aea8d877768c8759ff3cda6ba516f4 and /subscriptions/123456/resourceGroups/ReG_foo-bar/providers/Microsoft.Network/applicationGateways/foo-bar-app-gateway-1/requestRoutingRules/rr-9ffe3bf76fbc4d64f6671769450bcf69 cannot have the same priority 10000." Details=[]

Currently we run v1.7.2 of this component. The latest version v1.7.3 does not seem to address this issue.

maxarndt avatar Mar 26 '24 09:03 maxarndt

I found this open issue already https://github.com/Azure/application-gateway-kubernetes-ingress/issues/1515 so we can move the further discussion there

Laykou avatar Mar 26 '24 14:03 Laykou