Skip to content

Routes created with wrong dns suffix when using router shards #16797

@cldmnky

Description

@cldmnky

We are using 3 router shards with route labels, serving different subdomains:
*.internal.example.com, *.trusted.example.com and *.public.example.com

  • The internal router shard is created with: ROUTE_LABELS="shard notin (public, trusted)" and ROUTER_SUBDOMAIN="${name}-${namespace}.internal.example.com"

  • The public router shard is created with: ROUTE_LABELS="shard=public" and ROUTER_SUBDOMAIN="${name}-${namespace}.public.example.com"

  • The trusted router shard is created with: ROUTE_LABELS="shard=trusted" and ROUTER_SUBDOMAIN="${name}-${namespace}.trusted.example.com"

The default RouterConfig subdomain in our master-config's is set to internal.example.com.

Setting ROUTER_OVERRIDE_HOSTNAME="true" on the routers makes everything work as expected:

  • A route created without any labels is claimed by the internal router shard and admitted as ${name}-${namespace}.internal.example.com

  • A route created with labels shard=public is claimed by the public router and admitted as ${name}-${namespace}.public.example.com.

But with the ROUTER_OVERRIDE_HOSTNAME we cannot create our own hostnames.

If we set ROUTER_OVERRIDE_HOSTNAME="false" on our routers all "empty" routes are admitted as
${name}-${namespace}.internal.example.com on our routers. So setting a route label to shard=public will create the route on the public router but with a hostname of ${name}-${namespace}.internal.example.com, thus making it impossible to direct traffic to the route.

We would expect that the route controller respects the ROUTER_SUBDOMAIN of the router when admitting empty routes claimed by a router shard when ROUTER_OVERRIDE_HOSTNAME="false" is set.

Version
kubernetes v1.6.1+5115d708d7
features: Basic-Auth

Server https://console.prod.xxxx.io:443
openshift v3.6.0+c4dd4cf
kubernetes v1.6.1+5115d708d7
Steps To Reproduce

Create 2 or more router shards with different ROUTER_SUBDOMAIN's set.

Metadata

Metadata

Assignees

Labels

component/routingkind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.priority/P2

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions