Skip to content

Instantly share code, notes, and snippets.

/*
This is a mock up of the minimal viable product for rollbacks. It is NOT a complete solution.
A rollback is essentially a posting of an old deployment config on top of the current config. However,
the user will indicate which version of the deployment config they'd like to use by specifying a deployment
from 'list deployments' or whatever the replication controller version evolves into.
To demonstrate the mechanics the code below mocks what an actual api call would do. In an actual solution
I envision that it would be something like:
@pweil-
pweil- / first window
Last active August 29, 2015 14:10
Router not picking up routes
...... vagrant up with dev cluster set ......
===== Create Command ======
[vagrant@openshift-master vagrant]$ hack/install-router.sh router-1 10.245.1.2 && hack/install-router.sh router-2 10.245.1.2 && openshift kube -c paul_temp/pod.json create pods && openshift kube -c paul_temp/route.json create routes && openshift kube -c paul_temp/service.json create services
Creating router file and starting pod...
router-1
Creating router file and starting pod...
router-2
Name Image(s) Host Labels Status
global
user haproxy
group haproxy
daemon
log /dev/log local0
defaults
timeout connect 5s
timeout client 30s
timeout server 30s
[vagrant@openshiftdev origin]$ openshift cli get services -o json
{
"kind": "ServiceList",
"creationTimestamp": null,
"selfLink": "/api/v1beta1/services",
"resourceVersion": 19,
"apiVersion": "v1beta1",
"items": [
{
"id": "kubernetes",
00000000:public_ssl.accept(0006)=0009 from [10.0.2.15:56882]
00000000:be_sni.srvcls[0009:000a]
00000000:be_sni.clicls[0009:000a]
00000000:be_sni.closed[0009:000a]
00000001:fe_sni.accept(0007)=0009 from [10.0.2.15:56890]
00000001:be_http_hello-nginx.clireq[0009:ffffffff]: GET / HTTP/1.1
00000001:be_http_hello-nginx.clihdr[0009:ffffffff]: User-Agent: curl/7.32.0
00000001:be_http_hello-nginx.clihdr[0009:ffffffff]: Host: www.example.com
00000001:be_http_hello-nginx.clihdr[0009:ffffffff]: Accept: */*
00000001:be_http_hello-nginx.srvrep[0009:000a]: HTTP/1.1 200 OK
E0120 18:25:14.183656 1 reflector.go:114] watch of *api.Route ended with error: very short watch
-------------------------------------------------- body: &{0xc2080971c0 {0 0} false ?reflect.Value? 0x549490 0x549420}
-------------------------------------------------- start: {"Type":"ADDED","Object":{"kind":"route","apiVersion":"v1beta1","metadata":{"creationTimestamp":null},"host":"www.example.com","serviceName":"example"}}
-------------------------------------------------- decoded: : <nil> : EOF
@pweil-
pweil- / haproxy conf
Last active August 29, 2015 14:13
debugging haproxy
backend be_http_example
mode http
balance leastconn
timeout check 5000ms
server example 0.0.0.0:8888 check inter 5000ms
I0121 15:34:37.665654 10326 errors.go:52] An unchecked error was received: 100: Key not found (/builds) [160]
I0121 15:34:37.666143 10326 errors.go:52] An unchecked error was received: 100: Key not found (/builds) [160]
backend be_http_hello-nginx
mode http
balance leastconn
timeout check 5000ms
server hello-nginx 172.17.0.14:80 check inter 5000ms
All,
The beta1 refactor for adding TLS support to the OpenShift template router plugin is being merged soon [1]. For the most part all the changes are behind the scenes and should not affect your existing route files. There are some items I'd like to call out:
1. The router now binds to host port 80 and 443 (previously only 80)
2. The Route object now supports a new, optional TLS configuration object that identifies TLS termination strategies and certificates [2]
3. Certificates in the JSON file must be single line strings with \\n line breaks
4. For beta1, much of the config relies on SNI (to determine passthroughs, etc). Traffic that is not SNI based that arrives on :443 will have TLS termination completed with a generic certificate. Discussions of custom frontends with user specified ports have been brought up for future iterations.
Installation of the router has also recently changed (not in this PR) and is worth noting. When installing the router via hack/install-router.sh you now provide th