Skip to content

Conversation

ivankatliarchuk
Copy link
Contributor

@ivankatliarchuk ivankatliarchuk commented Aug 17, 2025

What does it do ?

  • instead of making API calls for every istio gateway to fetch ingress objects, use informers with caching

follow-up:

  • add ingress transfomers to reduce memory footprint
  • when sources configured for --istio-gateway and --istio-virtualservice, we fetching same endpoints twice here
    func (sc *gatewaySource) targetsFromIngress(ctx context.Context, ingressStr string, gateway *networkingv1beta1.Gateway) (endpoint.Targets, error) {
    and here
    func (sc *virtualServiceSource) targetsFromIngress(ctx context.Context, ingressStr string, gateway *v1beta1.Gateway) (endpoint.Targets, error) {
    plus then we need a deduplicate logic to kickoff as well. In follow-up PR (most likely in next release, as istio has quite few changes already), I'll remove requirement for an ingress fetching when flag --istio-virtualservice present, as the logic is duplicated.

Motivation

More

  • Yes, this PR title follows Conventional Commits
  • Yes, I added unit tests
  • Yes, I updated end user documentation accordingly

@k8s-ci-robot k8s-ci-robot added chart cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. source labels Aug 17, 2025
@ivankatliarchuk ivankatliarchuk marked this pull request as draft August 17, 2025 09:35
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 17, 2025
@ivankatliarchuk ivankatliarchuk marked this pull request as ready for review August 17, 2025 09:43
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 17, 2025
@ivankatliarchuk ivankatliarchuk changed the title chore(source/istio): ingress to use informers instead of kube API calls chore(source/istio): replace kube API calls with ingress informers Aug 17, 2025
@ivankatliarchuk ivankatliarchuk changed the title chore(source/istio): replace kube API calls with ingress informers chore(source/istio): replace kube API calls with caching and ingress informers Aug 17, 2025
Comment on lines 149 to 151
This is a common setup in modern cloud environments, like on GCP's Service Mesh, where a Kubernetes Ingress directs all public traffic to the Istio Gateway.

Is used to address a specific architectural pattern:
Copy link
Collaborator

@mloiseleur mloiseleur Aug 18, 2025

Choose a reason for hiding this comment

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

Suggested change
This is a common setup in modern cloud environments, like on GCP's Service Mesh, where a Kubernetes Ingress directs all public traffic to the Istio Gateway.
Is used to address a specific architectural pattern:
It can be used to address a specific architectural pattern, when a Kubernetes Ingress directs all public traffic to the Istio Gateway:

@stevehipwell
Copy link
Contributor

@ivankatliarchuk the Helm test changes look good, if you want to add them to a seperate PR I'm happy to approve them and reduce the size of this PR?

RE the duplicate calls were you thinking of adding something like a singleflight wrapper?

@ivankatliarchuk
Copy link
Contributor Author

Moved helm tests to a separate PR

Comment on lines 51 to 53
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like a new annotation to me, a new feature, not directly related a "replace kube API calls with caching and ingress informers".

Wdyt of moving the code and documentation of this new feature into a separate PR ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do. This is not a new annotations, it was added here #3842

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved out documentation

@k8s-ci-robot k8s-ci-robot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 19, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 19, 2025
Copy link
Collaborator

@mloiseleur mloiseleur left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 19, 2025
@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 Aug 19, 2025
@k8s-ci-robot k8s-ci-robot merged commit 22c709b into kubernetes-sigs:master Aug 19, 2025
15 checks passed
@ivankatliarchuk ivankatliarchuk deleted the chore-istio-ingress branch August 20, 2025 08:22
troll-os pushed a commit to FiligranHQ/external-dns that referenced this pull request Aug 28, 2025
…informers (kubernetes-sigs#5743)

* chore(source/istio): ingress to use informers instead of kube API calls

Signed-off-by: ivan katliarchuk <[email protected]>

* chore(source/istio): ingress to use informers instead of kube API calls

Signed-off-by: ivan katliarchuk <[email protected]>

* chore(source/istio): ingress to use informers instead of kube API calls

Signed-off-by: ivan katliarchuk <[email protected]>

* chore(source/istio): ingress to use informers instead of kube API calls

Signed-off-by: ivan katliarchuk <[email protected]>

* chore(source/istio): ingress to use informers instead of kube API calls

Signed-off-by: ivan katliarchuk <[email protected]>

* chore(source/istio): ingress to use informers instead of kube API calls

Signed-off-by: ivan katliarchuk <[email protected]>

---------

Signed-off-by: ivan katliarchuk <[email protected]>
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. chart cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. docs lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants