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/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..0abfe71 100644 --- a/charts/portkey-gateway/values.yaml +++ b/charts/portkey-gateway/values.yaml @@ -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. +# Required when dnsPolicy is "None" (must include at least one nameserver). +# 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