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

Bugfix ingress route settings #2636

Merged
merged 11 commits into from
Sep 24, 2024
Merged

Bugfix ingress route settings #2636

merged 11 commits into from
Sep 24, 2024

Conversation

hlts2
Copy link
Collaborator

@hlts2 hlts2 commented Sep 20, 2024

Description

Fixed a problem with proper routing if the PATH setting was not made correctly.

The following are generated ingress manifest

when lb are enabled
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/grpc-backend: "true"
  labels:
    name: vald-lb-gateway-ingress
    app: vald-lb-gateway-ingress
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.7.13
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: vald
    app.kubernetes.io/version: v1.7.13
    app.kubernetes.io/component: gateway-lb
  name: vald-ingress
spec:
  defaultBackend:
    service:
      name: vald-lb-gateway
      port:
        name: grpc
  rules:
  - host: lb.gateway.vald.vdaas.org
    http:
      paths:
      - path: "/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1.ServerReflection/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
when mirror and lb are enabled
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/grpc-backend: "true"
  labels:
    name: vald-mirror-gateway-ingress
    app: vald-mirror-gateway-ingress
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.7.13
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: vald
    app.kubernetes.io/version: v1.7.13
    app.kubernetes.io/component: gateway-mirror
  name: vald-ingress
spec:
  defaultBackend:
    service:
      name: vald-mirror-gateway
      port:
        name: grpc
  rules:
  - host: mirror.gateway.vald.vdaas.org
    http:
      paths:
      - path: "/vald.v1.Search/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Insert/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Update/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      # NOTE: Change backend service to mirror after UpdateTimestamp is implemented in mirror.
      - path: "/vald.v1.Update/UpdateTimestamp"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Upsert/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Remove/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Index/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      # NOTE: Change backend service to mirror after Flush is implemented in mirror.
      - path: "/vald.v1.Flush/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/mirror.v1.Mirror/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1.ServerReflection/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
when mirror and lb and filter are enabled
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/grpc-backend: "true"
  labels:
    name: vald-filter-gateway-ingress
    app: vald-filter-gateway-ingress
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.7.13
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: vald
    app.kubernetes.io/version: v1.7.13
    app.kubernetes.io/component: gateway-filter
  name: vald-ingress
spec:
  defaultBackend:
    service:
      name: vald-filter-gateway
      port:
        name: grpc
  rules:
  - host: filter.gateway.vald.vdaas.org
    http:
      paths:
      - path: "/vald.v1.Search/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Insert/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Update/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      # NOTE: Change backend service to mirror after UpdateTimestamp is implemented in mirror.
      - path: "/vald.v1.Update/UpdateTimestamp"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Upsert/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Remove/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/Exists/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/GetTimestamp/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Index/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      # NOTE: Change backend service to mirror after Flush is implemented in mirror.
      - path: "/vald.v1.Flush/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/mirror.v1.Mirror/"
        backend:
          service:
            name: vald-mirror-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Filter/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1.ServerReflection/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
when filter and lb are enabled
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/grpc-backend: "true"
  labels:
    name: vald-filter-gateway-ingress
    app: vald-filter-gateway-ingress
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.7.13
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: vald
    app.kubernetes.io/version: v1.7.13
    app.kubernetes.io/component: gateway-filter
  name: vald-ingress
spec:
  defaultBackend:
    service:
      name: vald-filter-gateway
      port:
        name: grpc
  rules:
  - host: filter.gateway.vald.vdaas.org
    http:
      paths:
      - path: "/vald.v1.Search/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Insert/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Update/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Upsert/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Remove/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Index/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/Exists/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Object/GetTimestamp/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Flush/"
        backend:
          service:
            name: vald-lb-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/vald.v1.Filter/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1.ServerReflection/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific
      - path: "/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo/"
        backend:
          service:
            name: vald-filter-gateway
            port:
              name: grpc
        pathType: ImplementationSpecific

Related Issue

Versions

  • Vald Version: v1.7.13
  • Go Version: v1.23.1
  • Rust Version: v1.81.0
  • Docker Version: v27.2.1
  • Kubernetes Version: v1.31.0
  • Helm Version: v3.16.0
  • NGT Version: v2.2.4
  • Faiss Version: v1.8.0

