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 a firewall rule to open the LB health check and service port(s) when using service.beta.kubernetes.io/do-loadbalancer-type=REGIONAL_NETWORK #748

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

bbassingthwaite
Copy link
Contributor

@bbassingthwaite bbassingthwaite commented Jul 26, 2024

Since NLB will route traffic over the public interface for both the LB data plane and health checks, we will need to open the appropriate health check port. This change only affects LBs who set the annotation service.beta.kubernetes.io/do-loadbalancer-type=REGIONAL_NETWORK and the network is EXTERNAL (default).

…ice.beta.kubernetes.io/do-loadbalancer-type=REGIONAL_NETWORK`
} else if svc.Spec.Type == v1.ServiceTypeLoadBalancer {
lbType, err := getType(svc)
if err != nil {
return nil, err
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add fmt.Errorf() around err to provide context, specifically the name of the Service affected?

Similar for the error returned in line 323.

fwReq, err := fm.createReconciledFirewallRequest(test.serviceList)

if (err != nil && test.expectedError == nil) || (err == nil && test.expectedError != nil) {
t.Errorf("incorrect firewall config\nwant: %#v\n got: %#v", test.expectedError, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably say

t.Fatalf("expected error %q, got %q", test.expectedError, err)

timoreimann
timoreimann previously approved these changes Jul 26, 2024
var nodePortInboundRules []godo.InboundRule
healthCheckPorts := make(map[int]struct{})
for _, svc := range serviceList {
managed, err := isManaged(svc)
Copy link
Contributor

Choose a reason for hiding this comment

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

We may need to scope the non-management restriction down to the NodePort logic while continuing to reconcile ports for NLBs.

Withdrawing approval for now so that we don't forget.

@timoreimann timoreimann dismissed their stale review July 26, 2024 19:54

annotation to disable firewall management may still need re-scoping

@bbassingthwaite bbassingthwaite changed the title Add a firewall rule to open the LB health check port when using service.beta.kubernetes.io/do-loadbalancer-type=REGIONAL_NETWORK Add a firewall rule to open the LB health check and service port(s) when using service.beta.kubernetes.io/do-loadbalancer-type=REGIONAL_NETWORK Jul 26, 2024
@timoreimann timoreimann merged commit 59b7b06 into master Jul 26, 2024
3 checks passed
@timoreimann timoreimann deleted the bbass/LBAAS-3367/fw branch July 26, 2024 20:21
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