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

fix: routegroup does not apply default algorithm #2614

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions dataclients/kubernetes/definitions/routegroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,6 @@ func (sb *SkipperBackend) UnmarshalJSON(value []byte) error {
perr = err
}

if a == loadbalancer.None {
a = loadbalancer.RoundRobin
}

var b SkipperBackend
b.Name = p.Name
b.Type = bt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kube_rg__default__myapp__all__0_0:
Host("^(example[.]org[.]?(:[0-9]+)?)$")
&& PathSubtree("/")
-> <powerOfRandomNChoices, "http://10.2.9.103:7272", "http://10.2.9.104:7272">;

kube_rg____example_org__catchall__0_0: Host("^(example[.]org[.]?(:[0-9]+)?)$") -> <shunt>;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default-lb-algorithm: consistentHash
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: zalando.org/v1
kind: RouteGroup
metadata:
name: myapp
spec:
hosts:
- example.org
backends:
- name: myapp
type: service
serviceName: myapp
servicePort: 80
algorithm: powerOfRandomNChoices
routes:
- pathSubtree: /
backends:
- backendName: myapp
---
apiVersion: v1
kind: Service
metadata:
labels:
application: myapp
name: myapp
spec:
clusterIP: 10.3.190.97
ports:
- name: main
port: 80
protocol: TCP
targetPort: 7272
selector:
application: myapp
type: ClusterIP
---
apiVersion: v1
kind: Endpoints
metadata:
labels:
application: myapp
name: myapp
namespace: default
subsets:
- addresses:
- ip: 10.2.9.103
- ip: 10.2.9.104
ports:
- name: main
port: 7272
protocol: TCP
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kube_rg__default__myapp__all__0_0:
Host("^(example[.]org[.]?(:[0-9]+)?)$")
&& PathSubtree("/")
-> <roundRobin, "http://10.2.9.103:7272", "http://10.2.9.104:7272">;

kube_rg____example_org__catchall__0_0: Host("^(example[.]org[.]?(:[0-9]+)?)$") -> <shunt>;
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
default-lb-algorithm: does-not-exist
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
apiVersion: zalando.org/v1
kind: RouteGroup
metadata:
name: myapp
spec:
hosts:
- example.org
backends:
- name: myapp
type: service
serviceName: myapp
servicePort: 80
routes:
- pathSubtree: /
backends:
- backendName: myapp
---
apiVersion: v1
kind: Service
metadata:
labels:
application: myapp
name: myapp
spec:
clusterIP: 10.3.190.97
ports:
- name: main
port: 80
protocol: TCP
targetPort: 7272
selector:
application: myapp
type: ClusterIP
---
apiVersion: v1
kind: Endpoints
metadata:
labels:
application: myapp
name: myapp
namespace: default
subsets:
- addresses:
- ip: 10.2.9.103
- ip: 10.2.9.104
ports:
- name: main
port: 7272
protocol: TCP
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kube_rg__default__myapp__all__0_0:
Host("^(example[.]org[.]?(:[0-9]+)?)$")
&& PathSubtree("/")
-> <roundRobin, "http://10.2.9.103:7272", "http://10.2.9.104:7272">;
-> <consistentHash, "http://10.2.9.103:7272", "http://10.2.9.104:7272">;

kube_rg____example_org__catchall__0_0: Host("^(example[.]org[.]?(:[0-9]+)?)$") -> <shunt>;
Original file line number Diff line number Diff line change
@@ -1 +1 @@
default-lb-algorithm: consistantHash
default-lb-algorithm: consistentHash