Skip to content

LFXV2-211 - query-service - migrate IngressRoute to the Gateway API HTTPRoute#6

Merged
mauriciozanettisalomao merged 3 commits intolinuxfoundation:mainfrom
mauriciozanettisalomao:feature/native-gateway
Aug 6, 2025
Merged

LFXV2-211 - query-service - migrate IngressRoute to the Gateway API HTTPRoute#6
mauriciozanettisalomao merged 3 commits intolinuxfoundation:mainfrom
mauriciozanettisalomao:feature/native-gateway

Conversation

@mauriciozanettisalomao
Copy link
Copy Markdown
Contributor

Overview

Similar to the migration done in project-service (see PR #7), we need to migrate the query-service from using Traefik IngressRoute to the newer Gateway API HTTPRoute.

This follows the same pattern as LFXV2-49 and involves:

  • Replacing IngressRoute with HTTPRoute resource
  • Removing legacy ingress configuration files
  • Adding new httproute.yaml template
  • Updating service configuration to use configurable ports
  • Adding traefik, lfx, and service configuration sections to values.yaml

Reference Implementation: The project-service PR provides a good example of the changes needed: https://github.com/linuxfoundation/lfx-v2-project-service/pull/7/files

…ic port values

- add HTTPRoute resource

Signed-off-by: Mauricio Zanetti Salomao <mauriciozanetti86@gmail.com>
Copilot AI review requested due to automatic review settings August 5, 2025 14:23
@mauriciozanettisalomao mauriciozanettisalomao requested a review from a team as a code owner August 5, 2025 14:23
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Aug 5, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The changes transition the lfx-v2-query-service Helm chart from using a Traefik IngressRoute to a Gateway API HTTPRoute for ingress. Service and deployment port configurations are made dynamic via Helm values. The values.yaml is restructured to support the new Gateway API configuration, including domain, namespace, and service port settings.

Changes

Cohort / File(s) Change Summary
Deployment & Service Port Configuration
charts/lfx-v2-query-service/templates/deployment.yaml, charts/lfx-v2-query-service/templates/service.yaml
Changed container and service port specifications from hardcoded values to dynamic values sourced from .Values.service.port.
Ingress to Gateway API Migration
charts/lfx-v2-query-service/templates/ingressroute.yaml, charts/lfx-v2-query-service/templates/httproute.yaml
Removed Traefik IngressRoute manifest and introduced a Gateway API HTTPRoute manifest for routing, with conditional middleware and dynamic backend/service port configuration.
Helm Values Restructuring
charts/lfx-v2-query-service/values.yaml
Replaced old ingress configuration with new sections for Traefik gateway, domain, namespace, and service port, supporting the new Gateway API-based routing.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Gateway
    participant HTTPRoute
    participant Service
    participant Pod

    Client->>Gateway: HTTP request to /query or /query/...
    Gateway->>HTTPRoute: Forwards request based on host/path
    HTTPRoute->>Service: Routes to lfx-v2-query-service on configured port
    Service->>Pod: Proxies request to application container
    Pod-->>Service: Responds
    Service-->>Gateway: Forwards response
    Gateway-->>Client: Returns response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06454f4 and c9eb10d.

📒 Files selected for processing (2)
  • charts/lfx-v2-query-service/templates/deployment.yaml (1 hunks)
  • charts/lfx-v2-query-service/values.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • charts/lfx-v2-query-service/templates/deployment.yaml
  • charts/lfx-v2-query-service/values.yaml
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the query-service from Traefik IngressRoute to the newer Gateway API HTTPRoute, following the same pattern established in project-service. The migration involves replacing legacy ingress configuration with modern Gateway API standards while maintaining the same routing functionality.

  • Replaces legacy IngressRoute with Gateway API HTTPRoute resource
  • Updates service configuration to use configurable ports instead of hardcoded values
  • Adds new configuration sections for traefik, lfx, and service settings in values.yaml

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
values.yaml Replaces ingress configuration with traefik, lfx, and service configuration sections
service.yaml Updates service port to use configurable value from values.yaml
ingressroute.yaml Removes legacy Traefik IngressRoute configuration
httproute.yaml Adds new Gateway API HTTPRoute configuration with equivalent routing rules
deployment.yaml Updates container port to use configurable value from values.yaml

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
charts/lfx-v2-query-service/values.yaml (1)

25-28: Document the integer expectation for service.port

Add a short comment that the value must be numeric (no quotes) since code casts it to int.
Helps chart consumers avoid subtle template failures.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7b826d and 3230ed1.

📒 Files selected for processing (5)
  • charts/lfx-v2-query-service/templates/deployment.yaml (1 hunks)
  • charts/lfx-v2-query-service/templates/httproute.yaml (1 hunks)
  • charts/lfx-v2-query-service/templates/ingressroute.yaml (0 hunks)
  • charts/lfx-v2-query-service/templates/service.yaml (1 hunks)
  • charts/lfx-v2-query-service/values.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • charts/lfx-v2-query-service/templates/ingressroute.yaml
🧰 Additional context used
🪛 YAMLlint (1.37.1)
charts/lfx-v2-query-service/templates/httproute.yaml

[error] 25-25: syntax error: could not find expected ':'

(syntax)

🔇 Additional comments (1)
charts/lfx-v2-query-service/templates/httproute.yaml (1)

24-31: YAML-lint failure hints at indentation risk around the conditional filters block

When .Values.heimdall.enabled is false, the filters: key disappears but the surrounding indentation stays, potentially leaving extra blank lines that YAML-lint flags (could not find expected ':').
Wrap the whole block with nindent to guarantee correct indent, e.g.:

{{- if .Values.heimdall.enabled }}
{{- nindent 4 "filters:\n- type: ExtensionRef\n  extensionRef:\n    group: traefik.io\n    kind: Middleware\n    name: heimdall" }}
{{- end }}

This yields valid YAML in both code paths.

Comment on lines 36 to 38
ports:
- containerPort: 8080
- containerPort: {{ .Values.service.port }}
name: web
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Cast the configurable port to an int to avoid type-mismatch errors

If a user overrides .Values.service.port with a quoted value ("8080"), Helm will render a string.
containerPort must be an integer; sending a string will fail validation against the K8s API.

-            - containerPort: {{ .Values.service.port }}
+            - containerPort: {{ .Values.service.port | int }}

(Apply the same filter anywhere the value is used as a numeric port.)

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
ports:
- containerPort: 8080
- containerPort: {{ .Values.service.port }}
name: web
ports:
- containerPort: {{ .Values.service.port | int }}
name: web
🤖 Prompt for AI Agents
In charts/lfx-v2-query-service/templates/deployment.yaml around lines 36 to 38,
the containerPort value is rendered directly from .Values.service.port, which
can be a string if overridden with quotes, causing Kubernetes validation errors.
Fix this by casting .Values.service.port to an integer using the Helm int
function wherever it is used as a numeric port to ensure the value is always an
integer.

Comment on lines 11 to 14
ports:
- name: web
port: 80
port: {{ .Values.service.port }}
targetPort: web
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Same int-casting needed for the Service port

spec.ports[].port is also an integer field. Cast it the same way to keep template behaviour consistent.

-      port: {{ .Values.service.port }}
+      port: {{ .Values.service.port | int }}
🤖 Prompt for AI Agents
In charts/lfx-v2-query-service/templates/service.yaml around lines 11 to 14, the
service port value is not explicitly cast to an integer, which can cause
inconsistencies since spec.ports[].port expects an integer. Update the template
to cast .Values.service.port to an integer using the int function, ensuring
consistent and correct type handling in the YAML output.

Generated with [GitHub Copilot](https://github.com/features/copilot)

Signed-off-by: Mauricio Zanetti Salomao <mauriciozanetti86@gmail.com>
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.

3 participants