nlopez / k8s_home

Kubernetes
48 stars 6 forks source link

Ingress nginx is not able to read dhparam.pem #16

Open evanrich opened 1 year ago

evanrich commented 1 year ago

I'm not sure how you got this working, but at least with 4.4.0 chart version of ingress-nginx, it fails to start, complaining about no "/nonsecrets/dhparam.pem" existing:

(combined from similar events): Error reloading NGINX: ------------------------------------------------------------------------------- Error: exit status 1 nginx: [warn] the "http2_max_field_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx/nginx-cfg618264682:146 nginx: [warn] the "http2_max_header_size" directive is obsolete, use the "large_client_header_buffers" directive instead in /tmp/nginx/nginx-cfg618264682:147 nginx: [warn] the "http2_max_requests" directive is obsolete, use the "keepalive_requests" directive instead in /tmp/nginx/nginx-cfg618264682:148 nginx: [emerg] BIO_new_file("/tmp/dhparam/dhparam.pem") failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen('/tmp/dhparam/dhparam.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file) nginx: configuration file /tmp/nginx/nginx-cfg618264682 test failed -------------------------------

the exact error: No such file or directory:fopen('/tmp/dhparam/dhparam.pem','r') error:2006D080:BIO routines:BIO_new_file:no such file)

I've tried mounting to /tmp/dhparam as well as /nonsecrets, neither works. I can confirm that within the pod you DO see /nonsecrets/dhparam.pem, and it can be read, so not sure what the issue is, but wondering how you got passed this? I guess I could try going down to 4.3.0, maybe something changed in 4.4.0

evanrich commented 1 year ago

edit: 4.3.0 didn't change anything. pretty weird. I wonder if it's a race condition between the helm chart starting the pod and mounting the configmap? I can try adding it as filesystem mount instead of configmap.

nlopez commented 1 year ago

Strange - does the dhparam file exist if you exec in to the nginx controller pod?

What's a describe pod for a controller pod look like?