Description
Description
Dear all, definitely getting my first hands-on with Kubernetes. Unfortunately in the last few days I was struggling to get Bunkerweb running on Kubernetes Integration. Following the Documentation, the deployment of the Kubernetes objects (ClusterRoles, DaemonSet, etc...) was always fine. But when I tried opening an Ingress, it got always stuck at "generating bunker config". So far I've tried K3s, RKE2 and MicroK8s, none of them was successful. I made sure to not deploy or uninstall any existing Ingress provider. Even tried with Bunkerweb 1.4.8 and of course 1.5.0 - you guess it, didn't work... I was able to circle it around DNS in Kubernetes, somehow nginx was not able to resolve the FQDN of the Kubernetes Services (for example: app1.default.svc.cluster.local), but strangely nslookup did the job. Was also playing around with coredns and kube-dns.
After countless hours of googling and troubleshooting almost all bunkerweb Containers including mysql database, I was able to get it running :-) and bloody hell, it was such a small log line I missed it thousand times before finally seeing it. So I would like to share my findings with you, hoping future users may get Bunkerweb running faster on Kubernetes.
Also excuse me if I have posted it in the wrong label (DOC instead of BUG).
Proposal (optional)
If you install Bunkerweb on Kubernetes, the bunkerweb Pod/Container throws this line during startup:
2023/06/03 16:00:46 [emerg] 19#19: could not build server_names_hash, you should increase server_names_hash_bucket_size: 32
From my perspective there are two options to fix it. (Important: I'm doing this as a hobby and I'm definitely not an expert)
Option A) set a default server_names_hash_bucket_size value and server_names_hash_max_size in the http context of nginx, which is larger than 32. I was able to get it running with 128 for bucket size and 1024 for max_size
Option B) Add a ConfigMap Example to the Documentation, hence the ticket, or Examples in the repository. Below you can see my working Solution
apiVersion: v1
kind: ConfigMap
metadata:
name: cfg-bunkerweb-http-bucket-size
annotations:
bunkerweb.io/CONFIG_TYPE: "http"
data:
myconf: |
server_names_hash_bucket_size 128;
server_names_hash_max_size 1024;
Thank you guys for such a great Software, I really like your concept and work! Hopefully my ticket here might help you simplify the deployment on Kubernetes for beginners as I am.
Cheers!