-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add istio-virtualservice source #1358
Add istio-virtualservice source #1358
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: devkid The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
7613f95
to
89da89e
Compare
Amazing, lets get this merged fast :) |
/assign @hjacobs Please also see the description of the PR regarding the changes for istio Gateways. |
@devkid please one more rebase and sorry about that but I'm currently looking through a lot of PR's, which might take some time 🙏 . |
@devkid If it's taking long to merge this, is there a docker image for your code where I can test this feature? |
@a8j8i8t8 I'll rebase this week and probably revert the changes regarding the gateway again - I don't really want to introduce a breaking change with this PR. You can just build a docker image from my branch to test this (would be appreciated by the way 😉). |
I'm so glad that this exists. We are now facing issues with wildcard certificate and need this one to get closed soon. :-D Fingers crossed. :) |
docs/tutorials/istio.md
Outdated
@@ -27,7 +27,8 @@ spec: | |||
args: | |||
- --source=service | |||
- --source=ingress | |||
- --source=istio-gateway | |||
- --source=istio-gateway # chose on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one
@devkid
Recods in Route53 are not changed and app throw out a warning that says this: |
@TomasKohout Did you adjust the RBAC permissions for external-dns to allow access to Istio |
@devkid Somehow it's not working for me :-(
I'm getting below log for my virtualservice.
Any help will be appreciated. |
I haven't. It's working out of the box for gateways. |
@TomasKohout can you share the manifest of the
Do you mean you didn't adjust the RBAC permissions to allow access to @a8j8i8t8 Can you share the manifest of your |
@devkid I'll share it in a bit. But is it required to have
|
@a8j8i8t8 With the current implementation, it is required to have the apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: kubernetes-dashboard
spec:
gateways:
- <namespace of gateway>/<name of gateway>
# ... Also, the |
08533e7
to
44d0e81
Compare
I have rebased now, but I would still like to revert my changes to the gateway source before merging this. I'll let you know @njuettner, most likely next week. |
Hi, I'll have futher a look on a Monday. :-) |
44d0e81
to
d438945
Compare
Hmmmm, I don't remember exactly. Now that you mention it, it might be that I added this manually on my end as well. That would be an explanation on why it wasn't working for others. I was using version 1.4.0 but according to Do you folks / maintainers have an opinion on this change of label selector behavior? Currently the mapping
Yet another option would be to get all pods that match the As for the (new) restriction that now a |
@devkid I added the following snippets to identify matching gateway-service selectors which works fine:
The
In our case we deployed istio using helm so the gateway has the selector |
I assume this could work. It would only match services whose selector is at least as restrictive as the gateway selector, therefor this would ensure that no unwanted pods / services are selected by external-dns. |
Yep, I was going to open a PR based on your work as this was stale and we needed this but I'm happy if you incorporate this in here 👍 I also added tests for it and did some other minor changes, let me know if I should send you the patch for it. |
… and VirtualService sources; match all services using a selector at least as restrictive as the Gateway selector
be314cb
to
dd8c5eb
Compare
@elsesiy I incorporated your snipped 👍 Could you open a PR to merge your changes into my branch? |
I've been following this PR and find one scenario it doesn't address - An Istio VirtualService using an ALB provisioned by the aws-alb-ingress-controller. In this case, the Service is generally a NodePort and thus doesn't track the LB endpoint (and if provisioned as a LoadBalancer the external-ip never resolves); only the Ingress itself has these attributes. Is this a use case that should be targeted here? I'm currently addressing this with a modified version of the previous release; haven't yet attempted to rebase the targetsFromGatewayConfig changes yet. |
@ophelan We have essentially the same setup. You would need to create a DNS name for your ingress and can then put an What we could also implement: adding an annotation to the gateway to refer to a specific service or ingress and extract the LB status from them (instead of all the guesswork). |
@ophelan You could check out if this would be useful for you (feedback wanted): https://github.com/LogMeIn/external-dns/compare/feature/istio-virtualservice-source...LogMeIn:feature/istio-virtualservice-source-with-target-from?expand=1 |
@a8j8i8t8 @TomasKohout could you please check if the fixes on this branch work for your setup now? |
Hi, I'm sorry for late reply, but I don't have a capacity to do that. :( |
@devkid I had a chance to give your gateway annotation patch a try. In NewIstioVirtualServiceSource, the ingressInformer initialization process is missing the cache population wait, but after adding that it appears to work perfectly for my simple test cases. Will play with a bit more extensively tomorrow. |
@devkid: PR needs rebase. 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/test-infra repository. |
@devkid Would you be able to rebase this? |
Hey all. I've created a rebased version of this PR #1607 We are now using a much newer version of kubernetes and istio client-go (as opposed to dependening on the main istio repo) |
Would love to have support for virtual services. Testet it and looks good already. Hopefully it's merged soon. |
This adds a source for istio
VirtualService
s. DNS names are given via thehosts
field in theVirtualService
, the target for the DNS record is extracted from the associated istioGateway
.Note: This also changes the behavior of istio
Gateways
:Service
corresponding to the gateway by searching forServices
which have the same selector as theGateway
; previously it used theGateway
selector to query for services directly via label selector; I did this change because theGateway
selector selectsPod
s, notService
sService
s in the same namespace as theGateway
; while it is actually possible to useGateway
s to configure ingress gateway pods in other namespace, this is contrary to what's written in the documentation; I opened up a bug report for this here: Selector of Gateway custom resource is not bound by namespace istio/istio#19970I did these changes because I had to touch a bit of the code for the gateway source anyways. Let me know if this is out of scope and I should create a separate PR for this.
This closes #1340.