-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support for TCP/UDP load balancing via stream-snippets configmap key #340
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.
Tested, works in GKE. One question then I'll approve.
@@ -108,3 +108,19 @@ http { | |||
|
|||
include /etc/nginx/conf.d/*.conf; | |||
} | |||
|
|||
stream { |
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.
This stream block will appear even if there are no stream snippets - is that required?
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.
👍
} | ||
server { | ||
listen 4456; | ||
proxy_pass tcp-tea; |
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.
The upstream is called tcp-coffee
in this case. Also, I would choose different port than 80
when giving example for streams :)
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.
good catch. thank you!
- Add stream-snippets configmap key - Add stream-log-format configmap key
5bb04dc
to
89d8de5
Compare
Proposed changes
This PR introduces two ConfigMap keys:
stream-snippets
, which sets a custom snippet in stream context.stream-log-format
, which sets a custom log format for TCP/UDP load balancing in stream context.With
stream-snippets
it is possible to support TCP or UPD load balancing:For NGINX OSS:
Notes for NGINX:
coffee-svc.default.svc.cluster.local
cannot be resolved, NGINX will fail to reloadFor NGINX Plus:
Notes for NGINX Plus:
To apply the ConfigMap run:
You can also check if the config was applied successfully:
Checklist
Before creating a PR, run through this checklist and mark each as complete.