Skip to content

Instantly share code, notes, and snippets.

View etoews's full-sized avatar

Everett Toews etoews

View GitHub Profile
  1. kubeadm
  1. bootkube
  • https://github.com/kubernetes-incubator/bootkube
  • a helper tool for launching self-hosted Kubernetes clusters. when launched, bootkube will act as a temporary Kubernetes control-plane (api-server, scheduler, controller-manager), which operates long enough to bootstrap a replacement self-hosted control-plane.
  1. kops
@etoews
etoews / peppernuts.md
Last active December 27, 2016 23:58
A recipe for peppernuts

Initial ingredients:

  • 1 cup white sugar
  • 1 cup Rogers Golden Syrup
  • 1 cup margarine
  • 1/2 tsp. cloves
  • 1 tsp. ginger
  • 1 tsp. aniseed
  • 1/2 tsp. mace

Mix all these ingredients in a heavy pot; boil for 2 min. Let cool until lukewarm.

@etoews
etoews / requirements-diff.py
Created December 7, 2016 22:55
Short script to find the intersection of your requirements and test requirements
#!/usr/bin/env python
requirements = set()
test_requirements = set()
with open('requirements.txt') as f:
for line in f:
requirements.add(line.split('==')[0])
with open('tests/test-requirements.txt') as f:
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config
service ssh restart
apt-get -y update
apt-get -y install fail2ban
@etoews
etoews / couchbase.sh
Last active June 13, 2016 12:11
Couchbase on Carina with Docker Swarm using an overlay network
$ docker-compose up -d
Creating couchbase_db_1
$ docker-compose scale db=2
WARNING: The "db" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
Creating and starting couchbase_db_2 ... done
$ docker run -it --rm \
--net couchbase_backend \
arungupta/couchbase \

Sign up for Carina

In the Carina Control Panel (the other tab), sign up for Carina.

⭐️ You only get one chance to enter your email address and password so be exact! ⭐️

Create your cluster

Click Add Cluster and name it mycluster

@etoews
etoews / with-overlay-network.sh
Last active May 12, 2016 15:07
How Docker Swarm handles rescheduling of a container with and without an overlay network
# with overlay network
$ docker network create backend
7496954c6896b2c141902e7c17955289e3f49a0edf51ef0c1ca79dd7f40200a1
$ docker run -d --name redis --net backend -p "6379:6379" -e reschedule:on-node-failure redis
5ecdae84a93ced4406ba2b46e8709069c8651e1a59558a479521d9eb4c00b12e
$ docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
@etoews
etoews / migrate-data-to-new-cluster.sh
Created May 11, 2016 02:19
Example of copy data to a new cluster from an from old cluster. https://getcarina.com/docs/tutorials/migrate-cluster/
$ eval $(carina env old)
$ export DOCKER_CERT_PATH_OLD=$DOCKER_CERT_PATH
$ export DOCKER_HOST_OLD=$DOCKER_HOST
$ export DOCKER_VERSION_OLD=$DOCKER_VERSION
$ eval $(carina env new)
$ docker create --name old-swarm-data --volume /etc/docker cirros
@etoews
etoews / openstackclient.sh
Created May 4, 2016 19:37
Configure the OpenStack Client to work on the Rackspace public cloud
pip install python-openstackclient
openstack complete > .osc.bash_completion
echo "source $HOME/.osc.bash_completion" >> $HOME/.profile
source $HOME/.profile
cat <<EOF > $HOME/rackspace.env
export OS_AUTH_URL=https://identity.api.rackspacecloud.com/v2.0/
export OS_REGION_NAME=IAD
version: '2'
services:
elasticsearch:
container_name: elasticsearch
image: elasticsearch:2.3
restart: unless-stopped
networks:
- logging
expose: