Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
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
17 changes: 7 additions & 10 deletions charts/apisix/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,13 @@ data:
enable_ipv6: {{ .Values.apisix.enableIPv6 }} # Enable nginx IPv6 resolver
enable_http2: {{ .Values.apisix.enableHTTP2 }}
enable_server_tokens: {{ .Values.apisix.enableServerTokens }} # Whether the APISIX version number should be shown in Server header

# proxy_protocol: # Proxy Protocol configuration
# listen_http_port: 9181 # The port with proxy protocol for http, it differs from node_listen and admin_listen.
# # This port can only receive http request with proxy protocol, but node_listen & admin_listen
# # can only receive http request. If you enable proxy protocol, you must use this port to
# # receive http request with proxy protocol
# listen_https_port: 9182 # The port with proxy protocol for https
# enable_tcp_pp: true # Enable the proxy protocol for tcp proxy, it works for stream_proxy.tcp option
# enable_tcp_pp_to_upstream: true # Enables the proxy protocol to the upstream server

{{- if .Values.apisix.proxyProtocol.enabled }}
proxy_protocol:
listen_http_port: {{ .Values.apisix.proxyProtocol.listen_http_port | default 9181 }}
listen_https_port: {{ .Values.apisix.proxyProtocol.listen_https_port | default 9182 }}
enable_tcp_pp: {{ .Values.apisix.proxyProtocol.enable_tcp_pp }}
enable_tcp_pp_to_upstream: {{ .Values.apisix.proxyProtocol.enable_tcp_pp_to_upstream }}
{{- end }}
proxy_cache: # Proxy Caching configuration
cache_ttl: 10s # The default caching time if the upstream does not specify the cache time
zones: # The parameters of a cache
Expand Down
10 changes: 9 additions & 1 deletion charts/apisix/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,15 @@ spec:
- name: http-{{ .port | toString }}
containerPort: {{ .port }}
protocol: TCP
{{- end }}
{{- end }}
{{- if .Values.apisix.proxyProtocol.enabled }}
- name: proxy-http
containerPort: {{ .Values.apisix.proxyProtocol.listen_http_port | default 9181 }}
protocol: TCP
- name: proxy-https
containerPort: {{ .Values.apisix.proxyProtocol.listen_https_port | default 9182 }}
protocol: TCP
{{- end }}
- name: tls
containerPort: {{ .Values.apisix.ssl.containerPort }}
protocol: TCP
Expand Down
8 changes: 8 additions & 0 deletions charts/apisix/templates/service-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ spec:
{{- if .Values.service.http.enabled }}
- name: apisix-gateway
port: {{ .Values.service.http.servicePort }}
{{- if .Values.apisix.proxyProtocol.enabled }}
targetPort: {{ .Values.apisix.proxyProtocol.listen_http_port | default 9181 }}
{{- else }}
targetPort: {{ .Values.service.http.containerPort }}
{{- end }}
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.http.nodePort))) }}
nodePort: {{ .Values.service.http.nodePort }}
{{- end }}
Expand All @@ -65,7 +69,11 @@ spec:
{{- if or .Values.apisix.ssl.enabled }}
- name: apisix-gateway-tls
port: {{ .Values.service.tls.servicePort }}
{{- if .Values.apisix.proxyProtocol.enabled }}
targetPort: {{ .Values.apisix.proxyProtocol.listen_https_port | default 9182 }}
{{- else }}
targetPort: {{ .Values.apisix.ssl.containerPort }}
{{- end }}
{{- if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.tls.nodePort))) }}
nodePort: {{ .Values.service.tls.nodePort }}
{{- end }}
Expand Down
7 changes: 6 additions & 1 deletion charts/apisix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,12 @@ apisix:
luaSharedDicts: []
# - name: prometheus-metrics
# size: 20m

proxyProtocol:
enabled: false
listen_http_port: 9181
listen_https_port: 9182
enable_tcp_pp: true
enable_tcp_pp_to_upstream: true
discovery:
# -- Enable or disable Apache APISIX integration service discovery
enabled: false
Expand Down
Loading