-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Predefined server-snippet
that can only be reference and used in ingress
#11259
Comments
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There is no interest in the project to keep adding new annotations on-demand. The reason is that the volume of unique important use-cases is too large to cater to all expectations. Meaning if annotations are created for all requirements, then it becomes a combination of limited use of huge maintenance effort, of non-generic annotations or other features. Secondly, the planning and execution of the Gateway API is already underway. The Gateway API will impact many expectations and alter designs. So adding annotations is not a improvement. Thank you for your other contribution of gRPC_timeout annotation. That timeout annotation exists for HTTP but not for gRPC. So its a generic use-case for all gRPC deployments and hence its a improvement. Wait for comments from others. |
sure, i don't want to add annotations directly in this repo, that will bring chaos (like you said). 😄 i just want a mechanism that support custom annotations at runtime, like https://docs.nginx.com/nginx-ingress-controller/configuration/ingress-resources/custom-annotations/.
so, we don't need to create a full set of codes for annotation, just expose a map of variables for tmpl. (let's see others 👍 ) |
I don't think this project's controller has the design & architecture for supporting anything resembling dynamic runtime annotations. Wait for other comments. |
This is stale, but we won't close it automatically, just bare in mind the maintainers may be busy with other tasks and will reach your issue ASAP. If you have any question or request to prioritize this, please reach |
I have a similar use-case but for I think having a feature such as this is a reasonable compromise. It would let you pre-define trusted custom snippets, and then opt-in usage of them where required. This contrasts how This could look like: apiVersion: v1
kind: ConfigMap
metadata:
name: ingress-nginx-controller
namespace: ingress-nginx
data:
allow-snippet-annotations: "false"
enable-opentelemetry: "true"
configuration-snippets: |
- name: "add-foo-header"
snippet: |
add_header Foo "Bar";
- name: "do-not-proxy-cookies"
snippet: |
proxy_set_header Cookie "";
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/enable-configuration-snippets: "add-foo-header,do-not-proxy-cookies"
name: foo
namespace: default
spec:
ingressClassName: ingress-nginx
rules:
- host: foo.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: backend
port:
number: 80 |
I believe this is partially possible today, it requires you to mount a custom nginx template file, then you can add code like they have here in the NGINX ingress documentation. Instead of doing
I think this could be simplified if it were a first class feature, plus you wouldn't need to maintain your own nginx template. Links:
|
What do you want to happen?
We want to host a set of multi-tenant applications in our cluster. There are a lot of similar
server-snippets
in those ingresses, e.g. filter header, redirection. Because everyone shares a same nginx-controller, so we want to limit or even stop the use of snippets to secure our platform.So we're wondering if it's possible to have:
snippets
in a custom nginx.tmplSo, we can ensure
server-snippets
is used under restricted conditions.Is there currently another issue associated with this?
No
Does it require a particular kubernetes version?
No (only nginx template rendering)
If this is actually about documentation, uncomment the following block
No
The text was updated successfully, but these errors were encountered: