-
Notifications
You must be signed in to change notification settings - Fork 477
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
bugfix: set cluster-ip when mapping host to vCluster service #2331
base: main
Are you sure you want to change the base?
bugfix: set cluster-ip when mapping host to vCluster service #2331
Conversation
✅ Deploy Preview for vcluster-docs canceled.Built without sensitive environment variables
|
Hi @FabianKramm. Kindly review this PR and let me know if any changes are required. |
Ports: fromService.Spec.Ports, | ||
}, | ||
} | ||
|
||
// Check if ClusterIP is not "None" | ||
if fromService.Spec.ClusterIP != corev1.ClusterIPNone { | ||
toService.Spec.ClusterIP = fromService.Spec.ClusterIP | ||
} else { | ||
toService.Spec.ClusterIP = corev1.ClusterIPNone | ||
} |
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.
Thank you for this! I haven't had a moment to see if this is the correct fix for the issue, but since this conditional sets to service to none if from service is none, or the value of from service it should be the same as
Ports: fromService.Spec.Ports, | |
}, | |
} | |
// Check if ClusterIP is not "None" | |
if fromService.Spec.ClusterIP != corev1.ClusterIPNone { | |
toService.Spec.ClusterIP = fromService.Spec.ClusterIP | |
} else { | |
toService.Spec.ClusterIP = corev1.ClusterIPNone | |
} | |
Ports: fromService.Spec.Ports, | |
ClusterIP: fromService.Spec.ClusterIP, | |
}, | |
} |
What issue type does this pull request address? (keep at least one, remove the others)
/kind bugfix
What does this pull request do? Which issues does it resolve? (use
resolves #<issue_number>
if possible)resolves #1926. This pull request ensures that the Service cluster-ip is correctly set when mapping the host cluster service to the vCluster service.
Please provide a short message that should be published in the vcluster release notes
Fixed an issue where vCluster service mapping resulted in the Service cluster-ip being set to none.
What else do we need to know?
The service was initially appearing as a headless service due to the cluster-ip being displayed as none in the vCluster. In reality, the cluster-ip of the service in the host cluster was being correctly used in the endpoints created within the vCluster. The endpoints in the virtual cluster were pointing to the host cluster's cluster-ip, and despite the none display in the vCluster service, the traffic was correctly routed when the service in the vCluster was used.