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

After updating k8s ingress(backend) multiple times, the EventUpdate event always exists and cannot end #1027

Closed
hahayyum opened this issue May 19, 2022 · 6 comments · Fixed by #1040
Assignees
Labels
area/controller triage/accepted Indicates an issue or PR is ready to be actively worked on.
Milestone

Comments

@hahayyum
Copy link
Contributor

hahayyum commented May 19, 2022

Issue description

Ingress:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: apisix
  name: ccdd
  namespace: 3-default-ns
spec:
  rules:
    - http:
        paths:
          - backend:
              serviceName: deployment-lerxr7
              servicePort: 16629
            path: /adc
            pathType: Prefix
          - backend:
              serviceName: deployment-lerxr7
              servicePort: 18889
            path: /dede
            pathType: Prefix

first update:

16629->16639 , Port 16639 is not configured in the actual service
erro info: failed to translate ingress {"event": "update", "error": "service.spec.ports: port not defined", "ingress": {}}
The first update event keeps looping
code:
ing, err = c.controller.ingressLister.V1beta1(namespace, name)
..........
tctx, err := c.controller.translator.TranslateIngress(ing) ---Check the latest ingress

second update
16639->16629
erro info: failed to translate ingress {"event": "update", "error": "service.spec.ports: port not defined", "ingress": {}}
End of first update event. The second update event keeps looping
code
oldCtx, err := c.controller.translator.TranslateIngress(ingEv.OldObject) --Always verify old ingress

I think in the update event, there is no need to verify the backend.service in the old ingress, or just delete it if there is a problem (du)

Environment

k8s: 1.19.6
apisix: 2.7
apisix-ingress-controller: 1.2.0

Minimal test code / Steps to reproduce

see description

Actual result

see description

Error log

see description

Expected result

When the port is re-updated correctly, the second update event ends

@tao12345666333
Copy link
Member

apisix-ingress-controller: 1.2.0 is too old, please upgrade to latest version v1.4.1.

In the new version, some invalid events will be removed from the work queue.

@hahayyum
Copy link
Contributor Author

@tao12345666333
After verification, the latest 1.4.1 version problem still exists
The relevant code logic has not been modified

error info 1:
ingress/ingress.go:131 failed to translate ingress {"error": "service.spec.ports: port not defined", "ingress": {}}

error info 2:
ingress/ingress.go:166 failed to translate ingress {"event": "update", "error": "service.spec.ports: port not defined", "ingress": {}}

@tao12345666333
Copy link
Member

sorry i remembered wrong.

There was some handling in #893, but it wasn't introduced in v1.4.1.
Can you test with the latest code from the master branch?

@hahayyum
Copy link
Contributor Author

@tao12345666333
After verification, the master version problem still exists.
Can I try to fix it?

@tao12345666333
Copy link
Member

@hahayyum yes, please! Assigned to you

Thanks

@tao12345666333
Copy link
Member

#1040 has been merged. I will close this one. Thanks

@tao12345666333 tao12345666333 added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jun 29, 2022
@tao12345666333 tao12345666333 added this to the 1.5.0 milestone Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
2 participants