Skip to content

fix(gwapi): allow custom nginx.conf #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
40 changes: 40 additions & 0 deletions base-kustomize/gateway/base/files/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
load_module /usr/lib/nginx/modules/ngx_http_js_module.so;
include /etc/nginx/module-includes/*.conf;

worker_processes auto;

pid /var/run/nginx/nginx.pid;
error_log stderr info;

events {
worker_connections 1024;
}

http {
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/mime.types;
js_import /usr/lib/nginx/modules/njs/httpmatches.js;

default_type application/octet-stream;

proxy_headers_hash_bucket_size 512;
proxy_headers_hash_max_size 1024;
proxy_buffer_size 16k;
proxy_buffers 4 16k;
server_names_hash_bucket_size 256;
server_names_hash_max_size 1024;
variables_hash_bucket_size 512;
variables_hash_max_size 1024;

sendfile on;
tcp_nopush on;

server {
listen unix:/var/run/nginx/nginx-status.sock;
access_log off;

location /stub_status {
stub_status;
}
}
}
15 changes: 15 additions & 0 deletions base-kustomize/gateway/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
resources:
- all.yaml
patches:
- path: nginx-conf-override.yaml
target:
kind: Deployment
name: nginx-gateway-fabric
namespace: nginx-gateway
configMapGenerator:
- name: nginx-conf-override
namespace: nginx-gateway
options:
disableNameSuffixHash: true
files:
- files/nginx.conf
21 changes: 21 additions & 0 deletions base-kustomize/gateway/base/nginx-conf-override.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# A patch to override `nginx.conf` to support changes to
# the Nginx configuration that are otherwise not possible.
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-gateway-fabric
namespace: nginx-gateway
spec:
template:
spec:
containers:
- name: nginx
volumeMounts:
- mountPath: /etc/nginx/nginx.conf
name: nginx-conf-override
subPath: nginx.conf
volumes:
- name: nginx-conf-override
configMap:
name: nginx-conf-override
10 changes: 7 additions & 3 deletions docs/infrastructure-gateway-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,15 @@ There are various implementations of the Gateway API. In this document, we will
=== "Stable _(Recommended)_"

``` shell
cd /opt/genestack/submodules/nginx-gateway-fabric/charts/nginx-gateway-fabric
cd /opt/genestack/submodules/nginx-gateway-fabric/charts

helm upgrade --install nginx-gateway-fabric . \
helm upgrade --install nginx-gateway-fabric ./nginx-gateway-fabric \
--namespace=nginx-gateway \
-f /etc/genestack/helm-configs/nginx-gateway-fabric/helm-overrides.yaml
--wait \
--timeout 10m \
-f /opt/genestack/base-helm-configs/nginx-gateway-fabric/helm-overrides.yaml \
--post-renderer /opt/genestack/base-kustomize/kustomize.sh \
--post-renderer-args gateway/base
```

=== "Experimental"
Expand Down
Loading