-
Notifications
You must be signed in to change notification settings - Fork 25
[WIP] Add controller pod list in nginx configuration templating #158
Conversation
The following annotations will be added: - enable-modsecurity - enable-owasp-core-rules - modsecurity-transaction-id Fixes kubernetes#3167
Customize ModSecurity to be used in Locations
Signed-off-by: mooncake <[email protected]>
Fix typos: reqrite -> rewrite
Update annotations.md. Remove Duplication.
Modify the wrong function name
Add e2e test for round robin load balancing
Signed-off-by: mooncake <[email protected]>
Fix some documents issues
Update nginx and e2e image
Restructure load balance e2e tests and update round robin test
Prevent X-Forwarded-Proto forward during external auth subrequest
fix logging calls
bugfix: set canary attributes when initializing balancer
… it for client_max_body_size
Convert isValidClientBodyBufferSize to something more generic
Add Snippet for ModSecurity
Set proxy_host variable to avoid using default value from proxy_pass
Revert removal of support for TCP and UDP services
Add annotation for session affinity path
Only set cookies on paths that enable session affinity
…_def bugfix: do not merge catch-all canary backends with itself
Here is an example: $ k scale --replicas=3 deployment nginx-ingress-controller
deployment.extensions/nginx-ingress-controller scaled
$ http http://192.168.99.100:31362/debug "Host: http-echo.com"
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 1
Content-Type: text/html
Date: Tue, 20 Nov 2018 20:58:46 GMT
Server: nginx/1.15.6
3
$ k scale --replicas=1 deployment nginx-ingress-controller
deployment.extensions/nginx-ingress-controller scaled
$ http http://192.168.99.100:31362/debug "Host: http-echo.com"
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 1
Content-Type: text/html
Date: Tue, 20 Nov 2018 20:59:27 GMT
Server: nginx/1.15.6
1
$ k scale --replicas=5 deployment nginx-ingress-controller
deployment.extensions/nginx-ingress-controller scaled
$ http http://192.168.99.100:31362/debug "Host: http-echo.com"
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 1
Content-Type: text/html
Date: Tue, 20 Nov 2018 21:00:26 GMT
Server: nginx/1.15.6
5 |
Increase log level when there is an invalid size value
Match buffer
Use struct to pack Ingress and its annotations
Remove initial log error during reconfiguration
return pods | ||
} | ||
|
||
func hasSameOwner(pod1, pod2 *corev1.Pod) bool { |
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.
That's the best way I've found to check if an ingress-nginx pod is under the same deployment than the running pod.
Is there any better function for that un k8s codebase?
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.
I can not think of any better option. One could use namespace but it would not be a complete solution since technically speaking there can be two ingress-nginx deployments under single namespace.
@@ -833,6 +833,10 @@ stream { | |||
|
|||
{{ template "CUSTOM_ERRORS" (buildCustomErrorDeps $all.ProxySetHeaders (collectCustomErrorsPerServer $server)) }} | |||
|
|||
location /debug { | |||
return 200 "{{ len $all.ControllerPods }}"; |
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 is for testing purpose OFC
Replaced by upstream PR kubernetes#3455 |
What this PR does / why we need it:
This add controller pod tracking for ingress-nginx. It will feed the list of
Running
ingress-nginx controller Pod to the configuration template.It is still WIP, open for comments :)
This is required for https://github.com/Shopify/edgescale/issues/631
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #Special notes for your reviewer:
Cc @ElvinEfendi @Shopify/edgescale