Skip to content

Instantly share code, notes, and snippets.

To setup a bridge interface through rancheros config:

  network:
    interfaces:
      br0:
        bridge: true
        dhcp: true
      eth0:
 bridge: br0

These are the steps for running and testing the IP based scheduling feature.

Setup

Run the custom rancher server image:

docker run -d -p 8080:8080 cjellick/server:v1.4.0-ip-scheduling-1

Next, add some hosts using the "custom" docker run command. While adding the host, you should specify the label CATTLE_SCHEDULER_IPS with the host's IPs.

@cjellick
cjellick / panic.md
Last active January 13, 2017 18:55
fatal error: concurrent map writes

goroutine 55 [running]:
runtime.throw(0xa1e33b, 0x15)
	/usr/local/go/src/runtime/panic.go:566 +0x95 fp=0xc420497068 sp=0xc420497048
runtime.mapassign1(0x953ee0, 0xc4200133b0, 0xc4204971e8, 0xc4204971d8)
	/usr/local/go/src/runtime/hashmap.go:458 +0x8ef fp=0xc420497150 sp=0xc420497068
github.com/rancher/rancher-compose/vendor/github.com/docker/libcompose/config.setupSchemaLoaders(0xa36b1d, 0x2711, 0xf020b0, 0xf02d10, 0xf02cf0, 0x0, 0xc42021f0e0)
	/home/cjellick/gprojects/rancher-compose/src/github.com/rancher/rancher-compose/vendor/github.com/docker/libcompose/config/schema_helpers.go:51 +0x22f fp=0xc420497228 sp=0xc420497150
@cjellick
cjellick / commands.sh
Last active June 30, 2017 21:55
webhook stuff
# CREATE
curl -i -H 'Accept: application/json' \
-H 'Content-Type: application/json' \
http://192.168.2.8:8080/v1-webhooks/receivers?projectId=1a5 \
-X POST -d '{"name": "scale up 6 by 1", "driver": "scaleService", "scaleServiceConfig": {"action": "up", "amount": 1, "serviceId": "1s6"}}'
# CREATE WITH LOCAL AUTH ENABLE and passed as cookie
curl -i -H 'Accept: application/json' -H 'Content-Type: application/json' \
--cookie 'PL=rancher; CSRF=D2ACB843C3; token=<token>' http://138.197.29.231:8080/v1-webhooks/receivers?projectId=1a5 \
-X POST -d '{"name": "scale up 6 by 1", "driver": "scaleService", "scaleServiceConfig": {"action": "up", "amount": 1, "serviceId": "1s6"}}'
time="2016-08-01T21:48:35Z" level=info msg="Listening on sync 0.0.0.0:9504"
time="2016-08-01T21:49:12Z" level=info msg="Running /proc/self/exe [sfold volume-snap-63a9c04a-02d7-43dd-a317-aa65fe783e28.img volume-snap-a905e1c6-c817-4668-bf49-f272d8e1a3fd.img]"
SIGQUIT: quit
PC=0x503444 m=0

goroutine 1 [syscall]:
syscall.Syscall(0x8, 0x3, 0x0, 0x3, 0x0, 0x21000, 0x21000)
        /usr/local/go/src/syscall/asm_linux_amd64.s:18 +0x5 fp=0xc820031ac8 sp=0xc820031ac0
syscall.Seek(0x3, 0x0, 0x3, 0x21000, 0x0, 0x0)

Instructions for getting stack dumps of the websocket processes when websocket-proxy stops working

SSH into the hosts where the websocket proxy containers are running.

find the websocket proxy container on the host and note the name or id because you are going to get the logs from it later:

docker ps -a | grep wsp
c50442a5307c        rancher/server:v1.1.1           ...  r-management_websocket-proxy_2
replica:
scale: 2
image: $IMAGE
entrypoint:
- longhorn
command:
- replica
- --listen
- 0.0.0.0:9502

REQUIRED FEATURES

  • Create volume from backup
  • Create image from volume
  • Boot from iso
  • Multi-disk support
  • MySQL HA

TASKS MAJOR

  • Work out volume upgrade path
  • Tests
Controller logs:
```
+ '[' controller == controller ']'
+ '[' '!' -d /sys/kernel/config ']'
+ mount --rbind /host/dev /dev
+ mount -t configfs none /sys/kernel/config
+ exec longhorn controller --listen 0.0.0.0:9501 --frontend tcmu test304012_testtest158332_1-2e347fb-root
time="2016-06-10T06:38:38Z" level=info msg="Listening on 0.0.0.0:9501"
::1 - - [10/Jun/2016:06:39:10 +0000] "GET /v1/volumes HTTP/1.1" 200 490
::1 - - [10/Jun/2016:06:39:12 +0000] "GET /v1/volumes HTTP/1.1" 200 490
time="2016-06-15T01:20:34Z" level=info msg="Starting TCMU teardown."
time="2016-06-15T01:20:34Z" level=info msg="Removing: /sys/kernel/config/target/loopback/naa.6001405r099907751/tpgt_1/lun/lun_0/ttt"
time="2016-06-15T01:20:34Z" level=info msg="Removing: /sys/kernel/config/target/loopback/naa.6001405r099907751/tpgt_1/lun/lun_0"
time="2016-06-15T01:20:34Z" level=info msg="Removing: /sys/kernel/config/target/loopback/naa.6001405r099907751/tpgt_1"
time="2016-06-15T01:20:34Z" level=info msg="Removing: /sys/kernel/config/target/loopback/naa.6001405r099907751"
time="2016-06-15T01:20:34Z" level=info msg="Removing: /sys/kernel/config/target/core/user_42/ttt"
time="2016-06-15T01:20:34Z" level=info msg="Removing: /dev/longhorn/ttt"
time="2016-06-15T01:20:34Z" level=info msg="TCMU teardown successful."
time="2016-06-15T01:20:34Z" level=info msg="Reverting to snapshot volume-snap-8a3b7f98-21f8-4221-a33e-14c6259b8e0c.img on tcp://10.42.13.60:9502"
time="2016-06-15T01:20:34Z" level=info msg="Reverting to snapshot volume-s