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

status: Report routes that have no route port specified #5089

Merged
merged 1 commit into from
Oct 29, 2015
Merged

status: Report routes that have no route port specified #5089

merged 1 commit into from
Oct 29, 2015

Conversation

0xmichalis
Copy link
Contributor

This PR adds graph pieces for routes and makes oc status report routes with missing route ports when they expose multiport services.

@deads2k @smarterclayton @pweil- PTAL

@0xmichalis
Copy link
Contributor Author

Currently:

[vagrant@openshiftdev sample-app]$ oc status
In project test on server https://localhost:8443

service/database - 172.30.14.62:5434 -> 3306
  dc/database deploys docker.io/openshift/mysql-55-centos7:latest 
    #1 deployed 26 minutes ago - 1 pod

service/frontend - 172.30.70.12:5432 -> 8080
  dc/frontend deploys istag/origin-ruby-sample:latest <-
    builds https://github.com/openshift/ruby-hello-world.git with test/ruby-20-centos7:latest through bc/ruby-sample-build 
    #1 deployed 25 minutes ago - 2 pods

Warnings:
  route/database is routing traffic to svc/database but it doesn't have a route port specified.
  route/route-edge is routing traffic to svc/frontend but it doesn't have a route port specified.

To see more, use 'oc describe <resource>/<name>'.
You can use 'oc get all' to see a list of other objects.

@0xmichalis
Copy link
Contributor Author

Ugh, this is WIP, need to add tests.

@0xmichalis 0xmichalis changed the title status: Report routes that have no route port specified [WIP] status: Report routes that have no route port specified Oct 12, 2015
@deads2k
Copy link
Contributor

deads2k commented Oct 12, 2015

It seems like routes should be somehow related to the services they're routing to in the main status section instead of just having warnings about them. Maybe an "exposed through route/foo" on the service line?

@0xmichalis
Copy link
Contributor Author

It seems like routes should be somehow related to the services they're routing to in the main status section instead of just having warnings about them. Maybe an "exposed through route/foo" on the service line?

Sure, I just need to get around the graph code as I'm not 100% familiar with it. I'll look into this tomorrow.

@0xmichalis
Copy link
Contributor Author

@deads2k how about:

[vagrant@openshiftdev sample-app]$ oc status
In project test on server https://localhost:8443

svc/database - 172.30.45.255:5434 -> 3306
  dc/database deploys docker.io/openshift/mysql-55-centos7:latest 
    #1 deployed 57 minutes ago - 1 pod
  exposed through route/database at database-test.router.default.svc.cluster.local

svc/frontend - 172.30.182.32:5432 -> 8080
  dc/frontend deploys imagestreamtag/origin-ruby-sample:latest <-
    builds https://github.com/openshift/ruby-hello-world.git with test/ruby-20-centos7:latest through bc/ruby-sample-build 
    #1 deployed 55 minutes ago - 2 pods
  exposed through route/route-edge at www.example.com

Warnings:
  route/database is routing traffic to svc/database but it doesn't have a route port specified.
  route/route-edge is routing traffic to svc/frontend but it doesn't have a route port specified.

To see more, use 'oc describe <resource>/<name>'.
You can use 'oc get all' to see a list of other objects.

@smarterclayton
Copy link
Contributor

There's no point to showing the full DNS name until we report status to the
route - you won't know what correct the route DNS suffix is. So for now,
say "exposed via route/name" and if a port is set, include the port.

On Oct 13, 2015, at 7:13 AM, Michail Kargakis notifications@github.com
wrote:

@deads2k https://github.com/deads2k how about:

[vagrant@openshiftdev sample-app]$ oc status
In project test on server https://localhost:8443

svc/database - 172.30.45.255:5434 -> 3306
dc/database deploys docker.io/openshift/mysql-55-centos7:latest
#1 deployed 57 minutes ago - 1 pod
exposed through route/database at
database-test.router.default.svc.cluster.local

svc/frontend - 172.30.182.32:5432 -> 8080
dc/frontend deploys imagestreamtag/origin-ruby-sample:latest <-
builds https://github.com/openshift/ruby-hello-world.git with
test/ruby-20-centos7:latest through bc/ruby-sample-build
#1 deployed 55 minutes ago - 2 pods
exposed through route/route-edge at www.example.com

Warnings:
route/database is routing traffic to svc/database but it doesn't
have a route port specified.
route/route-edge is routing traffic to svc/frontend but it doesn't
have a route port specified.

To see more, use 'oc describe /'.
You can use 'oc get all' to see a list of other objects.


Reply to this email directly or view it on GitHub
#5089 (comment).

@0xmichalis 0xmichalis changed the title [WIP] status: Report routes that have no route port specified status: Report routes that have no route port specified Oct 13, 2015
@0xmichalis
Copy link
Contributor Author

So for now, say "exposed via route/name" and if a port is set, include the port.

[vagrant@openshiftdev sample-app]$ oc status
In project test on server https://localhost:8443

svc/frontend - 172.30.182.32:5432 -> 8080
  exposed through route/route-edge

Warnings:
  route/route-edge is routing traffic to svc/frontend but it doesn't have a route port specified.

To see more, use 'oc describe <resource>/<name>'.
You can use 'oc get all' to see a list of other objects.

# Add a route port

[vagrant@openshiftdev sample-app]$ oc status
In project test on server https://localhost:8443

svc/frontend - 172.30.182.32:5432 -> 8080
  exposed through route/route-edge at port 5432

To see more, use 'oc describe <resource>/<name>'.
You can use 'oc get all' to see a list of other objects.

@0xmichalis
Copy link
Contributor Author

[test]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6380/)

@smarterclayton
Copy link
Contributor

"exposed pod port 5432 through route/route-edge"

Otherwise review delegated to david.

On Tue, Oct 13, 2015 at 10:42 AM, Michail Kargakis <notifications@github.com

wrote:

[test]


Reply to this email directly or view it on GitHub
#5089 (comment).

@0xmichalis
Copy link
Contributor Author

@danmcp why jenkins is failing to execute the tests?

@danmcp
Copy link

danmcp commented Oct 13, 2015

@Kargakis It looks like it reran them. What didn't happen that you thought should have?

@0xmichalis
Copy link
Contributor Author

@0xmichalis
Copy link
Contributor Author

re[test] btw

@danmcp
Copy link

danmcp commented Oct 13, 2015

@Kargakis Ah. Yeah that's a known issue that needs to be debugged still.

@0xmichalis 0xmichalis closed this Oct 14, 2015
@0xmichalis 0xmichalis reopened this Oct 14, 2015
@0xmichalis
Copy link
Contributor Author

[test]


route:
for _, uncastRouteNode := range g.NodesByKind(routegraph.RouteNodeKind) {
for _, uncastServiceNode := range g.SuccessorNodesByEdgeKind(uncastRouteNode, kubeedges.ExposedThroughServiceEdgeKind) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look right. The error is based on whether the route has a target port. I don't think the service is a related object. It wasn't involved in the decision at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look right. The error is based on whether the route has a target port. I don't think the service is a related object. It wasn't involved in the decision at all.

Reading through the doc, it looks like this is only something we need to call out if the services themselves have more than one port exposed? That would be a reason for having services be related. Add the test to see if its actually a problem and then be more descriptive in the message.

@deads2k
Copy link
Contributor

deads2k commented Oct 14, 2015

For congruence in the output, try: "route/route-edge exposes pod port 5432".

@smarterclayton
Copy link
Contributor

I think it's more important to indicate the service is what is being
exposed. I'm less interested in the route name until I know why. In the
future we probably won't show the route name.

On Oct 14, 2015, at 9:34 AM, David Eads notifications@github.com wrote:

For congruence in the output, try: "route/route-edge exposes pod port 5432".


Reply to this email directly or view it on GitHub
#5089 (comment).

@deads2k
Copy link
Contributor

deads2k commented Oct 14, 2015

I think it's more important to indicate the service is what is being
exposed. I'm less interested in the route name until I know why. In the
future we probably won't show the route name.

svc/frontend - 172.30.182.32:5432 -> 8080 (exposed) ? We could conditionally show the route line based on whether we have a problem?

@smarterclayton
Copy link
Contributor

The message I suggested last indented below the service is the right thing
to be consistent with our other patterns. Putting the object type and name
first isn't a hard rule

On Wed, Oct 14, 2015 at 10:45 AM, David Eads notifications@github.com
wrote:

I think it's more important to indicate the service is what is being
exposed. I'm less interested in the route name until I know why. In the
future we probably won't show the route name.

svc/frontend - 172.30.182.32:5432 -> 8080 (exposed) ? We could
conditionally show the route line based on whether we have a problem?


Reply to this email directly or view it on GitHub
#5089 (comment).

@deads2k
Copy link
Contributor

deads2k commented Oct 14, 2015

The message I suggested last indented below the service is the right thing
to be consistent with our other patterns. Putting the object type and name
first isn't a hard rule

It makes it hard to read.

@0xmichalis
Copy link
Contributor Author

@deads2k comments addressed plus added warning about a missing service

[vagrant@openshiftdev sample-app]$ oc status
In project test on server https://localhost:8443

service/etcd-server - 172.30.13.65 ports 2380, 4001

service/external - 172.30.0.100 ports 443, 80->443

service/new - 172.30.26.177 ports 443, 80

Warnings:
  route/new2 is supposed to route traffic to service/new2 but service/new2 doesn't exist.

To see more, use 'oc describe <resource>/<name>'.
You can use 'oc get all' to see a list of other objects.

@smarterclayton
Copy link
Contributor

I don't agree "exposed by route/foo on pod port 8080" is what I want to see

On Oct 14, 2015, at 11:12 AM, David Eads notifications@github.com wrote:

The message I suggested last indented below the service is the right thing
to be consistent with our other patterns. Putting the object type and name
first isn't a hard rule

It makes it hard to read.


Reply to this email directly or view it on GitHub
#5089 (comment).

@0xmichalis
Copy link
Contributor Author

@deads2k comments addressed

@0xmichalis 0xmichalis closed this Oct 22, 2015
@0xmichalis 0xmichalis reopened this Oct 22, 2015
@openshift-bot openshift-bot removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Oct 22, 2015
@0xmichalis 0xmichalis closed this Oct 23, 2015
@0xmichalis 0xmichalis reopened this Oct 23, 2015
}
}

for _, uncastServiceFulfiller := range g.PredecessorNodesByEdgeKind(serviceNode, routeedges.ExposedThroughRouteEdgeKind) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@deads2k the names in this package are getting ridiculous.

@smarterclayton
Copy link
Contributor

A few changes, revert service back to svc

@smarterclayton
Copy link
Contributor

Project status is broken.

@0xmichalis
Copy link
Contributor Author

I had to update resource strings in tests. PTAL

This commit adds graph pieces for routes and makes `oc status` report routes with missing route ports.
@0xmichalis
Copy link
Contributor Author

@smarterclayton test added

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to e68fa2f

@smarterclayton
Copy link
Contributor

LGTM [merge]

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6380/) (Image: devenv-rhel7_2594)

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to e68fa2f

openshift-bot pushed a commit that referenced this pull request Oct 29, 2015
@openshift-bot openshift-bot merged commit c0d2376 into openshift:master Oct 29, 2015
@0xmichalis 0xmichalis deleted the routes-oc-status branch October 29, 2015 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants