Skip to content

Instantly share code, notes, and snippets.

View mhausenblas's full-sized avatar
🤷‍♂️
weeks of coding can save you hours of planning!

Michael Hausenblas mhausenblas

🤷‍♂️
weeks of coding can save you hours of planning!
View GitHub Profile
@mhausenblas
mhausenblas / cool-script.sh
Created April 13, 2015 15:48
Marathon test script
#!/bin/bash
while [ true ] ; do echo 'Hello Marathon' ; sleep 5 ; done
@mhausenblas
mhausenblas / webapp.py
Created May 11, 2015 03:13
Marathon app groups example Web application
import sys
import urlparse
import BaseHTTPServer
import redis
r = redis.StrictRedis(host='10.141.141.10', port=31000, db=0)
class WebApp(BaseHTTPServer.BaseHTTPRequestHandler):
def do_GET(self):
@mhausenblas
mhausenblas / README.md
Last active July 3, 2020 13:30
London MUG 2015-09-24: Kubernetes demo

Demo

  • Create a DCOS CE cluster
  • dcos package install kubernetes takes 1-2 min until UI is available
  • Install kubectl as per the docs
  • Set up K8S: export KUBERNETES_MASTER=$FQHN_OF_DASHBOARD/service/kubernetes/api
    $ dcos package list
 $ dcos marathon app add marathon-gen.json
@mhausenblas
mhausenblas / README.md
Last active March 21, 2016 08:08
Kubernetes debugging session leveraging labels

That's our RC:

$ cat ws-rc.yaml
apiVersion: v1
kind: ReplicationController
metadata:
  name: webserver-rc
spec:
  replicas: 5

selector:

Verifying that +mhausenblas is my blockchain ID. https://onename.com/mhausenblas
@mhausenblas
mhausenblas / dcos-kafka-demo.md
Last active March 15, 2016 12:57
DCOS Kafka demo

Ramp up CCM/Pool cluster 1.6.1 (EA at time of writing) using Kafka 0.9.0

Install Kafka and launch broker:

$ dcos package install kafka
$ dcos kafka broker add 0
$ dcos kafka broker start 0
broker started:
  id: 0

active: true

@mhausenblas
mhausenblas / sanitizer.sh
Last active May 2, 2016 06:32
dploy example sanitizer
#!/bin/sh
bg_port=$(dig _buzzgen-dployex._tcp.marathon.mesos SRV | grep ^_buzzgen-dployex._tcp.marathon.mesos. | cut -d " " -f 6)
bg_addsec=$(dig _buzzgen-dployex._tcp.marathon.mesos SRV | grep ^_buzzgen-dployex._tcp.marathon.mesos. | cut -d " " -f 7)
bg_ip=$(dig _buzzgen-dployex._tcp.marathon.mesos SRV | grep ^"${bg_addsec}" | cut -d " " -f 5)
for i in $(seq 1 50) ; do
curl -s "$bg_ip":"$bg_port" | cut -d " " -f $(( 1 + RANDOM % 7 )) >>index.html
done
@mhausenblas
mhausenblas / azure-public-node.md
Last active December 15, 2016 13:29
How to expose apps on DC/OS public node on Azure
@mhausenblas
mhausenblas / marathon-wp.json
Created May 19, 2016 10:14
A Marathon app spec for Wordpress using Marathon-lb to expose it
{
"id": "wordpress",
"container": {
"type": "DOCKER",
"docker": {
"image": "tutum/wordpress:latest",
"network": "BRIDGE",
"portMappings": [
{
"containerPort": 80,
@mhausenblas
mhausenblas / cockroach.json
Created May 24, 2016 09:21
A Marathon app spec to launch CockroachDB (dev/test mode)
{
"id": "cockroachdb",
"instances": 1,
"cpus": 1,
"mem": 300,
"cmd": "./cockroach start --insecure --host=0.0.0.0 --logtostderr",
"container": {
"type": "DOCKER",
"docker": {
"image": "cockroachdb/cockroach:beta-20160512",