Checklist

Special notes for your reviewer

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced new paths for object management: /vald.v1.Remove/, /vald.v1.Object/, /vald.v1.Flush/, and /vald.v1.Filter/.
    • Added reflection-related paths for improved service routing.
  • Improvements

    • Updated existing paths to include trailing slashes for better routing consistency.
    • Enhanced ingress routing logic for more granular control based on service conditions.

@vdaas-ci
Copy link
Collaborator

[CHATOPS:HELP] ChatOps commands.

  • 🙆‍♀️ /approve - approve
  • 🍱 /format - format codes and add licenses
  • /gen-test - generate test codes
  • 🏷️ /label - add labels
  • 🔚 2️⃣ 🔚 /label actions/e2e-deploy - run E2E deploy & integration test

Copy link
Contributor

coderabbitai bot commented Sep 20, 2024

Walkthrough

Walkthrough

The pull request includes extensive modifications to the ingress configuration in a Kubernetes YAML file. Key changes involve adding trailing slashes to existing service paths and introducing new paths such as /vald.v1.Remove/, /vald.v1.Object/, /vald.v1.Flush/, and /vald.v1.Filter/. The backend service assignments have been revised, enhancing the routing logic based on various feature flags.

Changes

File Change Summary
charts/vald/templates/gateway/ing.yaml Added paths /vald.v1.Remove/, /vald.v1.Object/, /vald.v1.Flush/, and /vald.v1.Filter/; modified paths to include trailing slashes for /vald.v1.Search/, /vald.v1.Insert/, /vald.v1.Update/, /vald.v1.Upsert/, /vald.v1.Index/, /vald.v1.Object.Exists/, /vald.v1.Object.GetTimestamp/; modified /vald.v1.Update/ to use $mirror.name service.

Suggested labels

area/makefile

Suggested reviewers

  • vankichi
  • kpango

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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.
    -- Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • 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 generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 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.

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 20, 2024
Copy link

cloudflare-workers-and-pages bot commented Sep 20, 2024

Deploying vald with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4031712
Status:⚡️  Build in progress...

View logs

coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 20, 2024
@hlts2
Copy link
Collaborator Author

hlts2 commented Sep 20, 2024

Note

The format check CI is failing, but this CI will be fixed other PR

Copy link
Contributor

Copy link
Contributor

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2746cbc and 92f0021.

Files selected for processing (1)
  • charts/vald/templates/gateway/ing.yaml (1 hunks)
Additional comments not posted (8)
charts/vald/templates/gateway/ing.yaml (8)

65-66: LGTM!

The addition of the trailing slash to the path and the conditions for setting the backend service are correct.


72-78: LGTM!

The addition of the trailing slash to the path and the conditions for setting the backend service are correct.


97-102: LGTM!

The addition of the trailing slash to the path and the conditions for setting the backend service are correct.


103-108: LGTM!

The addition of the trailing slash to the path and the conditions for setting the backend service are correct.


140-145: LGTM!

The addition of the trailing slash to the path and the conditions for setting the backend service are correct.


147-206: LGTM!

The addition of trailing slashes to the paths and the conditions for setting the backend services are correct. The paths and their corresponding backend services are logically organized.


277-283: LGTM!

The catch-all path "/" and the condition for setting the backend service are correct.


284-297: LGTM!

The path "/grpc.reflection.v1.ServerReflection/" and the dynamic backend service assignment based on $filterIngEnabled are correct.

charts/vald/templates/gateway/ing.yaml Show resolved Hide resolved
charts/vald/templates/gateway/ing.yaml Outdated Show resolved Hide resolved
charts/vald/templates/gateway/ing.yaml Show resolved Hide resolved
charts/vald/templates/gateway/ing.yaml Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 20, 2024
Signed-off-by: hlts2 <[email protected]>
coderabbitai[bot]
coderabbitai bot previously approved these changes Sep 24, 2024
Copy link
Contributor

@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: 2

Outside diff range and nitpick comments (1)
charts/vald/templates/gateway/ing.yaml (1)

284-311: LGTM: Addition of gRPC reflection paths

The addition of paths for gRPC reflection services is beneficial for service discovery and debugging. The conditional backend service assignment based on whether the filter is enabled is correct.

Consider refactoring to reduce duplication

The configuration for the two versions of the gRPC reflection service (v1alpha and v1) is identical. Consider refactoring to reduce duplication, potentially using a loop or a template function.

Here's a potential refactor using a Helm named template:

{{- define "grpcReflectionPath" }}
- path: "/grpc.reflection.{{ . }}.ServerReflection/ServerReflectionInfo"
  {{- if $filterIngEnabled }}
  backend:
    service:
      name: {{ $filter.name }}
      {{- include "vald.ingressPort" (dict "Values" $filter.ingress) | nindent 6 }}
  pathType: {{ $filter.ingress.pathType }}
  {{- else }}
  backend:
    service:
      name: {{ $lb.name }}
      {{- include "vald.ingressPort" (dict "Values" $lb.ingress) | nindent 6 }}
  pathType: {{ $lb.ingress.pathType }}
  {{- end }}
{{- end }}

# Usage:
{{ include "grpcReflectionPath" "v1alpha" }}
{{ include "grpcReflectionPath" "v1" }}

This refactor would reduce duplication and make it easier to maintain if changes are needed in the future.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7904323 and dd300bd.

Files selected for processing (1)
  • charts/vald/templates/gateway/ing.yaml (1 hunks)
Additional comments not posted (5)
charts/vald/templates/gateway/ing.yaml (5)

97-120: LGTM: New paths and backend service assignments

The addition of new paths ("/vald.v1.Remove/", "/vald.v1.Object/", and "/vald.v1.Flush/") with appropriate backend service assignments is correct and consistent with the overall structure. The use of trailing slashes for all paths maintains consistency.


147-206: LGTM: Consistent path updates and correct backend service assignments

The changes in this section maintain consistency with the trailing slash pattern for all paths. The backend service assignments are correct based on the enabled services (filter and lb). The addition of new paths ("/vald.v1.Remove/", "/vald.v1.Flush/", and "/vald.v1.Filter/") is appropriate and consistent with the overall structure.


277-278: LGTM: Correct path for lb-only scenario

The use of the root path "/" for routing all traffic to the lb service when only lb is enabled is correct and appropriate.


Line range hint 1-311: Overall assessment: Approve with minor suggestions

The changes to the ingress configuration improve consistency and add support for new services. The use of trailing slashes for paths and conditional backend service assignments based on enabled services are well-implemented.

Key points:

  1. Trailing slashes added to most paths for consistency.
  2. New paths added for additional services (Remove, Object, Flush, Filter).
  3. Conditional backend service assignments based on enabled services.
  4. gRPC reflection paths added for service discovery and debugging.

Suggestions for improvement:

  1. Add trailing slash to the UpdateTimestamp path for full consistency.
  2. Consider refactoring the duplicate gRPC reflection configuration to reduce redundancy.
  3. Ensure the TODOs for changing backend services (UpdateTimestamp and Flush) are tracked and implemented in the future.

Overall, these changes enhance the routing logic and flexibility of the ingress configuration. The suggestions provided are minor and can be addressed in a follow-up commit if desired.


127-145: LGTM: New paths and backend service assignments

The addition of new paths ("/mirror.v1.Mirror/" and "/vald.v1.Filter/") with appropriate backend service assignments is correct and consistent with the overall structure.

Reminder: Update backend service for Flush

The comment on line 127 indicates a future task to change the backend service for Flush. Ensure this is tracked and implemented when the functionality is available in the mirror service.

To verify the current implementation and track future changes, run:

Verification successful

Verification Successful: Paths and TODOs Confirmed

The paths "/vald.v1.Flush/" and "/vald.v1.Update/UpdateTimestamp" are correctly present, and the TODO comments for updating the backend service after implementing Flush and UpdateTimestamp are properly documented.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check current implementation and track TODO
rg --type yaml 'path: "/vald.v1.Flush/' charts/vald/templates/gateway/ing.yaml
rg --type yaml '# NOTE: Change backend service to mirror after Flush' charts/vald/templates/gateway/ing.yaml

Length of output: 834

