-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: unset ports in endpointslices (#3156)
fix #3151 unset ports in endpointslices should not be considered in our lb members list Signed-off-by: Sandor Szücs <[email protected]>
- Loading branch information
Showing
7 changed files
with
178 additions
and
2 deletions.
There are no files selected for viewing
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
3 changes: 3 additions & 0 deletions
3
...s/testdata/ingressV1/service-ports-endpointslices/multiple-endpointslices-one-unset.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,3 @@ | ||
kube_default__myapp_ingress__example_org____myapp_service: | ||
Host("^(example[.]org[.]?(:[0-9]+)?)$") | ||
-> "http://10.3.0.5:8080"; |
1 change: 1 addition & 0 deletions
1
...es/testdata/ingressV1/service-ports-endpointslices/multiple-endpointslices-one-unset.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 @@ | ||
enable-kubernetes-endpointslices: true |
89 changes: 89 additions & 0 deletions
89
...es/testdata/ingressV1/service-ports-endpointslices/multiple-endpointslices-one-unset.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,89 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: myapp-deployment | ||
labels: | ||
app: myapp | ||
spec: | ||
replicas: 2 | ||
selector: | ||
matchLabels: | ||
app: myapp | ||
template: | ||
metadata: | ||
labels: | ||
app: myapp | ||
spec: | ||
containers: | ||
- name: myapp | ||
image: myapp:v1 | ||
ports: | ||
- containerPort: 80 | ||
name: my-port | ||
protocol: TCP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: myapp-deployment | ||
name: myapp-service | ||
spec: | ||
clusterIP: 10.3.190.1 | ||
ports: | ||
- name: this-is-my-service-port-name | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: my-port | ||
selector: | ||
app: myapp | ||
type: ClusterIP | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
labels: | ||
app: myapp | ||
name: myapp-ingress | ||
namespace: default | ||
spec: | ||
rules: | ||
- host: example.org | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: myapp-service | ||
port: | ||
number: 8080 | ||
pathType: ImplementationSpecific | ||
--- | ||
apiVersion: v1 | ||
kind: EndpointSlice | ||
metadata: | ||
labels: | ||
app: myapp-deployment | ||
kubernetes.io/service-name: myapp-service | ||
name: myapp-service-foo | ||
namespace: default | ||
endpoints: | ||
- addresses: | ||
- 10.3.0.3 | ||
zone: my-zone | ||
ports: null | ||
--- | ||
apiVersion: v1 | ||
kind: EndpointSlice | ||
metadata: | ||
labels: | ||
app: myapp-deployment | ||
kubernetes.io/service-name: myapp-service | ||
name: myapp-service-bar | ||
namespace: default | ||
endpoints: | ||
- addresses: | ||
- 10.3.0.5 | ||
zone: my-zone | ||
ports: | ||
- port: 8080 | ||
protocol: TCP |
5 changes: 5 additions & 0 deletions
5
...ernetes/testdata/ingressV1/service-ports-endpointslices/single-endpointslices-unset.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 @@ | ||
kube_default__myapp_ingress__example_org____myapp_service: | ||
Host("^(example[.]org[.]?(:[0-9]+)?)$") | ||
-> status(502) | ||
-> inlineContent("no endpoints") | ||
-> <shunt>; |
1 change: 1 addition & 0 deletions
1
...bernetes/testdata/ingressV1/service-ports-endpointslices/single-endpointslices-unset.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 @@ | ||
enable-kubernetes-endpointslices: true |
73 changes: 73 additions & 0 deletions
73
...bernetes/testdata/ingressV1/service-ports-endpointslices/single-endpointslices-unset.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,73 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: myapp-deployment | ||
labels: | ||
app: myapp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: myapp | ||
template: | ||
metadata: | ||
labels: | ||
app: myapp | ||
spec: | ||
containers: | ||
- name: myapp | ||
image: myapp:v1 | ||
ports: | ||
- containerPort: 80 | ||
name: my-port | ||
protocol: TCP | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: myapp-deployment | ||
name: myapp-service | ||
spec: | ||
clusterIP: 10.3.190.1 | ||
ports: | ||
- name: this-is-my-service-port-name | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: my-port | ||
selector: | ||
app: myapp | ||
type: ClusterIP | ||
--- | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
labels: | ||
app: myapp | ||
name: myapp-ingress | ||
namespace: default | ||
spec: | ||
rules: | ||
- host: example.org | ||
http: | ||
paths: | ||
- backend: | ||
service: | ||
name: myapp-service | ||
port: | ||
number: 8080 | ||
pathType: ImplementationSpecific | ||
--- | ||
apiVersion: v1 | ||
kind: EndpointSlice | ||
metadata: | ||
labels: | ||
app: myapp-deployment | ||
kubernetes.io/service-name: myapp-service | ||
name: myapp-service-foo | ||
namespace: default | ||
endpoints: | ||
- addresses: | ||
- 10.3.0.3 | ||
zone: my-zone | ||
ports: null |