Fix broken Ingress service name and port configuration#429
Fix broken Ingress service name and port configuration#429RafsanNeloy wants to merge 1 commit intokarmada-io:mainfrom
Conversation
Signed-off-by: rafsanneloy <rafsanneloy@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello @RafsanNeloy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves two critical configuration issues within the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly fixes two bugs in the Ingress configuration: it points to the correct service port and updates the service name to match the karmada-dashboard-web service. While the fix is functional, the approach for correcting the service name deviates from Helm best practices by not using the full release name. This could lead to issues with fullnameOverride and potential resource name conflicts in the future. I have added a comment with a recommendation for a more robust long-term solution.
| {{- if .Values.ingress.enabled -}} | ||
| {{- $fullName := include "karmada-dashboard.fullname" . -}} | ||
| {{- $svcPort := .Values.service.port -}} | ||
| {{- $fullName := printf "%s-web" (include "karmada-dashboard.name" .) -}} |
There was a problem hiding this comment.
While this change correctly targets the karmada-dashboard-web service, it switches from using the karmada-dashboard.fullname helper to karmada-dashboard.name. The name helper does not include the Helm release name and ignores the fullnameOverride value. This is a deviation from Helm best practices and can lead to resource name collisions if multiple instances of this chart are deployed in the same namespace.
The underlying issue is that the target service in karmada-dashboard-web-service.yaml is also named using karmada-dashboard.name. A more robust fix would involve updating both the service and this Ingress to use fullname as the base for their names (e.g., {{ include "karmada-dashboard.fullname" . }}-web).
Although this change fixes the immediate connectivity bug, I recommend creating a follow-up issue to address this naming inconsistency to improve chart maintainability.
There was a problem hiding this comment.
@warjiang should i update the line with
{{ include "karmada-dashboard.fullname" . }}-web) ? what do u think?
|
/assign |
What type of PR is this?
/kind bug
What this PR does / why we need it: Fixes two issues in the
ingress.yamlthat were preventing the Ingress resource from correctly routing traffic to the Karmada Dashboard.##Fixed Port Reference
Changed
.Values.service.port(which does not exist) to.Values.web.service.portto correctly reference the web service port as defined.##Updated Backend service name
The Ingress backend was targeting {
{ .Release.Name }}-karmada-dashboard, while the actual service created by the chart includes a-websuffix({{ .Release.Name }}-karmada-dashboard-web). Also Updated the $fullName variable to include the -web suffix so it targets the correct backend service.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: