This is an automated email from the ASF dual-hosted git repository.

adutra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new ce0baab035 [helm] added httproute config for management endpoints 
(#3969)
ce0baab035 is described below

commit ce0baab035015558b7cd678bc12f100cfb324b36
Author: cccs-cat001 <[email protected]>
AuthorDate: Wed Mar 11 09:27:05 2026 -0300

    [helm] added httproute config for management endpoints (#3969)
    
    Added httproute config for management endpoints to expose health/readiness 
checks external to the cluster deployment.
    
    ---------
    
    Co-authored-by: Alexandre Dutra <[email protected]>
---
 helm/polaris/templates/httproute.yaml              | 11 ++++++--
 helm/polaris/tests/httproute_test.yaml             | 31 ++++++++++++++++++++++
 helm/polaris/values.schema.json                    |  4 +++
 helm/polaris/values.yaml                           |  3 +++
 .../in-dev/unreleased/helm-chart/reference.md      |  1 +
 5 files changed, 48 insertions(+), 2 deletions(-)

diff --git a/helm/polaris/templates/httproute.yaml 
b/helm/polaris/templates/httproute.yaml
index 3d5677521e..928dd47edd 100644
--- a/helm/polaris/templates/httproute.yaml
+++ b/helm/polaris/templates/httproute.yaml
@@ -41,8 +41,15 @@ spec:
       sectionName: {{ .Values.httproute.sectionName }}
       {{- end }}
   rules:
-    # We don't specify a matches block here, so the default is a prefix path 
match on "/" (match every HTTP request)
-    # The backend (Service) to send matching requests to
+    {{- if .Values.httproute.exposeManagementEndpoints }}
+    - matches:
+      - path:
+          type: PathPrefix
+          value: "/q"
+      backendRefs:
+        - name: {{ include "polaris.fullnameWithSuffix" (list . "mgmt") }}
+          port: {{ get (first .Values.managementService.ports) "port" }}
+    {{- end }}
     - backendRefs:
         - name: {{ $fullName }}
           port: {{ get (first .Values.service.ports) "port" }}
diff --git a/helm/polaris/tests/httproute_test.yaml 
b/helm/polaris/tests/httproute_test.yaml
index 1d06bf55c9..74f3c34508 100644
--- a/helm/polaris/tests/httproute_test.yaml
+++ b/helm/polaris/tests/httproute_test.yaml
@@ -171,12 +171,43 @@ tests:
       httproute.enabled: true
       httproute.gatewayName: my-gateway
     asserts:
+      - lengthEqual:
+          path: spec.rules
+          count: 1
       - equal:
           path: spec.rules[0].backendRefs[0].name
           value: polaris-release
       - equal:
           path: spec.rules[0].backendRefs[0].port
           value: 8181
+  - it: should expose management endpoints rule when enabled
+    set:
+      httproute.enabled: true
+      httproute.gatewayName: my-gateway
+      httproute.exposeManagementEndpoints: true
+      managementService:
+        ports:
+          - name: polaris-mgmt
+            port: 18182
+    asserts:
+      - lengthEqual:
+          path: spec.rules
+          count: 2
+      - equal:
+          path: spec.rules[0].matches[0].path.type
+          value: PathPrefix
+      - equal:
+          path: spec.rules[0].backendRefs[0].name
+          value: polaris-release-mgmt
+      - equal:
+          path: spec.rules[0].backendRefs[0].port
+          value: 18182
+      - equal:
+          path: spec.rules[1].backendRefs[0].name
+          value: polaris-release
+      - equal:
+          path: spec.rules[1].backendRefs[0].port
+          value: 8181
 
   # validation
   - it: should fail when both ingress and httproute are enabled
diff --git a/helm/polaris/values.schema.json b/helm/polaris/values.schema.json
index c71a020922..970a1a4b38 100644
--- a/helm/polaris/values.schema.json
+++ b/helm/polaris/values.schema.json
@@ -429,6 +429,10 @@
                     "description": "Specifies whether an HTTPRoute should be 
created. See 
[Networking](https://polaris.apache.org/in-dev/unreleased/helm-chart/networking/)
 for more information.",
                     "type": "boolean"
                 },
+                "exposeManagementEndpoints": {
+                    "description": "Enable to expose the management endpoints 
on your httproute. This is required if you want to use the management service 
for health checks and metrics scraping external to the cluster.",
+                    "type": "boolean"
+                },
                 "gatewayName": {
                     "description": "Name of the Gateway resource to attach to. 
Required.",
                     "type": "string"
diff --git a/helm/polaris/values.yaml b/helm/polaris/values.yaml
index a64e5aaea2..c402d5a6cc 100644
--- a/helm/polaris/values.yaml
+++ b/helm/polaris/values.yaml
@@ -472,6 +472,9 @@ httproute:
   # @section -- HTTPRoute
   hosts:
     - chart-example.local
+  # -- Enable to expose the management endpoints on your httproute. This is 
required if you want to use the management service for health checks and 
metrics scraping external to the cluster.
+  # @section -- HTTPRoute
+  exposeManagementEndpoints: false
 
 # @schema type: object
 # -- Configures the resources requests and limits for polaris pods.
diff --git a/site/content/in-dev/unreleased/helm-chart/reference.md 
b/site/content/in-dev/unreleased/helm-chart/reference.md
index eff81d07aa..72b8183028 100644
--- a/site/content/in-dev/unreleased/helm-chart/reference.md
+++ b/site/content/in-dev/unreleased/helm-chart/reference.md
@@ -152,6 +152,7 @@ weight: 900
 | httproute.gatewayNamespace | string | `"default"` | Namespace where the 
Gateway is deployed. Required. |
 | httproute.sectionName | string | `""` | Section name within the gateway to 
use (optional). |
 | httproute.hosts | list | `["chart-example.local"]` | A list of hostnames 
that the HTTPRoute should match. |
+| httproute.exposeManagementEndpoints | bool | `false` | Enable to expose the 
management endpoints on your httproute. This is required if you want to use the 
management service for health checks and metrics scraping external to the 
cluster. |
 
 ### Resources and Autoscaling
 

Reply via email to