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

fix: use informer for istio gateways #4522

Merged

Conversation

woehrl01
Copy link
Contributor

@woehrl01 woehrl01 commented Jun 3, 2024

Description

This PR changes to use an informer instead of direct api calls to read the gateway config. This solves a API ratelimit error on our setup and removes stress on the Kubernetes API

Following this change the tests needed to be updated:

  • An informer needs a Namespaces, thats why it is set
  • An informer never returns an error during the get call except for NotExisting. So this test is removed.

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot requested review from johngmyers and szuecs June 3, 2024 09:43
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 3, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @woehrl01. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 3, 2024
@woehrl01 woehrl01 force-pushed the informer-gateways branch from d477f90 to b5f145f Compare June 3, 2024 09:43
@woehrl01 woehrl01 force-pushed the informer-gateways branch from b5f145f to 25eac69 Compare June 3, 2024 09:44
@woehrl01
Copy link
Contributor Author

woehrl01 commented Jun 4, 2024

/assign szuecs

Comment on lines +102 to +108
gatewayInformer.Informer().AddEventHandler(
cache.ResourceEventHandlerFuncs{
AddFunc: func(obj interface{}) {
log.Debug("gateway added")
},
},
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to either remove this log or provide a more detailed debug log.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, should I also change the other informers? I just replicated the other ones. I suggest removing all of them. Wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mloiseleur the eventhandler is needed because of the following behaviour on the go-client: kubernetes/client-go#382, see also the comment above the first informer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks.

@mloiseleur
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 11, 2024
@mloiseleur
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 27, 2024
@woehrl01
Copy link
Contributor Author

@mloiseleur do you have any updates on this? It seems like the "approved" label is missing here. Anything I can do about this?

@mloiseleur
Copy link
Contributor

mloiseleur commented Aug 27, 2024

A maintainer will review it when he has time for final approval.

The istio provider will move away from the tree, anyway. We have started the process to move the providers out of tree.

@woehrl01
Copy link
Contributor Author

woehrl01 commented Sep 6, 2024

@mloiseleur Why should Istio support be moved out of tree? It's about discovering DNS entries inside the cluster (its a configurable source). It's not a DNS provider like the list you have linked.

@mloiseleur
Copy link
Contributor

Ah yes you're right.

@woehrl01
Copy link
Contributor Author

Any progress here? It this something which will be considered at all?

@mloiseleur
Copy link
Contributor

/unassign @szuecs
/assign @Raffo

@k8s-ci-robot k8s-ci-robot assigned Raffo and unassigned szuecs Dec 22, 2024
@mloiseleur mloiseleur removed their assignment Dec 22, 2024
@woehrl01
Copy link
Contributor Author

@Raffo can you please have a look at this PR? Because of this not having fixed, external-dns is by far the most talking service to the api server if you have lots of virtual services. Thank you!

@mloiseleur
Copy link
Contributor

@ivanfilippov @Dadeos-Menlo @AndrewCharlesHay Do you think one of you can review this PR ?

@Dadeos-Menlo
Copy link

/lgtm

@k8s-ci-robot
Copy link
Contributor

@Dadeos-Menlo: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@mloiseleur
Copy link
Contributor

@Dadeos-Menlo In order to lgtm, following official guide, you'll need to Open an issue against the kubernetes/org repo.

@mloiseleur
Copy link
Contributor

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mloiseleur

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2025
@k8s-ci-robot k8s-ci-robot merged commit ba98af8 into kubernetes-sigs:master Feb 14, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants