From 335e373cf40fafa16e86ce6a3a39b36295acf44d Mon Sep 17 00:00:00 2001 From: Avanish Yadav Date: Tue, 14 Apr 2026 17:30:55 +0530 Subject: [PATCH 1/3] feat: add DNS policy and configuration options for gateway and dataservice --- .../templates/dataservice/deployment.yaml | 10 ++++++ .../templates/gateway/config.yaml | 2 +- .../templates/gateway/deployment.yaml | 10 ++++++ charts/portkey-gateway/values.yaml | 35 ++++++++++++++++++- 4 files changed, 55 insertions(+), 2 deletions(-) diff --git a/charts/portkey-gateway/templates/dataservice/deployment.yaml b/charts/portkey-gateway/templates/dataservice/deployment.yaml index e4749f2..50a8c69 100644 --- a/charts/portkey-gateway/templates/dataservice/deployment.yaml +++ b/charts/portkey-gateway/templates/dataservice/deployment.yaml @@ -124,4 +124,14 @@ spec: hostAliases: {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.dataservice.deployment.dnsPolicy }} + {{- if and (eq .Values.dataservice.deployment.dnsPolicy "None") (empty .Values.dataservice.deployment.dnsConfig.nameservers) }} + {{- fail "dataservice: dnsPolicy \"None\" requires at least one entry in dataservice.deployment.dnsConfig.nameservers" }} + {{- end }} + dnsPolicy: {{ .Values.dataservice.deployment.dnsPolicy }} + {{- end }} + {{- with .Values.dataservice.deployment.dnsConfig }} + dnsConfig: + {{- toYaml . | nindent 8 }} + {{- end }} {{- end -}} \ No newline at end of file diff --git a/charts/portkey-gateway/templates/gateway/config.yaml b/charts/portkey-gateway/templates/gateway/config.yaml index 586320c..ba5aa8c 100644 --- a/charts/portkey-gateway/templates/gateway/config.yaml +++ b/charts/portkey-gateway/templates/gateway/config.yaml @@ -8,7 +8,7 @@ metadata: {{- include "gateway.labels" . }} data: {{- range $key, $val := .Values.environment.data }} - {{ $key }}: {{- if not (kindIs "invalid" $val) }} {{ $val | toString | b64enc }} {{- else }} "" {{- end }} + {{ $key }}: {{- if $val }} {{ $val | b64enc }} {{- else }} "" {{- end }} {{- end -}} {{- else -}} apiVersion: v1 diff --git a/charts/portkey-gateway/templates/gateway/deployment.yaml b/charts/portkey-gateway/templates/gateway/deployment.yaml index 3e82443..974085e 100644 --- a/charts/portkey-gateway/templates/gateway/deployment.yaml +++ b/charts/portkey-gateway/templates/gateway/deployment.yaml @@ -121,4 +121,14 @@ spec: {{- with .Values.hostAlias }} hostAliases: {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.dnsPolicy }} + {{- if and (eq .Values.dnsPolicy "None") (empty .Values.dnsConfig.nameservers) }} + {{- fail "gateway: dnsPolicy \"None\" requires at least one entry in dnsConfig.nameservers" }} + {{- end }} + dnsPolicy: {{ .Values.dnsPolicy }} + {{- end }} + {{- with .Values.dnsConfig }} + dnsConfig: + {{- toYaml . | nindent 8 }} {{- end }} \ No newline at end of file diff --git a/charts/portkey-gateway/values.yaml b/charts/portkey-gateway/values.yaml index 66195c0..a76cbf4 100644 --- a/charts/portkey-gateway/values.yaml +++ b/charts/portkey-gateway/values.yaml @@ -148,7 +148,7 @@ environment: FINETUNES_AWS_ROLE_ARN: SERVER_MODE: "" MCP_PORT: "8788" - MCP_GATEWAY_BASE_URL: "" + MCP_GATEWAY_BASE_URL: serviceAccount: # Specifies whether a service account should be created @@ -331,6 +331,24 @@ affinity: {} # - "www.example.com" hostAlias: [] +# DNS policy for the gateway pod. +# Valid values: ClusterFirst (default), ClusterFirstWithHostNet, Default, None +# NOTE: When set to "None", dnsConfig must be provided with at least one nameserver. +dnsPolicy: "" + +# Custom DNS configuration for the gateway pod. +# Only applied when dnsPolicy is set. +# Example: +# dnsConfig: +# nameservers: +# - 1.2.3.4 +# searches: +# - ns1.svc.cluster.local +# options: +# - name: ndots +# value: "5" +dnsConfig: {} + # if you want to restart instance automatically autoRestart: false @@ -397,6 +415,21 @@ dataservice: # - "example.com" # - "www.example.com" hostAlias: [] + # DNS policy for the dataservice pod. + # Valid values: ClusterFirst (default), ClusterFirstWithHostNet, Default, None + # NOTE: When set to "None", dnsConfig must be provided with at least one nameserver. + dnsPolicy: "" + # Custom DNS configuration for the dataservice pod. + # Example: + # dnsConfig: + # nameservers: + # - 1.2.3.4 + # searches: + # - ns1.svc.cluster.local + # options: + # - name: ndots + # value: "5" + dnsConfig: {} service: type: ClusterIP port: 8081 From 906e87186398f1a28c413810d063a7bd1a78f7df Mon Sep 17 00:00:00 2001 From: Avanish Yadav Date: Tue, 14 Apr 2026 17:32:22 +0530 Subject: [PATCH 2/3] feat: add DNS policy and configuration options for gateway and dataservice --- charts/portkey-gateway/templates/gateway/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/portkey-gateway/templates/gateway/config.yaml b/charts/portkey-gateway/templates/gateway/config.yaml index ba5aa8c..586320c 100644 --- a/charts/portkey-gateway/templates/gateway/config.yaml +++ b/charts/portkey-gateway/templates/gateway/config.yaml @@ -8,7 +8,7 @@ metadata: {{- include "gateway.labels" . }} data: {{- range $key, $val := .Values.environment.data }} - {{ $key }}: {{- if $val }} {{ $val | b64enc }} {{- else }} "" {{- end }} + {{ $key }}: {{- if not (kindIs "invalid" $val) }} {{ $val | toString | b64enc }} {{- else }} "" {{- end }} {{- end -}} {{- else -}} apiVersion: v1 From ba0ea293766d117e45b27bf50ebd30fa450015f5 Mon Sep 17 00:00:00 2001 From: Avanish Yadav Date: Tue, 14 Apr 2026 18:29:29 +0530 Subject: [PATCH 3/3] fix: clarify DNS configuration requirements --- charts/portkey-gateway/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/portkey-gateway/values.yaml b/charts/portkey-gateway/values.yaml index a76cbf4..0abfe71 100644 --- a/charts/portkey-gateway/values.yaml +++ b/charts/portkey-gateway/values.yaml @@ -148,7 +148,7 @@ environment: FINETUNES_AWS_ROLE_ARN: SERVER_MODE: "" MCP_PORT: "8788" - MCP_GATEWAY_BASE_URL: + MCP_GATEWAY_BASE_URL: "" serviceAccount: # Specifies whether a service account should be created @@ -337,7 +337,7 @@ hostAlias: [] dnsPolicy: "" # Custom DNS configuration for the gateway pod. -# Only applied when dnsPolicy is set. +# Required when dnsPolicy is "None" (must include at least one nameserver). # Example: # dnsConfig: # nameservers: