From 9317dcb9a4ca6a679d13a2acbd93a38ad8f7567f Mon Sep 17 00:00:00 2001 From: Baoyuan Date: Tue, 31 Mar 2026 09:36:19 +0800 Subject: [PATCH 1/2] feat: support auto assign node port for dp-manager Add nodeport configuration support for dp-manager service: - Add autoAssignNodePort option to automatically set nodePort to same value as port - Add manual nodePort/tlsNodePort options for custom nodePort values - Update chart version to 0.17.48 - Update README documentation Reference: PR #258 --- charts/api7/Chart.yaml | 2 +- charts/api7/README.md | 3 +++ charts/api7/templates/dp-manager-service.yaml | 14 ++++++++++++++ charts/api7/values.yaml | 6 ++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/charts/api7/Chart.yaml b/charts/api7/Chart.yaml index 8ae4ff3..80fe640 100644 --- a/charts/api7/Chart.yaml +++ b/charts/api7/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.17.47 +version: 0.17.48 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/api7/README.md b/charts/api7/README.md index d2ccad4..8eba4ef 100644 --- a/charts/api7/README.md +++ b/charts/api7/README.md @@ -208,6 +208,7 @@ A Helm chart for Kubernetes | dp_manager_configuration.server.tls.host | string | `"0.0.0.0"` | | | dp_manager_configuration.server.tls.port | int | `7943` | | | dp_manager_service.annotations | object | `{}` | | +| dp_manager_service.autoAssignNodePort | bool | `false` | Whether to set nodePort to the same value as the HTTP/HTTPS port when dp_manager_service.type is NodePort, make sure the nodePort to be in the valid NodePort range of kubernetes service. | | dp_manager_service.ingress.annotations | object | `{}` | | | dp_manager_service.ingress.className | string | `""` | | | dp_manager_service.ingress.enabled | bool | `false` | | @@ -215,7 +216,9 @@ A Helm chart for Kubernetes | dp_manager_service.ingress.hosts[0].paths[0].path | string | `"/"` | | | dp_manager_service.ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | | | dp_manager_service.ingress.tls | list | `[]` | | +| dp_manager_service.nodePort | int | `nil` | The nodePort for HTTP service, only used if dp_manager_service.type is NodePort. If not set, a random port will be assigned by Kubernetes. | | dp_manager_service.port | int | `7900` | | +| dp_manager_service.tlsNodePort | int | `nil` | The nodePort for HTTPS service, only used if dp_manager_service.type is NodePort. If not set, a random port will be assigned by Kubernetes. | | dp_manager_service.tlsPort | int | `7943` | | | dp_manager_service.type | string | `"ClusterIP"` | | | fullnameOverride | string | `""` | | diff --git a/charts/api7/templates/dp-manager-service.yaml b/charts/api7/templates/dp-manager-service.yaml index e1ccc5c..574f225 100644 --- a/charts/api7/templates/dp-manager-service.yaml +++ b/charts/api7/templates/dp-manager-service.yaml @@ -19,10 +19,24 @@ spec: targetPort: http protocol: TCP name: http + {{- if eq .Values.dp_manager_service.type "NodePort" }} + {{- if .Values.dp_manager_service.autoAssignNodePort }} + nodePort: {{ .Values.dp_manager_service.port }} + {{- else if .Values.dp_manager_service.nodePort }} + nodePort: {{ .Values.dp_manager_service.nodePort }} + {{- end }} + {{- end }} - port: {{ .Values.dp_manager_service.tlsPort }} targetPort: https protocol: TCP name: https + {{- if eq .Values.dp_manager_service.type "NodePort" }} + {{- if .Values.dp_manager_service.autoAssignNodePort }} + nodePort: {{ .Values.dp_manager_service.tlsPort }} + {{- else if .Values.dp_manager_service.tlsNodePort }} + nodePort: {{ .Values.dp_manager_service.tlsNodePort }} + {{- end }} + {{- end }} selector: {{- include "api7ee3.selectorLabels" . | nindent 4 }} diff --git a/charts/api7/values.yaml b/charts/api7/values.yaml index fb1f5cd..8637779 100644 --- a/charts/api7/values.yaml +++ b/charts/api7/values.yaml @@ -171,6 +171,12 @@ dp_manager_service: annotations: {} port: 7900 tlsPort: 7943 + # -- Whether to set nodePort to the same value as the HTTP/HTTPS port when dp_manager_service.type is NodePort, make sure the nodePort to be in the valid NodePort range of kubernetes service. + autoAssignNodePort: false + # -- (int) The nodePort for HTTP service, only used if dp_manager_service.type is NodePort. If not set, a random port will be assigned by Kubernetes. + nodePort: null + # -- (int) The nodePort for HTTPS service, only used if dp_manager_service.type is NodePort. If not set, a random port will be assigned by Kubernetes. + tlsNodePort: null ingress: enabled: false className: "" From 9bb5ea3526ff827c0e515d52b83367aa267df6bb Mon Sep 17 00:00:00 2001 From: Baoyuan Date: Tue, 31 Mar 2026 09:47:45 +0800 Subject: [PATCH 2/2] fix: address PR review comments - Update README version badge to 0.17.48 - Add port range validation for autoAssignNodePort: fail if port/tlsPort is outside 30000-32767 when autoAssignNodePort is true --- charts/api7/README.md | 2 +- charts/api7/templates/dp-manager-service.yaml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/charts/api7/README.md b/charts/api7/README.md index 8eba4ef..0cf64e4 100644 --- a/charts/api7/README.md +++ b/charts/api7/README.md @@ -1,6 +1,6 @@ # api7ee3 -![Version: 0.17.47](https://img.shields.io/badge/Version-0.17.47-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.9.7](https://img.shields.io/badge/AppVersion-3.9.7-informational?style=flat-square) +![Version: 0.17.48](https://img.shields.io/badge/Version-0.17.48-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.9.7](https://img.shields.io/badge/AppVersion-3.9.7-informational?style=flat-square) A Helm chart for Kubernetes diff --git a/charts/api7/templates/dp-manager-service.yaml b/charts/api7/templates/dp-manager-service.yaml index 574f225..92f0245 100644 --- a/charts/api7/templates/dp-manager-service.yaml +++ b/charts/api7/templates/dp-manager-service.yaml @@ -11,6 +11,14 @@ metadata: {{- end }} spec: type: {{ .Values.dp_manager_service.type }} + {{- if and (eq .Values.dp_manager_service.type "NodePort") .Values.dp_manager_service.autoAssignNodePort }} + {{- if or (lt (int .Values.dp_manager_service.port) 30000) (gt (int .Values.dp_manager_service.port) 32767) }} + {{- fail (printf "dp_manager_service.port (%d) must be between 30000 and 32767 when autoAssignNodePort is true" (int .Values.dp_manager_service.port)) }} + {{- end }} + {{- if or (lt (int .Values.dp_manager_service.tlsPort) 30000) (gt (int .Values.dp_manager_service.tlsPort) 32767) }} + {{- fail (printf "dp_manager_service.tlsPort (%d) must be between 30000 and 32767 when autoAssignNodePort is true" (int .Values.dp_manager_service.tlsPort)) }} + {{- end }} + {{- end }} {{- if .Values.dp_manager_service.loadBalancerClass }} loadBalancerClass: {{ .Values.dp_manager_service.loadBalancerClass }} {{- end }}