Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / eventqueue error
Created February 8, 2017 21:13
eventqueue error
$ cat pkg/client/cache/ramr_eq_test.go
package cache
import (
"testing"
"k8s.io/kubernetes/pkg/watch"
)
type qEntry struct {
@ramr
ramr / reproduce-eq-panic.sh
Created February 10, 2017 00:29
reproduce-eq-panic.sh test script
$ cat reproduce-eq-panic.sh
#!/bin/bash
function _simulate_eq_panic() {
sleep 0.0$((RANDOM%3))
echo " - worker name: $1 ... "
case "$((RANDOM%3))" in
0) oc create -f "$2" ;;
@ramr
ramr / config snippet for connector.json
Last active August 2, 2017 08:09
connector json config snippet for plugin support
{
"continueOnError": true,
"verbosity": 2,
"namespaces": {
/* Other collection info ... */
"meteor_namespace.runData": {
"plugins": [
{
"pluginName": "UpdateElasticsearchIndex",
"info": {
@ramr
ramr / updated elastic search index info
Created August 2, 2017 08:15
update elastic search index info
curl -XGET 'localhost:9200/meteor_namespace/resourceTypes/CHEBI_10?pretty'
{
"_index" : "meteor_namespace",
"_type" : "resourceTypes",
"_id" : "CHEBI_10",
"_version" : 3,
"found" : true,
"_source" : {
"additional_properties" : {
"alkaloid_id" : {