Skip to content

Instantly share code, notes, and snippets.

View superseb's full-sized avatar

Sebastiaan van Steenis superseb

  • Qdrant
  • Netherlands
  • 16:48 (UTC +02:00)
View GitHub Profile
@superseb
superseb / info.txt
Created May 18, 2017 13:03
Docker daemon: unregister_netdevice: waiting for lo to become free. Usage count = 1
Related issues:
https://github.com/coreos/bugs/issues/254
https://github.com/moby/moby/issues/5618
There is a workaround implemented by Kubernetes (https://github.com/kubernetes/kubernetes/blob/release-1.6/pkg/kubelet/network/kubenet/kubenet_linux.go#L345) and other Docker-based solutions (flynn: https://github.com/flynn/flynn/commit/9d94ea8e2ad7a626f74ff03cb82e8d0efe1b42b5). The fix is putting the docker0 bridge in promiscuous mode by executing `ip link set docker0 promisc on`.
@superseb
superseb / debug.md
Last active May 19, 2017 10:24
Rancher metadata error self/service self/container
time="2017-05-11T09:03:39Z" level=info msg="Error: /self/service" client=10.42.96.139 version=2015-12-19 
time="2017-05-11T09:03:41Z" level=info msg="Error: /self/container" client=10.42.17.88 version=2015-12-19 
time="2017-05-11T09:03:41Z" level=info msg="Error: /self/service" client=10.42.66.225 version=2015-12-19 

Showing gateway for Docker bridge network: docker network inspect bridge -f "{{range .IPAM.Config}}{{.Gateway}}{{end}}"

All hosts should return the same gateway.

@superseb
superseb / playbook.yml
Created June 5, 2017 20:32
Rancher create k8s env template and environment with custom MTU using Ansible
---
- hosts: localhost
connection: local
gather_facts: no
tasks:
- name: Create new environment template
uri:
url: "http://{{ ansible_ssh_host }}:8080/v2-beta/projecttemplate"
method: POST
@superseb
superseb / veth.sh
Last active June 7, 2017 11:08
Docker veth to container mapping
#!/bin/bash
# Credits to https://superuser.com/a/1183520
for container in $(docker ps -q); do
if docker exec -t $container which sh > /dev/null 2>&1; then
iflink=`docker exec -it $container sh -c 'cat /sys/class/net/eth0/iflink'`
iflink=`echo $iflink|tr -d '\r'`
veth=`grep -l $iflink /sys/class/net/veth*/ifindex`
veth=`echo $veth|sed -e 's;^.*net/\(.*\)/ifindex$;\1;'`
echo $container:$veth
else
@superseb
superseb / rancher-rodeo-notes.md
Last active June 27, 2017 09:57
Rancher Rodeo notes

DEPRECATED as of 2017-06-27, see README here https://github.com/chrisurwin/rancher-rodeo

Prerequisites

  • Machine with 8GB RAM, SSD – Run 1 rancher server and 3 nodes (change the RAM size)
  • Machine with 16GB RAM NVME Disk – Run 1 Rancher Server and 3 VMS
  • 4 VMs running in Cloud (2GB each, ensure security group has UDP 500 & 4500, TCP 8080, 2049 & 80 open. Recommend all traffic on UDP and TCP allowed in local network)

Only run Docker 1.12.6 if you want the K8s demo to work!

Vagrant users

@superseb
superseb / docker-compose.yml
Created June 30, 2017 14:28
Rancher simulate DB network fail
version: '2'
services:
db:
image: mariadb:5.5
command: --character-set-server=utf8 --collation-server=utf8_general_ci
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=cattle
@superseb
superseb / cloud-config.yml
Created July 7, 2017 16:54
rancheros NFS mount
#cloud-config
write_files:
- path: /etc/rc.local
permissions: "0755"
owner: root
content: |
#!/bin/bash
mkdir -p /mnt/nfs-1
mkdir -p /mnt/nfs-2
cloud-init-execute
@superseb
superseb / docker-17.06.0-ce.yml
Created July 8, 2017 07:40
RancherOS docker-17.06.0-ce
docker:
image: rancher/os-docker:17.06.0${SUFFIX}
command: ros user-docker
environment:
- HTTP_PROXY
- HTTPS_PROXY
- NO_PROXY
labels:
io.rancher.os.scope: system
io.rancher.os.after: console
@superseb
superseb / rancher.irule
Created July 12, 2017 15:47
f5 rancher irule
when HTTP_REQUEST {
HTTP::header insert "X-Forwarded-Proto" "https";
HTTP::header insert "X-Forwarded-Port" "443";
HTTP::header insert "X-Forwarded-For" [IP::client_addr];
}
@superseb
superseb / rancher-k8s-grafana-ingress.yml
Created July 14, 2017 11:10
rancher kubernetes k8 grafana ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: grafanalb
namespace: kube-system
spec:
backend:
serviceName: monitoring-grafana
servicePort: 80