Skip to content

Commit ccc8960

Browse files
authored
APISIX Ingress Controller Helm Chart - NGINX config snippets support (#828)
1 parent 303da00 commit ccc8960

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

charts/apisix-ingress-controller/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ The same for container level, you need to set:
148148
| fullnameOverride | string | `""` | |
149149
| gateway.externalIPs | list | `[]` | load balancer ips |
150150
| gateway.externalTrafficPolicy | string | `"Cluster"` | |
151+
| gateway.nginx.configurationSnippet | object | `{"httpAdmin":"","httpEnd":"","httpSrv":"","httpStart":"","main":"","stream":""}` | Custom configuration snippet. |
151152
| gateway.nginx.errorLog | string | `"stderr"` | Nginx error logs path |
152153
| gateway.nginx.errorLogLevel | string | `"warn"` | Nginx error logs level |
153154
| gateway.nginx.workerConnections | string | `"10620"` | Nginx worker connections |

charts/apisix-ingress-controller/templates/apisix-configmap.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,24 @@ data:
7575
worker_rlimit_nofile: {{ .Values.gateway.nginx.workerRlimitNofile }} # the number of files a worker process can open, should be larger than worker_connections
7676
event:
7777
worker_connections: {{ .Values.gateway.nginx.workerConnections }}
78+
{{- if .Values.gateway.nginx.configurationSnippet.main }}
79+
main_configuration_snippet: {{- toYaml .Values.gateway.nginx.configurationSnippet.main | indent 6 }}
80+
{{- end }}
81+
{{- if .Values.gateway.nginx.configurationSnippet.httpStart }}
82+
http_configuration_snippet: {{- toYaml .Values.gateway.nginx.configurationSnippet.httpStart | indent 6 }}
83+
{{- end }}
84+
{{- if .Values.gateway.nginx.configurationSnippet.httpEnd }}
85+
http_end_configuration_snippet: {{- toYaml .Values.gateway.nginx.configurationSnippet.httpEnd | indent 6 }}
86+
{{- end }}
87+
{{- if .Values.gateway.nginx.configurationSnippet.httpSrv }}
88+
http_server_configuration_snippet: {{- toYaml .Values.gateway.nginx.configurationSnippet.httpSrv | indent 6 }}
89+
{{- end }}
90+
{{- if .Values.gateway.nginx.configurationSnippet.httpAdmin }}
91+
http_admin_configuration_snippet: {{ toYaml .Values.gateway.nginx.configurationSnippet.httpAdmin | indent 6 }}
92+
{{- end }}
93+
{{- if .Values.gateway.nginx.configurationSnippet.stream }}
94+
stream_configuration_snippet: {{- toYaml .Values.gateway.nginx.configurationSnippet.stream | indent 6 }}
95+
{{- end }}
7896
7997
plugins: # plugin list (sorted by priority)
8098
- real-ip # priority: 23000

charts/apisix-ingress-controller/values.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,20 @@ gateway:
248248
errorLog: stderr
249249
# -- Nginx error logs level
250250
errorLogLevel: warn
251+
# -- Custom configuration snippet.
252+
configurationSnippet:
253+
main: |
254+
255+
httpStart: |
256+
257+
httpEnd: |
258+
259+
httpSrv: |
260+
261+
httpAdmin: |
262+
263+
stream: |
264+
251265
resources: {}
252266
securityContext: {}
253267
# capabilities:

0 commit comments

Comments
 (0)