charts/vald/templates/gateway/ing.yaml Outdated Show resolved Hide resolved
charts/vald/templates/gateway/ing.yaml Show resolved Hide resolved
Copy link
Contributor

@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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dd300bd and dd070e1.

Files selected for processing (1)
  • charts/vald/templates/gateway/ing.yaml (2 hunks)
Additional context used
yamllint
charts/vald/templates/gateway/ing.yaml

[error] 16-16: syntax error: expected the node content, but found '-'

(syntax)

Additional comments not posted (4)
charts/vald/templates/gateway/ing.yaml (4)

70-106: LGTM: Consistent path formatting and new functionality

The addition of trailing slashes to paths and the introduction of new paths for Remove, Object, and Filter operations improve consistency and expand functionality.


82-88: Add trailing slash to UpdateTimestamp path for consistency

The UpdateTimestamp path is inconsistent with the other paths in this block.

Add a trailing slash to the UpdateTimestamp path:

-      - path: "/vald.v1.Update/UpdateTimestamp"
+      - path: "/vald.v1.Update/UpdateTimestamp/"

Also, don't forget to address the TODO comment about changing the backend service for UpdateTimestamp once it's implemented in the mirror service.


151-286: LGTM: Consistent changes across different gateway configurations

The changes in these blocks are consistent with the improvements made in the first block, ensuring proper path formatting and backend service assignments across different gateway configurations.


230-236: Add trailing slash to UpdateTimestamp path for consistency

Similar to the previous block, the UpdateTimestamp path is inconsistent with the other paths in this block.

Add a trailing slash to the UpdateTimestamp path:

-      - path: "/vald.v1.Update/UpdateTimestamp"
+      - path: "/vald.v1.Update/UpdateTimestamp/"

Also, don't forget to address the TODO comment about changing the backend service for UpdateTimestamp once it's implemented in the mirror service.

charts/vald/templates/gateway/ing.yaml Outdated Show resolved Hide resolved
Signed-off-by: hlts2 <[email protected]>
Copy link
Contributor

@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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between dd070e1 and 22469cc.

Files selected for processing (1)
  • charts/vald/templates/gateway/ing.yaml (2 hunks)
Additional context used
yamllint
charts/vald/templates/gateway/ing.yaml

[error] 16-16: syntax error: expected the node content, but found '-'

(syntax)

Additional comments not posted (9)
charts/vald/templates/gateway/ing.yaml (9)

82-88: Consider adding a trailing slash to the UpdateTimestamp path

For consistency with other paths, consider adding a trailing slash to the /vald.v1.Update/UpdateTimestamp path.

-      - path: "/vald.v1.Update/UpdateTimestamp"
+      - path: "/vald.v1.Update/UpdateTimestamp/"

Also, note the TODO comment about changing the backend service to mirror after UpdateTimestamp is implemented in mirror. Ensure this is tracked for future updates.


89-106: New path configurations added

The addition of path configurations for /vald.v1.Update/, /vald.v1.Upsert/, and /vald.v1.Remove/ is consistent with the overall changes. Note that the /vald.v1.Remove/ path is now directed to the mirror service.

These changes improve the routing logic and provide more granular control over service routing.


119-124: New Object path configuration added

A new path configuration for /vald.v1.Object/ has been added and is directed to the filter service. This is consistent with the overall changes to improve routing granularity.

This addition provides more specific routing for general Object operations.


131-137: New Flush path configuration added

A new path configuration for /vald.v1.Flush/ has been added and is currently directed to the lb service. This is consistent with the overall changes to improve routing granularity.

Note the TODO comment about changing the backend service to mirror after Flush is implemented in mirror. Ensure this is tracked for future updates.


138-149: New Mirror Register and Filter path configurations added

New path configurations have been added for /mirror.v1.Mirror/Register (directed to the mirror service) and /vald.v1.Filter/ (directed to the filter service). These additions are consistent with the overall changes to improve routing granularity.

These new paths provide more specific routing for Mirror and Filter operations, enhancing the flexibility of the ingress configuration.


151-186: New path configurations for filter and lb enabled scenario

New path configurations have been added for various operations when only filter and lb are enabled. The routing logic directs Remove and Index operations to the lb service, while other operations are directed to the filter service.

