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 flag to support ClusterIP exposed CoreDNS #1788

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

Conversation

bewing
Copy link

@bewing bewing commented Dec 10, 2024

Some environments (Calico bare-metal, etc) may allow direct client reachability to the Service CIDR, bypassing the need to assign and use LoadBalancerIPs. A new config flag and environment variable allows selection/return of the ClusterIPs in the assistant rather than externally assigned LoadBalancer IPs.

Some environments (Calico bare-metal, etc) may allow direct client
reachability to the Service CIDR, bypassing the need to assign and use
LoadBalancerIPs.  A new config flag and environment variable allows
selection/return of the ClusterIPs in the assistant rather than
externally assigned LoadBalancer IPs.

Signed-off-by: Brandon Ewing <[email protected]>
Copy link
Collaborator

@abaguas abaguas left a comment

Choose a reason for hiding this comment

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

We can simplify the configuration to the users by not adding a new flag. Setting the CoreDNSExposed flag to true is enough.
A service only has one type so we dynamically check if the service is of type LoadBalancer or ClusterIP. Then we can extend logic of the CoreDNSExposedIPs function to fetch the IP addresses depending on the type.

@@ -58,8 +58,7 @@ func NewGslbAssistant(client client.Client, k8gbNamespace string, edgeDNSServers
}
}

// CoreDNSExposedIPs retrieves list of IP's exposed by CoreDNS
func (r *Gslb) CoreDNSExposedIPs() ([]string, error) {
func (r *Gslb) GetCoreDNSService() (*corev1.Service, error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this separation of responsibilities. One function to fetch the service and another one to fetch the IP address

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.

2 participants