routerip="4.1.1.1" # replace with IP address of one of your router instances.
curl -k --resolve www.example.test:443:$routerip https://www.example.test/
curl -k --resolve abc.example.test:443:$routerip https://abc.example.test/
curl -k --resolve anyname.example.test:443:$routerip https://anyname.example.test/
# routerip="4.1.1.1" # replace with IP address of one of your router instances.
# curl -k --resolve www.example.test:443:$routerip https://www.example.test/
# curl -k --resolve abc.example.test:443:$routerip https://abc.example.test/
# curl -k --resolve anyname.example.test:443:$routerip https://anyname.example.test/
Copy to ClipboardCopied!Toggle word wrapToggle overflow
oc adm router ...
oc set env dc/router ROUTER_ALLOW_WILDCARD_ROUTES=true
oc project ns1
oc expose service myservice --hostname=owner.example.test
oc expose service myservice --hostname=aname.example.test
oc project ns2
oc expose service secondservice --hostname=bname.example.test
oc expose service secondservice --hostname=cname.example.test
# Router will not allow this claim with a different path name `/p1` as
# namespace `ns1` has an older route claiming host `aname.example.test`.
oc expose service secondservice --hostname=aname.example.test --path="/p1"
# Router will not allow this claim as namespace `ns1` has an older route
# claiming host name `owner.example.test`.
oc expose service secondservice --hostname=owner.example.test
oc project otherns
# Router will not allow this claim as namespace `ns1` has an older route
# claiming host name `aname.example.test`.
oc expose service thirdservice --hostname=aname.example.test
$ oc adm router ...
$ oc set env dc/router ROUTER_ALLOW_WILDCARD_ROUTES=true
$ oc project ns1
$ oc expose service myservice --hostname=owner.example.test
$ oc expose service myservice --hostname=aname.example.test
$ oc project ns2
$ oc expose service secondservice --hostname=bname.example.test
$ oc expose service secondservice --hostname=cname.example.test
$ # Router will not allow this claim with a different path name `/p1` as
$ # namespace `ns1` has an older route claiming host `aname.example.test`.
$ oc expose service secondservice --hostname=aname.example.test --path="/p1"
$ # Router will not allow this claim as namespace `ns1` has an older route
$ # claiming host name `owner.example.test`.
$ oc expose service secondservice --hostname=owner.example.test
$ oc project otherns
$ # Router will not allow this claim as namespace `ns1` has an older route
$ # claiming host name `aname.example.test`.
$ oc expose service thirdservice --hostname=aname.example.test
Copy to ClipboardCopied!Toggle word wrapToggle overflow
oc adm router ...
oc set env dc/router ROUTER_ALLOW_WILDCARD_ROUTES=true
oc project ns1
oc expose service myservice --hostname=owner.example.test
oc project otherns
# namespace `otherns` is allowed to claim for other.example.test
oc expose service otherservice --hostname=other.example.test
oc project ns1
# Reusing the route.yaml from the previous example.
# spec:
# host: www.example.test
# wildcardPolicy: Subdomain
oc create -f route.yaml # Router will allow this claim.
# In addition, route in namespace otherns will lose its claim to host
# `other.example.test` due to the wildcard route claiming the subdomain.
# namespace `ns1` is allowed to claim for deux.example.test
oc expose service mysecondservice --hostname=deux.example.test
# namespace `ns1` is allowed to claim for deux.example.test with path /p1
oc expose service mythirdservice --hostname=deux.example.test --path="/p1"
oc project otherns
# namespace `otherns` is not allowed to claim for deux.example.test
# with a different path '/otherpath'
oc expose service otherservice --hostname=deux.example.test --path="/otherpath"
# namespace `otherns` is not allowed to claim for owner.example.test
oc expose service yetanotherservice --hostname=owner.example.test
# namespace `otherns` is not allowed to claim for unclaimed.example.test
oc expose service yetanotherservice --hostname=unclaimed.example.test
$ oc adm router ...
$ oc set env dc/router ROUTER_ALLOW_WILDCARD_ROUTES=true
$ oc project ns1
$ oc expose service myservice --hostname=owner.example.test
$ oc project otherns
$ # namespace `otherns` is allowed to claim for other.example.test
$ oc expose service otherservice --hostname=other.example.test
$ oc project ns1
$ # Reusing the route.yaml from the previous example.
$ # spec:
$ # host: www.example.test
$ # wildcardPolicy: Subdomain
$ oc create -f route.yaml # Router will allow this claim.
$ # In addition, route in namespace otherns will lose its claim to host
$ # `other.example.test` due to the wildcard route claiming the subdomain.
$ # namespace `ns1` is allowed to claim for deux.example.test
$ oc expose service mysecondservice --hostname=deux.example.test
$ # namespace `ns1` is allowed to claim for deux.example.test with path /p1
$ oc expose service mythirdservice --hostname=deux.example.test --path="/p1"
$ oc project otherns
$ # namespace `otherns` is not allowed to claim for deux.example.test
$ # with a different path '/otherpath'
$ oc expose service otherservice --hostname=deux.example.test --path="/otherpath"
$ # namespace `otherns` is not allowed to claim for owner.example.test
$ oc expose service yetanotherservice --hostname=owner.example.test
$ # namespace `otherns` is not allowed to claim for unclaimed.example.test
$ oc expose service yetanotherservice --hostname=unclaimed.example.test
Copy to ClipboardCopied!Toggle word wrapToggle overflow
oc adm router ...
oc set env dc/router ROUTER_ALLOW_WILDCARD_ROUTES=true
oc project ns1
oc expose service myservice --hostname=eldest.example.test
oc expose service seniorservice --hostname=senior.example.test
oc project otherns
# namespace `otherns` is allowed to claim for other.example.test
oc expose service juniorservice --hostname=junior.example.test
oc project ns1
# Reusing the route.yaml from the previous example.
# spec:
# host: www.example.test
# wildcardPolicy: Subdomain
oc create -f route.yaml # Router will allow this claim.
# In addition, route in namespace otherns will lose its claim to host
# `junior.example.test` due to the wildcard route claiming the subdomain.
# namespace `ns1` is allowed to claim for dos.example.test
oc expose service mysecondservice --hostname=dos.example.test
# Delete route for host `eldest.example.test`, the next oldest route is
# the one claiming `senior.example.test`, so route claims are unaffacted.
oc delete route myservice
# Delete route for host `senior.example.test`, the next oldest route is
# the one claiming `junior.example.test` in another namespace, so claims
# for a wildcard route would be affected. The route for the host
# `dos.example.test` would be unaffected as there are no other wildcard
# claimants blocking it.
oc delete route seniorservice
$ oc adm router ...
$ oc set env dc/router ROUTER_ALLOW_WILDCARD_ROUTES=true
$ oc project ns1
$ oc expose service myservice --hostname=eldest.example.test
$ oc expose service seniorservice --hostname=senior.example.test
$ oc project otherns
$ # namespace `otherns` is allowed to claim for other.example.test
$ oc expose service juniorservice --hostname=junior.example.test
$ oc project ns1
$ # Reusing the route.yaml from the previous example.
$ # spec:
$ # host: www.example.test
$ # wildcardPolicy: Subdomain
$ oc create -f route.yaml # Router will allow this claim.
$ # In addition, route in namespace otherns will lose its claim to host
$ # `junior.example.test` due to the wildcard route claiming the subdomain.
$ # namespace `ns1` is allowed to claim for dos.example.test
$ oc expose service mysecondservice --hostname=dos.example.test
$ # Delete route for host `eldest.example.test`, the next oldest route is
$ # the one claiming `senior.example.test`, so route claims are unaffacted.
$ oc delete route myservice
$ # Delete route for host `senior.example.test`, the next oldest route is
$ # the one claiming `junior.example.test` in another namespace, so claims
$ # for a wildcard route would be affected. The route for the host
$ # `dos.example.test` would be unaffected as there are no other wildcard
$ # claimants blocking it.
$ oc delete route seniorservice
Copy to ClipboardCopied!Toggle word wrapToggle overflow