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

add support for svc backend #1363

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tanujd11
Copy link

Adds LoadBalancer service as part of the backend for K8GB. Relate Issue is: #147

HOW TO RUN CI ---

By default, all the checks will be run automatically. Furthermore, when changing website-related stuff, the preview will be generated by the netlify bot.

Heavy tests

Add the heavy-tests label on this PR if you want full-blown tests that include more than 2-cluster scenarios.

Debug tests

If the test suite is failing for you, you may want to try triggering Re-run all jobs (top right) with debug logging enabled. It will also make the print debug action more verbose.

Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

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

It is exciting, thanks a lot for your contribution!

Can you please add

Thanks!

Copy link
Member

@jkremser jkremser left a comment

Choose a reason for hiding this comment

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

👍

}

if gslb.Spec.LoadBalancer != nil {
localTargets, err = r.DNSProvider.GslbServiceExposedIPs(gslb)
Copy link
Member

@jkremser jkremser Dec 21, 2023

Choose a reason for hiding this comment

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

this way, if both gslb.spec.loadBalancer and gslb.spec.ingress are specified in the CR, then the localTargets will be obtained using the LB section only (the last will win). I am not sure how it should be designed, to be honest. Does it actually make sense that gslb CR is backed by both at once? If not we could implement the x-kubernetes-validations to catch this during resource admission, otherwise I'd go with simple if - else if here for now.

Copy link
Author

Choose a reason for hiding this comment

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

yeah, I think adding a validation for it is better so that both can't be specified. It is a cleaner and better approach then making some blunders while missing some case in if - else approach. It is better to be clear at the start of the implementation and state that both can't be used at once. WDYT?

Copy link
Member

Choose a reason for hiding this comment

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

makes sense to me. Would you mind exploring those x-kubernetes-validations? There should be an annotation for kubebuilder for that (link)

something like

// +kubebuilder:validation:XValidation:rule=( has(self.loadBalancer) && !has(self. ingress) ) || ( !has(self.loadBalancer) && has(self. ingress) )

@ytsarev
Copy link
Member

ytsarev commented Apr 17, 2024

Hi @tanujd11! Thank you so much for your contribution! Do you plan to finalize this PR? If not, please let us know, so we can takeover 👍

@ytsarev
Copy link
Member

ytsarev commented Jul 2, 2024

Hi @tanujd11 , do you want to update this PR after we got #1557 implemented? Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants