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

make unique warnings #1927

Closed
wants to merge 1 commit into from
Closed

make unique warnings #1927

wants to merge 1 commit into from

Conversation

yacinebbt
Copy link

following your request in the PR #1603, i am recreating this in order to push it in the dev branch.

besides the description in the old PR, here is an example of how this will reduce amount of logs in the bunkerweb controller pod.

here is the logs before adding my commit:

[2025-01-21 10:22:20 +0000] [AUTOCONF] [1] [ℹ️ ] - Instance #3 : bunkerweb-z8w7k
[2025-01-21 10:22:20 +0000] [AUTOCONF] [1] [ℹ️ ] - Processing events ...
[2025-01-21 10:22:21 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number.
[2025-01-21 10:22:21 +0000] [KUBERNETES-CONTROLLER] [1] [ℹ️ ] - Caught kubernetes event (ingress), deploying new configuration ...
[2025-01-21 10:22:21 +0000] [CONFIG] [1] [⚠️ ] - Variable DUMMY_SETTING: value is not a valid setting, ignoring it
[2025-01-21 10:22:21 +0000] [CONFIG] [1] [⚠️ ] - Variable DUMMY_SETTING: value is not a valid setting, ignoring it
[2025-01-21 10:22:21 +0000] [CONFIG] [1] [⚠️ ] - Variable DUMMY_SETTING: value is not a valid setting, ignoring it
[2025-01-21 10:22:21 +0000] [KUBERNETES-CONTROLLER] [1] [ℹ️ ] - Successfully deployed new configuration 🚀
[2025-01-21 10:22:22 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number.
[2025-01-21 10:22:23 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number.
[2025-01-21 10:22:23 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number.
[2025-01-21 10:22:24 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number.
[2025-01-21 10:22:25 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number.
[2025-01-21 10:22:26 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number.
[2025-01-21 10:22:26 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number.
...

as you may notice, the name of the service is not known, as well as the amount of logs that's keeps showing in the pod's logs.

After adding my commit, you'll have something like this:

[2025-01-21 10:55:50 +0000] [AUTOCONF] [1] [ℹ️ ] - Kubernetes mode detected
[2025-01-21 10:55:51 +0000] [CONFIG] [1] [ℹ️ ] - ✅ Database connection established
[2025-01-21 10:55:51 +0000] [AUTOCONF] [1] [ℹ️ ] - Waiting for BunkerWeb instances ...
[2025-01-21 10:55:51 +0000] [AUTOCONF] [1] [ℹ️ ] - BunkerWeb instances are ready 🚀
[2025-01-21 10:55:51 +0000] [AUTOCONF] [1] [ℹ️ ] - Instance #1 : bunkerweb-47r7n
[2025-01-21 10:55:51 +0000] [AUTOCONF] [1] [ℹ️ ] - Instance #2 : bunkerweb-6lqvd
[2025-01-21 10:55:51 +0000] [AUTOCONF] [1] [ℹ️ ] - Instance #3 : bunkerweb-z8w7k
[2025-01-21 10:55:51 +0000] [AUTOCONF] [1] [ℹ️ ] - Processing events ...
[2025-01-21 10:55:52 +0000] [KUBERNETES-CONTROLLER] [1] [⚠️ ] - Ignoring unsupported ingress rule without backend service port number for service hubble-ui.
[2025-01-21 10:55:52 +0000] [KUBERNETES-CONTROLLER] [1] [ℹ️ ] - Successfully deployed new configuration 🚀
[2025-01-21 11:24:10 +0000] [KUBERNETES-CONTROLLER] [1] [ℹ️ ] - Caught kubernetes event (ingress), deploying new configuration ...
[2025-01-21 11:24:10 +0000] [KUBERNETES-CONTROLLER] [1] [ℹ️ ] - Successfully deployed new configuration 🚀

in my case, it was my ingress hubble configured this way:

...
  rules:
    - host: xxxxxxxxxxxxxxxx
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: hubble-ui
                port:
                  name: http 

for all deployed ingresses that will be based on port name instead of port numbers, you'll only have one unique log entry for each ingress along with the ingress name.

@yacinebbt
Copy link
Author

it is important to mention that the file i used to test this, was the src/autoconf/IngressController.py in the master branch.

@TheophileDiot
Copy link
Member

Hi @yacinebbt, we'll probably remove the log anyways but thank you for pointing it out

@TheophileDiot
Copy link
Member

92ef874

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants