Replies: 4 comments
-
Hi @iacovosb thanks for reporting! Be sure to check out the docs while you wait for a human to take a look at this 🙂 Cheers! |
Beta Was this translation helpful? Give feedback.
-
Are these two different upstream groups? (in nginx speak) Upstreams are generally considered homogeneous - as in, all listening on the same port. The generic nginx way to handle this is generally two different upstream groups. One on one port and the second on its port. With a weight set for each group. In your case the weights would be the same. Let me see if I can scare up an example. |
Beta Was this translation helpful? Give feedback.
-
Try this. But setting equal weights for the myservice-5591 and myservice-5592 |
Beta Was this translation helpful? Give feedback.
-
Hello @brianehlert , and thank you for the prompt response. kubectl describe virtualserver.k8s.nginx.org/myservice-vs -n testing Result: Routes:
Path: /
Splits:
Action:
Pass: myservice-5591
Weight: 50
Action:
Pass: myservice-5592
Weight: 50
Tls:
Secret: wildcard-example-com
Upstreams:
Name: myservice-5591
Port: 5591
Service: myservice-5591
Name: myservice-5592
Port: 5592
Service: myservice-5592 Thank you very much, greatly appreciated. |
Beta Was this translation helpful? Give feedback.
-
Discussed in #2481
Originally posted by iacovosb March 11, 2022
Hello, and thank you for accepting my inquiry.
General information:
kubernetes version: v1.23.3
nginx-ingress vesion: (nginxinc/nginx-ingress OSS) v2.1.1 / nginx:1.21.5
Installation type: bare metal
I have the following service configuration:
And the respective Ingress config:
What I am trying to do is Load Balance the requests to myservice.example.com to the same backend service, but by using multiple ports (5591 and 5592 in this example).
Please note that the requests I want to load balance are in the same path.
The generated config is:
Targeted config (what I am trying to achieve) is:
I have tried several approaches, but I always seem to fall into a duplication of some sort.
Duplicate resource (for the host if I create multiple Ingress rules, duplicate location if I add both services under the same path, or ignoring the first part of the configuration if it is repeated in any way).
I also tried with multiple services and VirtualServer:
Services configuration:
Virtual Server Config:
Again, one of the two services gets ignored:
Generated Config:
Desired Config:
Is there any way I can achieve the desired configuration?
Thank you in advance
Beta Was this translation helpful? Give feedback.
All reactions