We have discussed "Setup Nginx-Gateway Routes and Create Gateway Policies to Map with Ingress Nginx Annotations" in a previous post. However, we have not setup all that were previously set via ingress-nginx annotations, and only partial setup was made using ClientSettingsPolicy and UpstreamSettingsPolicy. Some proxy annotations that we used with ingress-nginx can only be setup by using a SnippetsFilter.
Such SnippetsFilter is shown below for example.
The above is similar to setting up below annotations in ingress-nginx.
In addtional to above 4 settings we have set proxy_request_buffering to off as well.
Now let's check how we can get snippetsfilter setup properly for given routes. The first step is to enable snippets in nginx gateway fabric. This can be done via helm deployment by setting nginxGateway.snippets.enable=true.
Full helm setup below, and refer the blog here for more details.
When above helm deployed nginx gateway fabric should have the --snippets in controller.
Then we can setup snippetsfilter using below yaml. Note that here we keep proxy_request_buffering on; for elastic search and kibana, and have increased timeout for reads.
Once created the snippetsfilter should have the status of accepted as shown below.
Then we can use the snippetsfilter in the routes as shown below. The change is shown in the picture. Each route needs to be added with relevant snippetsfilter. The snippets filter should stay in same namespace as HTTPRoute.
Th applied route should have ResolvedRefs status as True, indication ExtensionRef of snippetsfilter is correctly resoved for the httproute. This will make the settings in snippetsfilter to get applied to the httproute.
Below is comparision of ingress nginx annotations and which way to set them up in nginx-gateway.
No comments:
Post a Comment