-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dataclients/kubernetes: add failing testcase for named service target…
… port For #2565 Signed-off-by: Alexander Yastrebov <alexander.yastrebov@zalando.de>
- Loading branch information
1 parent
35e9ac6
commit 3f555d8
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
dataclients/kubernetes/testdata/ingressV1/service-ports-endpointslices/foo.eskip
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Endpoints logic produces endpoints with port 3000 therefore | ||
// this test case fails because endpointslices logic produces endpoints with port 0 | ||
kube_myapp_ns__myapp_ingress__example_org____myapp_service: | ||
Host("^(example[.]org[.]?(:[0-9]+)?)$") | ||
-> <roundRobin, "http://10.2.0.162:3000", "http://10.2.72.100:3000">; |
4 changes: 4 additions & 0 deletions
4
dataclients/kubernetes/testdata/ingressV1/service-ports-endpointslices/foo.kube
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# | ||
# Passes with false but fails with true | ||
# | ||
enable-kubernetes-endpointslices: true |
87 changes: 87 additions & 0 deletions
87
dataclients/kubernetes/testdata/ingressV1/service-ports-endpointslices/foo.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
labels: | ||
app: myapp | ||
name: myapp-ingress | ||
namespace: myapp-ns | ||
spec: | ||
rules: | ||
- host: example.org | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: myapp-service | ||
port: | ||
number: 80 | ||
pathType: ImplementationSpecific | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: myapp | ||
name: myapp-service | ||
namespace: myapp-ns | ||
spec: | ||
clusterIP: 10.5.69.228 | ||
clusterIPs: | ||
- 10.5.69.228 | ||
internalTrafficPolicy: Cluster | ||
ipFamilies: | ||
- IPv4 | ||
ipFamilyPolicy: SingleStack | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: http-grafana | ||
selector: | ||
app: myapp | ||
sessionAffinity: None | ||
type: ClusterIP | ||
--- | ||
kind: EndpointSlice | ||
metadata: | ||
labels: | ||
app: myapp | ||
kubernetes.io/service-name: myapp-service | ||
name: myapp-service-foo | ||
namespace: myapp-ns | ||
addressType: IPv4 | ||
apiVersion: discovery.k8s.io/v1 | ||
endpoints: | ||
- addresses: | ||
- 10.2.0.162 | ||
conditions: | ||
ready: true | ||
serving: true | ||
terminating: false | ||
zone: eu-central-1a | ||
- addresses: | ||
- 10.2.72.100 | ||
conditions: | ||
ready: true | ||
serving: true | ||
terminating: false | ||
zone: eu-central-1c | ||
ports: | ||
- name: "" | ||
port: 3000 | ||
protocol: TCP | ||
--- | ||
# Endpoints for comparison | ||
apiVersion: v1 | ||
kind: Endpoints | ||
metadata: | ||
labels: | ||
app: myapp | ||
name: myapp-service | ||
namespace: myapp-ns | ||
subsets: | ||
- addresses: | ||
- ip: 10.2.0.162 | ||
- ip: 10.2.72.100 | ||
ports: | ||
- port: 3000 | ||
protocol: TCP |