-
Notifications
You must be signed in to change notification settings - Fork 494
OCPBUGS-77856: fix: use NodePort for HCP router Service on non-cloud platforms #8439
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,7 +64,14 @@ func ReconcileRouterService(svc *corev1.Service, internal, crossZoneLoadBalancin | |
| for k, v := range hcpRouterLabels() { | ||
| svc.Labels[k] = v | ||
| } | ||
| svc.Spec.Type = corev1.ServiceTypeLoadBalancer | ||
| if svc.Spec.Type == "" { | ||
| switch hcp.Spec.Platform.Type { | ||
| case hyperv1.AgentPlatform, hyperv1.KubevirtPlatform, hyperv1.NonePlatform: | ||
| svc.Spec.Type = corev1.ServiceTypeNodePort | ||
| default: | ||
| svc.Spec.Type = corev1.ServiceTypeLoadBalancer | ||
| } | ||
| } | ||
| svc.Spec.Selector = hcpRouterLabels() | ||
| foundHTTPS := false | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Small thing — now that some services will be NodePort,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for highlighting this, I have made the changes as per suggestion. |
||
|
|
@@ -89,7 +96,7 @@ func ReconcileRouterService(svc *corev1.Service, internal, crossZoneLoadBalancin | |
| // Apply LoadBalancerSourceRanges for external router services to restrict CIDR access | ||
| // Only apply for external (non-internal) services and when not running on ARO HCP | ||
| allowedCIDRBlocks := netutil.AllowedCIDRBlocks(hcp) | ||
| if !internal && !azureutil.IsAroHCP() { | ||
| if !internal && !azureutil.IsAroHCP() && svc.Spec.Type == corev1.ServiceTypeLoadBalancer { | ||
| svc.Spec.LoadBalancerSourceRanges = allowedCIDRBlocks | ||
| } | ||
|
|
||
|
|
||
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.
This doesn't seem right. The host will not be reachable from outside the mgmt cluster. It seems we would need to either use the node ip of where the router pod is running or an external name that the user specifies (for which we don't have a spot in the API)