@@ -97,23 +97,24 @@ data:
9797 listen_port: {{ .Values.gateway.tls.port }}
9898 ssl_protocols: "TLSv1 TLSv1.1 TLSv1.2 TLSv1.3"
9999 ssl_ciphers: "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA"
100- {{- if .Values.cloud.domain }}
101- ssl_trusted_certificate: "/usr/local/apisix/conf/cloud-ssl/{{ .Values.cloud.certCAFilename }}"
102- {{- else if and .Values.gateway.tls.enabled .Values.gateway.tls.existingCASecret }}
100+ {{- if and .Values.gateway.tls.enabled .Values.gateway.tls.existingCASecret }}
103101 ssl_trusted_certificate: "/usr/local/apisix/conf/ssl/{{ .Values.gateway.tls.certCAFilename }}"
104102 {{- end }}
105103
106104 nginx_config: # config for render the template to genarate nginx.conf
107- error_log: "/dev/stderr "
108- error_log_level: "warn " # warn,error
105+ error_log: "{{ .Values.logs.errorLog }} "
106+ error_log_level: "{{ .Values.logs.errorLogLevel }} " # warn,error
109107 worker_processes: {{ .Values.gateway.workerProcesses }}
110108 worker_rlimit_nofile: 20480 # the number of files a worker process can open, should be larger than worker_connections
111109 event:
112110 worker_connections: 10620
113111 http:
114- access_log: "/dev/stdout"
115- access_log_format: "$remote_addr - $remote_user [$time_local] $http_host \"$request\" $status $body_bytes_sent $request_time \"$http_referer\" \"$http_user_agent\" $upstream_addr $upstream_status $upstream_response_time \"$upstream_scheme://$upstream_host$upstream_uri\""
116- access_log_format_escape: default # allows setting json or default characters escaping in variables
112+ enable_access_log: {{ .Values.logs.enableAccessLog }}
113+ {{- if .Values.logs.enableAccessLog }}
114+ access_log: "{{ .Values.logs.accessLog }}"
115+ access_log_format: "{{ .Values.logs.accessLogFormat }}"
116+ access_log_format_escape: {{ .Values.logs.accessLogFormatEscape }}
117+ {{- end }}
117118
118119 keepalive_timeout: 60s # timeout during which a keep-alive client connection will stay open on the server side.
119120 client_header_timeout: 60s # timeout for reading client request header, then 408 (Request Time-out) error is returned to the client
@@ -129,12 +130,14 @@ data:
129130 real_ip_from: # http://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from
130131 - 127.0.0.1
131132 - 'unix:'
132- {{- if .Values.cloudProxy.enabled }}
133- lua_shared_dicts: # add custom shared cache to nginx.conf
134- etcd_token_cache: 10m
135- cloud_proxy_lock: 1m
133+
134+ {{- if .Values.customLuaSharedDicts }}
135+ custom_lua_shared_dict: # add custom shared cache to nginx.conf
136+ {{- range $dict := .Values.customLuaSharedDicts }}
137+ {{ $dict.name }}: {{ $dict.size }}
138+ {{- end }}
136139 {{- end }}
137- # ipc_shared_dict: 100m # custom shared cache, format: `cache-key: cache-size`
140+
138141 {{- if .Values.configurationSnippet.main }}
139142 main_configuration_snippet: {{ toYaml .Values.configurationSnippet.main | indent 6 }}
140143 {{- end }}
@@ -160,13 +163,9 @@ data:
160163 - "http://{{ .Release.Name }}-etcd.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.etcd.service.port }}"
161164 {{- else }}
162165 host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster.
163- {{- if .Values.cloud.domain }}
164- - "https://{{ .Values.cloud.domain }}:443"
165- {{- else }}
166166 {{- range $value := .Values.etcd.hosts }}
167167 - "{{ $value }}" # multiple etcd address
168168 {{- end }}
169- {{- end }}
170169 {{- end }}
171170 prefix: {{ .Values.etcd.prefix | quote }} # apisix configurations prefix
172171 timeout: {{ .Values.etcd.timeout }} # 30 seconds
@@ -179,61 +178,31 @@ data:
179178 cert: "/etcd-ssl/{{ .Values.etcd.auth.tls.certFilename }}"
180179 key: "/etcd-ssl/{{ .Values.etcd.auth.tls.certKeyFilename }}"
181180 verify: {{ .Values.etcd.auth.tls.verify }}
182- {{- else if .Values.cloud.domain }}
183- tls:
184- cert: "/usr/local/apisix/conf/cloud-ssl/{{ .Values.cloud.certFilename }}"
185- key: "/usr/local/apisix/conf/cloud-ssl/{{ .Values.cloud.certKeyFilename }}"
186- verify: true
187181 {{- end }}
188182
189- {{- if or .Values.plugins .Values.cloudProxy.enabled }}
183+ {{- if .Values.discovery.enabled }}
184+ discovery:
185+ {{- range $key, $value := .Values.discovery.registry }}
186+ {{ $key }}:
187+ {{- include "apisix.tplvalues.render" (dict "value" $value "context" $) | nindent 8 }}
188+ {{- end }}
189+ {{- end }}
190+
191+ {{- if .Values.plugins }}
190192 plugins: # plugin list
191193 {{- range $plugin := .Values.plugins }}
192- {{- if or (not $.Values.cloud.domain) (ne $plugin "prometheus") }}
193194 - {{ $plugin }}
194195 {{- end }}
195196 {{- end }}
196- {{- end }}
197- {{- if .Values.cloudProxy.enabled }}
198- - cloud-proxy
199- {{- end }}
200- {{- if .Values.cloud.domain }}
201- - cloud-prometheus
202- - cloud
203- {{- end }}
197+
204198 {{- if .Values.stream_plugins }}
205199 stream_plugins:
206200 {{- range $plugin := .Values.stream_plugins }}
207201 - {{ $plugin }}
208202 {{- end }}
209203 {{- end }}
210- {{- if or .Values.plugin_attr .Values.cloudProxy.enabled }}
204+
205+ {{- if .Values.plugin_attr }}
211206 plugin_attr: # plugin attr
212- {{- range $key, $attr := .Values.plugin_attr }}
213- {{- if or (ne $key "prometheus") (not $.Values.cloud.domain) }}
214- {{ $key | indent 2 }}: {{- toYaml $attr | nindent 8 }}
215- {{- end }}
216- {{- end }}
217- {{- end }}
218- {{- if .Values.cloudProxy.enabled }}
219- cloud-proxy:
220- domain_suffix: {{ .Values.cloudProxy.domain_suffix }}
221- org_salt_size: {{ .Values.cloudProxy.organizationSaltSize }}
222- {{- end }}
223- {{- if .Values.cloud.domain }}
224- cloud-promethues:
225- export_uri: /apisix/prometheus/metrics
226- enable_export_server: true
227- export_addr:
228- ip: "127.0.0.1"
229- port: 9091
230- cloud:
231- domain: {{ .Values.cloud.domain }}
232- port: 443
233- cert: "/usr/local/apisix/conf/cloud-ssl/{{ .Values.cloud.certFilename }}"
234- key: "/usr/local/apisix/conf/cloud-ssl/{{ .Values.cloud.certKeyFilename }}"
235207 {{- toYaml .Values.plugin_attr | nindent 6 }}
236- cloud-proxy:
237- domain_suffix: {{ .Values.cloudProxy.domainSuffix }}
238- org_salt_size: {{ .Values.cloudProxy.organizationSaltSize }}
239208 {{- end }}
0 commit comments