Skip to content

Instantly share code, notes, and snippets.

@elsonrodriguez
elsonrodriguez / kube-rolling.yml
Created August 14, 2015 05:29
Kubernetes rolling update, in style! With tmux and teamocil (https://github.com/remiprev/teamocil )
windows:
- name: kube-rolling
root: ~/
layout: main-horizontal
panes:
- commands:
- export update_command="kubectl rolling-update <rc-name> --update-period=1s --image=<image_url>"
- clear
- read -p "$update_command"
- $update_command
@elsonrodriguez
elsonrodriguez / kube_deploy.sh
Created October 2, 2015 04:27
Script to quickly test changes after committing code locally.
#!/bin/bash
REGISTRY_URL=domain.com/name/project
RC_NAME=replication-controller
GITVER=`git rev-parse -q HEAD | cut -c1-8`
DOCKER_TAG=$REGISTRY_URL:$GITVER
docker build -t $DOCKER_TAG .
docker push $DOCKER_TAG
kubectl rolling-update $RC_NAME --image=$DOCKER_TAG
@elsonrodriguez
elsonrodriguez / gist:1003536730b6d622039e
Created November 5, 2015 05:25
Kubectl bash magicks.
#get all nodes running pod with specified label
kubectl get pods -l “key=value" -o template --template='{{range .items }}{{.spec.nodeName}}{{"\n" | printf "%v"}}{{end}}’
@elsonrodriguez
elsonrodriguez / 00-mayflash.rules
Last active January 16, 2016 08:59
RetroRig-ES/Retroarch/AttractMode Notes
#KERNEL=="js?", ATTRS{name}=="HJZ Mayflash Wiimote PC Adapter", NAME="input/js100"
#SUBSYSTEM=="input", KERNEL=="js[0-9]*", ATTRS{name}=="HJZ Mayflash Wiimote PC Adapter", ENV{ID_INPUT_JOYSTICK}=="?*", MODE="0000", ENV{ID_INPUT_JOYSTICK}="", RUN+="/bin/rm %E{DEVNAME}"
SUBSYSTEM=="input", ATTRS{name}=="HJZ Mayflash Wiimote PC Adapter", ENV{ID_INPUT_JOYSTICK}=="?*", RUN+="/bin/rm %E{DEVNAME}", ENV{ID_INPUT_JOYSTICK}=""
SUBSYSTEM=="input", ATTRS{name}=="HJZ Mayflash Wiimote PC Adapter", KERNEL=="js[0-9]*", RUN+="/bin/rm %E{DEVNAME}", ENV{ID_INPUT_JOYSTICK}=""
@elsonrodriguez
elsonrodriguez / README.md
Last active March 29, 2016 16:08
Quick and dirty node selection

Quick and Dirty Node Selection

So first, let's create our pod.

$ kubectl create -f https://gist.githubusercontent.com/elsonrodriguez/60e53e2479dc3146447b/raw/3b4d703855500c829ae58d70e386b4e41e4f7996/pod.yaml
pod "gputest" created

Now let's see it go:

@elsonrodriguez
elsonrodriguez / copy_files.sh
Last active March 31, 2016 15:39
Single node on openstack.
scp ~/Downloads/*.deb user@host:
scp ~/Downloads/etcd*.tar.gz user@host:
scp ~/oss/kubernetes/_output/dockerized/bin/linux/amd64/k* user@host:

Intro

This is the formula for terminating k8s nodes that have a bad kubelet. This effectively fences nodes that are unable to unmount/detach their own storage.

Caveats

Early testing shows that this may not work if a node is rebooted in response to a kubelet/system issue. Therefore the action taken in response to a problem on a kubernetes node MUST BE to terminate it.

Overview

Make LB like this:

 "HealthCheck": {
@elsonrodriguez
elsonrodriguez / AWS Comformance Tests
Created April 23, 2016 02:40
Quick test for openstack PR
Summarizing 16 Failures:
[Fail] [k8s.io] EmptyDir volumes [It] should support (non-root,0777,default) [Conformance]
/Users/eorodrig/oss/kubernetes-elsonrodriguez/_output/local/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:1617
[Fail] [k8s.io] EmptyDir volumes [It] should support (root,0644,tmpfs) [Conformance]
/Users/eorodrig/oss/kubernetes-elsonrodriguez/_output/local/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:1617
[Fail] [k8s.io] EmptyDir volumes [It] volume on default medium should have the correct mode [Conformance]
/Users/eorodrig/oss/kubernetes-elsonrodriguez/_output/local/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:1617
@elsonrodriguez
elsonrodriguez / Amazon Results
Last active April 28, 2016 02:17
More test results.
Summarizing 20 Failures:
[Fail] [k8s.io] ConfigMap [It] should be consumable from pods in volume as non-root [Conformance]
/Users/elsonrodriguez/oss/kubernetes-elsonrodriguez/_output/local/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:1620
[Fail] [k8s.io] EmptyDir volumes [It] should support (non-root,0777,default) [Conformance]
/Users/elsonrodriguez/oss/kubernetes-elsonrodriguez/_output/local/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:1620
[Fail] [k8s.io] EmptyDir volumes [It] should support (root,0644,tmpfs) [Conformance]
/Users/elsonrodriguez/oss/kubernetes-elsonrodriguez/_output/local/go/src/k8s.io/kubernetes/test/e2e/framework/util.go:1620
@elsonrodriguez
elsonrodriguez / README.md
Last active May 9, 2016 20:04
A simple course to teach Kubernetes basics. Work in Progress!

Course Prerequisites

  • Local (No VM) terminal with working bash and curl (for Windows users, gitbash or cygwin can accomplish this).
  • Windows, Linux, OSX
  • Slack

Installing kubectl, the Kubernetes client

First create directories for this class: