Skip to content

Instantly share code, notes, and snippets.

@ramr
ramr / router-log-file-ab-flipflop
Last active December 9, 2016 04:12
router-log-file-ab-flipflop
I1209 04:10:38.879347 1 merged_client_builder.go:122] Using in-cluster configuration
I1209 04:10:38.970300 1 merged_client_builder.go:145] Using in-cluster namespace
I1209 04:10:39.038984 1 reflector.go:200] Starting reflector *api.Service (10m0s) from github.com/openshift/origin/pkg/router/template/service_lookup.go:30
I1209 04:10:39.062426 1 reflector.go:249] Listing and watching *api.Service from github.com/openshift/origin/pkg/router/template/service_lookup.go:30
I1209 04:10:39.107745 1 router.go:139] Creating a new template router, writing to /var/lib/haproxy/router
I1209 04:10:39.107807 1 router.go:141] Router will use default/router service to identify peers
I1209 04:10:39.107875 1 router.go:268] Template router will coalesce reloads within 5 seconds of each other
I1209 04:10:39.182718 1 router.go:184] Reading persisted state
I1209 04:10:39.182817 1 router.go:188] Committing state
I1209 04:10:39.182887 1 router.go:222] Router is only using rou
@ramr
ramr / git-diff-changes
Created December 9, 2016 03:44
git-diff-changes
$ git diff pkg/router/controller/unique_host.go | cat
diff --git a/pkg/router/controller/unique_host.go b/pkg/router/controller/unique_host.go
index 1e21b46..d990349 100644
--- a/pkg/router/controller/unique_host.go
+++ b/pkg/router/controller/unique_host.go
@@ -205,6 +205,13 @@ func (p *UniqueHost) HandleRoute(eventType watch.EventType, route *routeapi.Rout
}
}
p.routeToHost[routeName] = host
@ramr
ramr / example-wildcard-route-output.yaml
Created October 25, 2016 05:37
example-wildcard-route-output.yaml
apiVersion: v1
kind: Route
metadata:
creationTimestamp: 2016-10-25T05:34:29Z
name: header-test-wildcard-path-http-redirect-to-https
namespace: default
resourceVersion: "1553"
selfLink:
/oapi/v1/namespaces/default/routes/header-test-wildcard-path-http-redirect-to-https
uid: b2f7ffa3-9a74-11e6-8684-080027157c8d
@ramr
ramr / example-wildcard-policy-route.json
Created October 25, 2016 05:33
example wildcardpolicy route
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "header-test-wildcard-path-http-redirect-to-https"
},
"id": "header-test-wildcard-path-http-redirect-to-https",
"spec": {
"host": "wildcard.edge.header.test",
"wildcardPolicy": "Subdomain",
@ramr
ramr / router-sharding-blurb
Last active June 22, 2016 02:00
router-sharding-blurb
[[using-router-shards]]
=== Using Router Shards
Each link:../../architecture/core_concepts/projects_and_users.html#projects[project has its own namespace].
By default, a router selects routes from all the namespaces it has
access to. The access controls are based on the service account that the
router is run with.
Using `NAMESPACE_LABELS` and/or `ROUTE_LABELS`, a router can filter out the
namespaces and/or routes that it should service. This enables one to
@ramr
ramr / router-disable-sticky-tcp-sessions
Created May 23, 2016 20:34
router-disable-sticky-tcp-sessions
diff --git a/images/router/haproxy/conf/haproxy-config.template b/images/router/haproxy/conf/haproxy-config.template
index 82eb147..c06dc80 100644
--- a/images/router/haproxy/conf/haproxy-config.template
+++ b/images/router/haproxy/conf/haproxy-config.template
@@ -239,7 +239,11 @@ backend be_tcp_{{$cfgIdx}}
{{ if ne (env "ROUTER_SYSLOG_ADDRESS" "") ""}}
option tcplog
{{ end }}
+{{ if eq (env "ROUTER_DISABLE_STICKY_SESSIONS" "") "" }}
balance source
@ramr
ramr / haproxy-config-host-remove-port-rule
Created April 25, 2016 21:50
haproxy-config-host-remove-port-rule
[ramr@localhost origin (cached:master:c-0:s-0+224:o-6126)]$ git stash show stash@{3} -p
diff --git a/images/router/haproxy/conf/haproxy-config.template b/images/router/haproxy/conf/haproxy-config.template
index eb5b565..0f4e999 100644
--- a/images/router/haproxy/conf/haproxy-config.template
+++ b/images/router/haproxy/conf/haproxy-config.template
@@ -60,6 +60,7 @@ listen stats :1936
frontend public
bind :{{env "ROUTER_SERVICE_HTTP_PORT" "80"}}
mode http
+ http-request replace-value Host (.*):.* \1
@ramr
ramr / ramr-test-edge-allow-default-cert.json
Created April 22, 2016 19:50
ramr-test-edge-allow-default-cert.json
# cat ramr-test-edge-allow-default-cert.json
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "ramr-test-http-allow-defaultcert"
},
"id": "ramr-test-http-allow-defaultcert",
"spec": {
"host": "allow-http-defaultcert.ramr.test",
@ramr
ramr / ramr-test-http-allow-defaultcert-route
Created April 21, 2016 22:30
ramr-test-http-allow-defaultcert route
[root@ip-10-3-90-122 ~]# cat ramr-test-edge-allow-default-cert.json
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "ramr-test-http-allow-defaultcert"
},
"id": "ramr-test-http-allow-defaultcert",
"spec": {
"host": "allow-http-defaultcert.ramr.test",
@ramr
ramr / fails-route-3
Created April 5, 2016 18:02
fails-route-3
{
"kind": "Route",
"apiVersion": "v1",
"metadata": {
"name": "fails-route-3"
},
"id": "fails-route-3",
"spec": {
"host": "fails-route-3.header.test",