This configuration provides a clear routing strategy for scenarios where only filter and lb are enabled, enhancing the flexibility of the ingress configuration.


187-204: Updated Object operations routing for filter and lb enabled scenario

The routing logic for Object operations has been updated when only filter and lb are enabled. While Exists and GetTimestamp operations are still directed to the lb service, a new general /vald.v1.Object/ path has been added and is directed to the filter service.

This configuration provides more granular control over Object operations routing, improving the flexibility of the ingress configuration.


205-217: New Flush and Filter path configurations for filter and lb enabled scenario

New path configurations have been added for /vald.v1.Flush/ (directed to the lb service) and /vald.v1.Filter/ (directed to the filter service) when only filter and lb are enabled. These additions are consistent with the overall changes to improve routing granularity.

These new paths provide more specific routing for Flush and Filter operations, enhancing the flexibility of the ingress configuration in this specific scenario.


218-286: New path configurations for mirror and lb enabled scenario

New path configurations have been added for various operations when only mirror and lb are enabled. The routing logic is as follows:

  • Search, Object, Index, and Flush operations are directed to the lb service.
  • Insert, Update, Upsert, Remove, and Mirror Register operations are directed to the mirror service.
  • UpdateTimestamp is currently directed to the lb service, but there's a note to change this in the future.

This configuration provides a clear routing strategy for scenarios where only mirror and lb are enabled, enhancing the flexibility of the ingress configuration.

Note the TODO comment about changing the backend service for UpdateTimestamp to mirror after it's implemented. Ensure this is tracked for future updates.

charts/vald/templates/gateway/ing.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@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: 2

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 22469cc and bba0f5f.

Files selected for processing (1)
  • charts/vald/templates/gateway/ing.yaml (2 hunks)
Additional context used
yamllint
charts/vald/templates/gateway/ing.yaml

[error] 16-16: syntax error: expected the node content, but found '-'

(syntax)

Additional comments not posted (5)
charts/vald/templates/gateway/ing.yaml (5)

150-215: LGTM! Conditional configurations look good

The conditional configurations for different combinations of enabled services provide good flexibility. The consistent use of trailing slashes and appropriate backend service assignments are well implemented.


Line range hint 1-315: Overall, the changes improve routing configuration and flexibility

The modifications to this Ingress configuration file enhance the routing setup for the Vald project in several ways:

  1. Consistent use of trailing slashes in paths improves routing robustness.
  2. Addition of new paths (e.g., Remove, Object, Flush, Filter) expands the API surface.
  3. Conditional configurations provide flexibility for different deployment scenarios.
  4. Integration of gRPC reflection improves service discoverability.

To ensure all paths are consistently using trailing slashes, run:

#!/bin/bash
# Check for paths without trailing slashes
rg --type yaml 'path: ".*[^/]"' charts/vald/templates/gateway/ing.yaml

This script should return no results if all paths are correctly formatted with trailing slashes.


88-148: LGTM! Remember to update the backend service for Flush

The addition of new paths and consistent use of trailing slashes improve the routing configuration.

Don't forget to implement the TODO mentioned in the comment:

# NOTE: Change backend service to mirror after Flush is implemented in mirror.

Run this script to track the implementation status:

#!/bin/bash
# Check if Flush is implemented in mirror
rg --type go 'func.*Flush' $(fd -t f -e go . | grep mirror)

68-87: LGTM! Remember to update the backend service for UpdateTimestamp

The addition of trailing slashes to the paths and the split of the Update path improve consistency and flexibility.

Don't forget to implement the TODO mentioned in the comment:

# NOTE: Change backend service to mirror after UpdateTimestamp is implemented in mirror.

Run this script to track the implementation status:


217-285: LGTM! Remember to update backend services for UpdateTimestamp and Flush

The conditional configurations for different service combinations are well implemented and consistent.

Don't forget to implement the TODOs mentioned in the comments:

  1. For UpdateTimestamp:
# NOTE: Change backend service to mirror after UpdateTimestamp is implemented in mirror.
  1. For Flush:
# NOTE: Change backend service to mirror after Flush is implemented in mirror.

Run these scripts to track the implementation status:

charts/vald/templates/gateway/ing.yaml Show resolved Hide resolved
charts/vald/templates/gateway/ing.yaml Show resolved Hide resolved
@hlts2 hlts2 requested review from kpango and kmrmt September 24, 2024 04:32
Copy link
Collaborator

@kpango kpango left a comment

Choose a reason for hiding this comment

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

LGTM

@kpango kpango merged commit 686c16a into main Sep 24, 2024
6 of 8 checks passed
@kpango kpango deleted the fix/mirror/ingress branch September 24, 2024 07:36
vdaas-ci pushed a commit that referenced this pull request Sep 24, 2024
* feat: correct ingress route

Signed-off-by: hlts2 <[email protected]>

* fix: helm template parse error

Signed-off-by: hlts2 <[email protected]>

* fix: bugfix ingress route for filter

Signed-off-by: hlts2 <[email protected]>

* fix: route order

Signed-off-by: hlts2 <[email protected]>

* fix: updatetimestamp route

Signed-off-by: hlts2 <[email protected]>

* fix: route settings

Signed-off-by: hlts2 <[email protected]>

* fix: server reflection path

Signed-off-by: hlts2 <[email protected]>

* fix: server reflection handling

Signed-off-by: hlts2 <[email protected]>

* fix: tweak

Signed-off-by: hlts2 <[email protected]>

* fix: deleted unnecessary variable

Signed-off-by: hlts2 <[email protected]>

---------

Signed-off-by: hlts2 <[email protected]>
Co-authored-by: Yusuke Kato <[email protected]>
kpango added a commit that referenced this pull request Sep 24, 2024
* feat: correct ingress route



* fix: helm template parse error



* fix: bugfix ingress route for filter



* fix: route order



* fix: updatetimestamp route



* fix: route settings



* fix: server reflection path



* fix: server reflection handling



* fix: tweak



* fix: deleted unnecessary variable



---------

Signed-off-by: hlts2 <[email protected]>
Co-authored-by: Hiroto Funakoshi <[email protected]>
Co-authored-by: Yusuke Kato <[email protected]>
@kpango kpango mentioned this pull request Oct 11, 2024
takuyaymd pushed a commit to takuyaymd/vald that referenced this pull request Dec 2, 2024
* feat: correct ingress route

Signed-off-by: hlts2 <[email protected]>

* fix: helm template parse error

Signed-off-by: hlts2 <[email protected]>

* fix: bugfix ingress route for filter

Signed-off-by: hlts2 <[email protected]>

* fix: route order

Signed-off-by: hlts2 <[email protected]>

* fix: updatetimestamp route

Signed-off-by: hlts2 <[email protected]>

* fix: route settings

Signed-off-by: hlts2 <[email protected]>

* fix: server reflection path

Signed-off-by: hlts2 <[email protected]>

* fix: server reflection handling

Signed-off-by: hlts2 <[email protected]>

* fix: tweak

Signed-off-by: hlts2 <[email protected]>

* fix: deleted unnecessary variable

Signed-off-by: hlts2 <[email protected]>

---------

Signed-off-by: hlts2 <[email protected]>
Co-authored-by: Yusuke Kato <[email protected]>
takuyaymd pushed a commit to takuyaymd/vald that referenced this pull request Dec 2, 2024
* feat: correct ingress route

Signed-off-by: hlts2 <[email protected]>

* fix: helm template parse error

Signed-off-by: hlts2 <[email protected]>

* fix: bugfix ingress route for filter

Signed-off-by: hlts2 <[email protected]>

* fix: route order

Signed-off-by: hlts2 <[email protected]>

* fix: updatetimestamp route

Signed-off-by: hlts2 <[email protected]>

* fix: route settings

Signed-off-by: hlts2 <[email protected]>

* fix: server reflection path

Signed-off-by: hlts2 <[email protected]>

* fix: server reflection handling

Signed-off-by: hlts2 <[email protected]>

* fix: tweak

Signed-off-by: hlts2 <[email protected]>

* fix: deleted unnecessary variable

Signed-off-by: hlts2 <[email protected]>

---------

Signed-off-by: hlts2 <[email protected]>
Co-authored-by: Yusuke Kato <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants