-
Notifications
You must be signed in to change notification settings - Fork 2k
could not build server_names_hash, you should increase server_names_hash_bucket_size: 64 #34
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
Comments
Thanks for the feedback. Yes, we don't have a mechanism to customize this parameter yet. I'll add it to our list of things. To customize the server_names_hash_bucket_size parameter, you need to change the default nginx.conf file and add this file to the image, replacing the /etc/nginx/nginx.conf. I'll add this file to the repo and include adding it in the Dockerfile, so that people can easily customize if they need it. |
Ok great - I'll give that a go, many thanks @pleshakov |
@rawlingsj please check https://github.com/nginxinc/kubernetes-ingress/blob/master/examples/customization/nginx-config.yaml . |
great thanks @pleshakov I'll give it a go as soon as I can, hopefully in the next day or so. |
I've only just got around to testing this sorry. I've added the config map which from the logs looks like it's read however the controller still seems to use the default nginx config rather than the overrides in the default/nginx-config configmap. I've increased the I still get the error Am I doing something wrong? ConfigMap created in the
RC:
The full log:
|
I think I figured it out and have submitted the PR above, I ca certainly override server_names_hash_bucket_size using a config map now. I suspect the reason there was no default added before was because the nginx defaults depend on the size of the processor’s cache line see http://nginx.org/en/docs/http/ngx_http_core_module.html#server_names_hash_bucket_size But without a default then the controller logic wasn't overriding the value when I added it to the config map. Anyways, things are working here with that PR fix however may want to implement a different fix. |
From the logs I see that the controller didn't use the values from the configmap: it didn't update the main configuration file and when it was writing the config files to the I think it was a timing issue: the controller wrote the config files before it started to use the values from the configmap. Do you see that the issue appears consistently? Yes, the reason there is no default value for the The possible solutions I see:
|
Yeah it was happening every time.
Makes sense, I'll close that PR I submitted as it's not a fix.
Ok cool - which ever route you prefer to go down I'm happy to build from a fork and test against my setup before you merge if that helps. |
The problem is still happening with Kubernetes 1.5.2 and nginx-ingress chart nginx-ingress-0.3.2.tgz (which uses image gcr.io/google_containers/nginx-ingress-controller:0.8.3), on an AWS EC2 instance t2.medium.
Repro steps:
|
@kenden |
@kenden looks like mistype in nginx ingress config map |
@afoninsky @pleshakov That was it, it works after setting |
@kenden Thanks. It works for me after setting server-name-hash-bucket-size: "1024" in the configMap. T |
Due to the long upstream server names we use, we were getting errors on startup. The errors mentioned that we should increase this value. Error looks something like this ... ``` 2017/10/30 19:48:54 [emerg] 1#1: could not build server_names_hash, you should increase server_names_hash_bucket_size: 64 nginx: [emerg] could not build server_names_hash, you should increase server_names_hash_bucket_size: 64 ``` Sources: * http://nginx.org/en/docs/http/ngx_http_core_module.html#server_names_hash_bucket_size * nginx/kubernetes-ingress#34
I'm deploying nginxdemos/nginx-ingress:0.3 as an RC but the pod goes into ERROR status.
From a bit of googling a suggested workaround is to edit the http{} nginx configuration..
but I can't figure out if I can do that. Even if the config isn't able to be customised yet yet I still don't know how I can build my own image adding in the http config. Any pointers?
Pod logs...
The text was updated successfully, but these errors were encountered: