Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/lfx-v2-query-service/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ spec:
- secretRef:
name: {{ .Values.secret.name }}
ports:
- containerPort: 8080
- containerPort: {{ .Values.service.port }}
name: web
Comment on lines 38 to 40
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.

livenessProbe:
httpGet:
Expand Down
34 changes: 34 additions & 0 deletions charts/lfx-v2-query-service/templates/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright The Linux Foundation and each contributor to LFX.
# SPDX-License-Identifier: MIT
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: lfx-v2-query-service
namespace: {{ .Values.lfx.namespace }}
spec:
parentRefs:
- name: {{ .Values.traefik.gateway.name }}
namespace: {{ .Values.traefik.gateway.namespace }}
hostnames:
- "lfx-api.{{ .Values.lfx.domain }}"
rules:
# Main application endpoints (with authentication)
- matches:
- path:
type: Exact
value: /query
- path:
type: PathPrefix
value: /query/
{{- if .Values.heimdall.enabled }}
filters:
- type: ExtensionRef
extensionRef:
group: traefik.io
kind: Middleware
name: heimdall
{{- end }}
backendRefs:
- name: lfx-v2-query-service
port: {{ .Values.service.port }}
25 changes: 0 additions & 25 deletions charts/lfx-v2-query-service/templates/ingressroute.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion charts/lfx-v2-query-service/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
spec:
ports:
- name: web
port: 80
port: {{ .Values.service.port }}
targetPort: web
Comment on lines 11 to 14
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.


selector:
Expand Down
20 changes: 17 additions & 3 deletions charts/lfx-v2-query-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,23 @@ image:
tag: ""
pullPolicy: IfNotPresent

# ingress is the configuration for the ingress routing
ingress:
hostname: lfx-api.k8s.orb.local
# traefik is the configuration for Traefik Gateway API routing
traefik:
# gateway specifies the platform Gateway to attach to
gateway:
name: lfx-platform-gateway

# lfx is the configuration for LFX platform
lfx:
# domain is the base domain for routing
domain: k8s.orb.local
# namespace is the target namespace for deployment
namespace: lfx

# service is the configuration for the Kubernetes service
service:
# port is the service port
port: 8080

# nats is the configuration for the NATS server
nats:
Expand Down