-
Notifications
You must be signed in to change notification settings - Fork 417
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
feat(streams): add support for nginx streams #292
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thomas-thorburn-connect this seems a nice addition to the formula!
There are a few minor format/code quality issues (some whitespaces at the end of some lines).
Also, if you can add some tests for this code, similar the the tests for snippets, that'd be great.
@@ -202,3 +212,7 @@ | |||
}) %} | |||
{% endif %} | |||
{% endif %} | |||
|
|||
{% if salt['grains.get']('os_family') == 'FreeBSD' %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a whitespace after the closing bracket, that tests are showing. Can you remove it?
@@ -105,7 +105,16 @@ nginx: | |||
- upstream netdata: | |||
- server: 127.0.0.1:19999 | |||
- keepalive: 64 | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are whitespaces after the closing bracket, that tests are showing. Can you remove them?
- server: | ||
- listen: 7000 | ||
- proxy_pass: some_upstream | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are whitespaces after the closing bracket, that tests are showing. Can you remove them?
PR progress checklist (to be filled in by reviewers)
What type of PR is this?
Primary type
[build]
Changes related to the build system[chore]
Changes to the build process or auxiliary tools and libraries such as documentation generation[ci]
Changes to the continuous integration configuration[feat]
A new feature[fix]
A bug fix[perf]
A code change that improves performance[refactor]
A code change that neither fixes a bug nor adds a feature[revert]
A change used to revert a previous commit[style]
Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)Secondary type
[docs]
Documentation changes[test]
Adding missing or correcting existing testsDoes this PR introduce a
BREAKING CHANGE
?No.
Related issues and/or pull requests
N/A
Describe the changes you're proposing
Currently the formula does not have support for streams (TCP and UDP loadbalancing), and putting it in the nginx.conf file doesn't work due to key conflicts (the
server
key is used for the main config, but also used by streams). Either way, I couldn't get it right and it seems a bit cleaner in my opinion to have streams working like snippets instead of putting everything in the main config.see https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/
Pillar / config required to test the proposed changes
I exactly copied and pasted the snippets functionality and changed it to streams, and added some defaults to the map file. I don't know how to test it, but am willing to learn. It's working for my use case so far, for what it's worth
Debug log showing how the proposed changes work
Documentation checklist
README
(e.g.Available states
). ---> N/Apillar.example
.Testing checklist
state_top
).Additional context
I've tried squashing the PR into a single commit that conforms to the commit message guidelines with little success.
As per the title the squash message should be