Support NGINX Cache use cases with Cache Policy #4173
Replies: 3 comments 1 reply
-
One thing to consider with the approach of using a If we use JWKS then we add a
If we go with the |
Beta Was this translation helpful? Give feedback.
-
One application example that we have is ingress controller in front of a Moodle installation. In this example a very simple cache was configured:
|
Beta Was this translation helpful? Give feedback.
-
The goal of a Policy is to remove the complexity of needing to understand nginx configuration details. An interesting example recently received looks like the following server and location -snippets: |
Beta Was this translation helpful? Give feedback.
-
During the past months there has been an increasing pace of questions raised about using the NGINX Ingress Controller in cache related use cases.
There is background here for folks unfamiliar: https://docs.nginx.com/nginx/admin-guide/content-cache/content-caching/
Many of these use cases take advantage of the dynamic cache capabilities of NGINX. However, they introduce the complexity of volume mounts which in turn introduces the question of the performance of the storage system behind the volume - to the extreme of RAMdisk.
Cache is a unique use case in Kubernetes. Initially you could say it is not a fit, but as we learn about the type of workloads that customers are hosing in Kubernetes you begin to learn about applications such as Moodle, or store applications that serve the same images over and over again, or other reasons where using ingress as a dynamic cache does make sense.
Not all cache management use cases make sense to enable at the ingress controller, after all it is not a replacement for a CDN. It is rather an augmentation to relieve some stress from the backend systems and give customers a better overall experience.
This might be a good fit for a Policy object. A cache Policy.
This aligns with cache being able to be set at http, server, location in NGINX conf. To align with ingress use cases, this is most likely server and location which align with Ingress, VirtualServer, and VirtualServer Route resources.
proxy_cache_path and the corresponding loader behavior can probably be set using defaults (at least initially) - if these were to be tunable attributes, they should be under the GlobalConfiguration or configMap resource.
Specifying what to cache and limiting or disabling caching and setting byte-range would be contained within the proposed cache Policy. And could be unique or shared across hostnames and paths.
these three sections can be seen in the above article
Purging is a questionable space. The act of manually purging cache is not very 'kubernetes" by nature. And the cache already has valid durations from the previous sections in the Policy. I elect to omit purging controls at this time.
This needs to be followed up with a Policy YAML proposal and a proposal about how to handle this through Helm.
Beta Was this translation helpful? Give feedback.
All reactions