How to apply custom annotation to ingress-nginx?

Greetings,
I’d like to apply an annotation for a custom proxy-read-timeout to nginx-ingress-controller as found here:

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-timeouts

For example, under >> System >> Workloads >> namespace: ingress-nginx
I selected ‘Edit’ for nginx-ingress-controller, then under advanced >> ‘Labels & Annotations’ I added:

nginx.ingress.kubernetes.io/proxy-read-timeout=90

to increase from the default 60, to 90. I then restarted the pods, but when looking in the conf files inside one of the pods, I still see:

proxy_read_timeout 60s;

What is the proper way to do this?

Found a way to do this. If I browse to: myCluster >> System >> Resources >> Config Maps >> edit ‘nginx-configuration’ I can then add Config Map values as set forth here:

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#proxy-read-timeout

The documentation seems to indicate that I could add them as annotations as well, but I haven’t tried that.

Hi,

All ingress-nginx annotations are listed here:

I have successfully applied annotations to an ingress using the gui (under Labels and Annotations). The key of the annotation must include the prefix, e.g. nginx.ingress.kubernetes.io/proxy-read-timeout, then the value in a separate field, unless you paste a name=value pair (or a whole set) in one go, which results in a corresponding set of lines containing keys and values to be added.

I hope this helps.

Thanks for your response @remigius. What object(s) did you successfully apply the annotations to? From what I read in the documentation, I would assume it was the ConfigMap nginx-configuration.

Hi Daniel,

sorry I did not reply earlier.

As mentioned in my previous posting, I have applied the annotation to the ingress itself, to be found under Workloads > Load Balancing, then in the ingress object unter Labels and Annotations.

The config map is used by all ingresses, but I don’t know about the refresh behavior. However, when you update an ingress object, it is refreshed after the update (but the update only applies to a single ingress at a time).

Ah, splendid; applying annotations on an ingress by ingress basis is quite useful! I somehow missed that in your previous post, thanks for clarifying.