Skip to content

Instantly share code, notes, and snippets.

-1.compute.internal sh[2673]: 10.21.2.85 "POST /v1/auth/login/ HTTP/1.0" 200 52 "python-requests/2.5.1 CPython/2.7.6 Darwin/14.1.0"
Mar 04 20:41:09 ip-10-21-1-139.us-west-1.compute.internal sh[2673]: ERROR Internal Server Error: /v1/auth/cancel
Mar 04 20:41:09 ip-10-21-1-139.us-west-1.compute.internal sh[2673]: Traceback (most recent call last):
Mar 04 20:41:09 ip-10-21-1-139.us-west-1.compute.internal sh[2673]: File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
Mar 04 20:41:09 ip-10-21-1-139.us-west-1.compute.internal sh[2673]: response = wrapped_callback(request, *callback_args, **callback_kwargs)
Mar 04 20:41:09 ip-10-21-1-139.us-west-1.compute.internal sh[2673]: File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/csrf.py", line 57, in wrapped_view
Mar 04 20:41:09 ip-10-21-1-139.us-west-1.compute.internal sh[2673]: return view_func(*args, **kwargs)
Mar 04 20:41:09 ip-10-21-1-139.us-west-1.compute.internal sh[2673]: File "/usr/local/lib/pyt
@smothiki
smothiki / gist:6a0e59039be2e05a5f3b
Last active August 29, 2015 14:16
kubernetes name error
ERROR k8stest: k8stest_v2.web.1 (create): Failed to retrieve unit: 422 status code 422 - {
Mar 06 03:56:42 sh[8612]: "kind": "Status",
Mar 06 03:56:42 sh[8612]: "creationTimestamp": null,
Mar 06 03:56:42 sh[8612]: "apiVersion": "v1beta1",
Mar 06 03:56:42 sh[8612]: "status": "Failure",
Mar 06 03:56:42 sh[8612]: "message": "Pod \"k8stest_v2.web.1\" is invalid: [metadata.name: invalid value 'k8stest_v2.web.1': name must be lowercase letters and numbers, with inline dashes or periods, spec.containers[0].name: invalid value 'k8stest_v2.web.1']",
Mar 06 03:56:42 sh[8612]: "reason": "Invalid",
Mar 06 03:56:42 sh[8612]: "details": {
Mar 06 03:56:42 sh[8612]: "id": "k8stest_v2.web.1",
Mar 06 03:56:42 sh[8612]: "kind": "Pod",
page_title page_description page_keywords
Docker Swarm filters
Swarm filters
docker, swarm, clustering, filters

Filters

The Docker Swarm scheduler comes with multiple filters.

etcdctl ls --recursive /deis
/deis/cache
/deis/cache/host
/deis/cache/port
/deis/controller
/deis/controller/protocol
/deis/controller/builderKey
/deis/controller/registrationEnabled
/deis/controller/schedulerModule
/deis/controller/image
#cloud-config
---
ssh_authorized_keys:
- <%= ssh_public_key %>
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io/new
# uncomment the following line and replace it with your discovery URL
discovery: <%= discovery_url %>
addr: $private_ipv4:4001
docker -H 172.17.8.103:2395 ps
CONTAINER ID        IMAGE               COMMAND                CREATED              STATUS              PORTS               NAMES
b7e510f3c9f9        redis:latest        "/entrypoint.sh redi   About a minute ago   Pending             6379/tcp            deis-03/some-redis3   
e8b0748017ca        redis:latest        "/entrypoint.sh redi   About a minute ago   Pending             6379/tcp            deis-03/some-redis2   
16ee2fe9f663        redis:latest        "/entrypoint.sh redi   16 hours ago         Up 16 hours         6379/tcp            deis-02/some-redis    
deis-02 ~ $ docker ps -a
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS               NAMES

docker swarm events

2015-04-22T20:02:30.000000000Z mysql:latest: (from  node:deis-03) pull
2015-04-22T20:02:30.000000000Z f95e051aef40f99ce9bff4e236db8e15b14789f3f079269c235e899b546c1991: (from mysql:5 node:deis-03) create
2015-04-22T20:02:30.000000000Z f95e051aef40f99ce9bff4e236db8e15b14789f3f079269c235e899b546c1991: (from mysql:5 node:deis-03) start
2015-04-22T20:03:55.000000000Z (from swarm node:deis-03) engine_disconnect
2015-04-22T20:04:59.000000000Z mysql:latest: (from  node:deis-02) pull
2015-04-22T20:04:59.000000000Z d90620613576f1cb3cb13bc633913ffeb0707cfaec98848fc98945c947a07e1e: (from mysql:5 node:deis-02) create

docker swarm evetns

  1. created mysql on deis-03
  2. made deis-03 failvoer
  3. re schedule mysql on deis-02
  4. reconnect deis-03 and remove mysql as it has already been rescheduled
2015-04-22T20:23:35.000000000Z 8fbda0e636db3f8bf26042677a6f618efccfd26d124b91635ca6ba2f0d877eab: (from mysql:5 node:deis-03) create
2015-04-22T20:23:35.000000000Z 8fbda0e636db3f8bf26042677a6f618efccfd26d124b91635ca6ba2f0d877eab: (from mysql:5 node:deis-03) start
2015-04-22T20:24:00.000000000Z (from swarm node:deis-03) engine_disconnect
@smothiki
smothiki / gist:5e6d69db798998c35ad4
Last active August 29, 2015 14:20
Failure cases if we dont have seperate Key Space for schdulers
User Forgot to set the config for schedulerModule
  1. user ran deisctl install <scheduler> && deisctl start <scheduler> .
  2. The scheduler will keep publishing the /deis/controller/schedulerTarget to scheduler endpoint. But still uses fleet with the endpoint of the new scheduler
User Forgot to stop the scheduler
  1. if a user forgots to stop scheduler and set the config for schedulerModule to a different scheduler
  2. Both the schedulers try to set deis/controller/schedulerTarget and controller keep updating the confd templates accordingly.
@smothiki
smothiki / gist:6ca6a9506d14b54e657e
Last active August 29, 2015 14:20
Customizing deis scheduler
Consideration

Docker engine should run on port 2375 in each node and manager should be able to access port 2395

etcd keys
  1. Swarm uses deis/scheduler/swarm/node to identify other nodes in the cluster
  2. Publishes swarm manager host IP to /deis/scheduler/swarm/host
  3. set /deis/controller/schedulerModule to swarm to use swarm scheduler for deis
steps to install and start swarm
  1. deisctl install swarm