Skip to content
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

[DOC] Bunkerweb Kubernetes Integration ConfigMap Suggestion #513

Open
polarstack opened this issue Jun 3, 2023 · 0 comments
Open

[DOC] Bunkerweb Kubernetes Integration ConfigMap Suggestion #513

polarstack opened this issue Jun 3, 2023 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation kubernetes Kubernetes integration

Comments

@polarstack
Copy link

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!

@polarstack polarstack added the documentation Improvements or additions to documentation label Jun 3, 2023
@fl0ppy-d1sk fl0ppy-d1sk added this to 1.5.2 in 1.5.X Aug 4, 2023
@fl0ppy-d1sk fl0ppy-d1sk moved this from 1.5.2 to 1.5.3 in 1.5.X Sep 10, 2023
@fl0ppy-d1sk fl0ppy-d1sk self-assigned this Oct 16, 2023
@fl0ppy-d1sk fl0ppy-d1sk removed this from 1.5.3 in 1.5.X Oct 16, 2023
@fl0ppy-d1sk fl0ppy-d1sk added the kubernetes Kubernetes integration label Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation kubernetes Kubernetes integration
Projects
None yet
Development

No branches or pull requests

2 participants