Skip to content

Fix selector for internal router service, so that it is correctly populated#90

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
ramr:fix-int-svc
Dec 19, 2018
Merged

Fix selector for internal router service, so that it is correctly populated#90
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
ramr:fix-int-svc

Conversation

@ramr
Copy link
Contributor

@ramr ramr commented Dec 18, 2018

Noticed this while fixing up the router tests in origin - the service selector for the internal service adds an extra selector which causes issues. PTAL Thx

/cc @openshift/sig-network-edge

@openshift-ci-robot openshift-ci-robot requested a review from a team December 18, 2018 04:37
@openshift-ci-robot openshift-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 18, 2018
if s.Spec.Selector == nil {
s.Spec.Selector = map[string]string{}
}
s.Spec.Selector["router"] = name

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the exact issue? Service already has 'router' selector and we are overriding the value?
I see that we also set router selector for RouterServiceCloud().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also missing the issue here... maybe we should add an e2e test in the operator to verify endpoints for the internal service?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the issue here is that the extra selector router=router-internal-default is causing issues. The deployment naturally doesn't have that label (name=router-internal-default is only generated here) and so there are no endpoints available for the internal service.

There's a few PRs stacked behind this one, so I'll add an e2e test in a follow up PR specifically to verify the endpoints of the internal service. Thx

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still want to select a specific router, right? So before this change, the service selected on "app=router" and "router=router-internal-default", which was wrong because the second key-value pair did not match any router; with this change, the service selects on only "app=router", which selects any router that cluster-ingress-operator deploys; but what we want is that the service select on "app=router" and "router=router-default" in order to select the specific router for this service, right? Otherwise the service will round-robin all routers, and so you could end up getting metrics or health for any router when querying a specific router's internal service.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

D'oh, that's true - will fix up. Thanks

@openshift-ci-robot openshift-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 19, 2018
@ramr
Copy link
Contributor Author

ramr commented Dec 19, 2018

gave up waiting a new cluster to test this ... checking with the bot ...

@Miciah
Copy link
Contributor

Miciah commented Dec 19, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 19, 2018
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 19, 2018
@Miciah
Copy link
Contributor

Miciah commented Dec 19, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 19, 2018
@ironcladlou
Copy link
Contributor

Looks good, thanks!

/lgtm

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ironcladlou, Miciah, ramr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 19, 2018
@openshift-merge-robot openshift-merge-robot merged commit de76ec9 into openshift:master Dec 19, 2018
@ramr ramr deleted the fix-int-svc branch December 19, 2018 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants