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 / nginx-statefulset.yaml
Created April 19, 2018 09:32
Simple StatefulSet for testing purposes
apiVersion: v1
kind: Service
metadata:
name: nginx
labels:
app: nginx
spec:
ports:
- port: 80
name: web
@mhausenblas
mhausenblas / README.md
Created April 4, 2018 14:02
Developing apps on Kubernetes

Developing apps on Kubernetes

2018-04-04 at CNCF Paris

How do you develop a Kubernetes app, that is, how do you write and test an app that is supposed to run on Kubernetes? In this talk Michael will discuss the challenges as well as review potential tools (incl. Telepresence, ksync, and kubed-sh) you want to be aware of to successfully write Kubernetes apps.

The demo app used throughout here is kubernauts/dok-example-us.

@mhausenblas
mhausenblas / README.md
Last active January 11, 2018 20:45
My favs kubectl commands

Docs and config

What was that field in the manifest again?

$ kubectl explain statefulset.spec.template.spec

List contexts:

@mhausenblas
mhausenblas / Dockerfile
Created January 5, 2018 12:39
Dockerfile for Spectre
FROM gcc:7
COPY spectre.c /usr/src/
WORKDIR /usr/src
RUN gcc -std=c99 -O0 spectre.c -o spectre
CMD ["./spectre"]
@mhausenblas
mhausenblas / minikubeup.sh
Created September 2, 2017 04:06
The way how I configure and run Minikube (also make sure to `minikube addons list` and enable what you need)
#!/usr/bin/env bash
minikube start \
--cpus=3 \
--memory=7000 \
--kubernetes-version=v1.7.4 \
--extra-config=apiserver.GenericServerRunOptions.AdmissionControl=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,ResourceQuota,DefaultTolerationSeconds,PodSecurityPolicy
@mhausenblas
mhausenblas / jump.yaml
Last active August 28, 2017 08:03
A jump box pod for Kubernetes troubleshooting, use `kubectl exec jump -c busybox -i -t -- sh` to connect to it
apiVersion: v1
kind: Pod
metadata:
name: jump
spec:
containers:
- name: busybox
image: busybox
command:
- sleep
@mhausenblas
mhausenblas / README.md
Created August 27, 2017 08:36
Doing Kubernetes The Hard Way, A Walkthrough
@mhausenblas
mhausenblas / cat-unit-example.go
Last active June 30, 2017 05:53
CAT unit test example
var (
probetests = []struct {
launchfunc func(string) error
scheme string
port string
version string
secure bool
}{
{util.Etcd2Up, "http", "2379", "2", false},
{util.Etcd3Up, "http", "2379", "3", false},
@mhausenblas
mhausenblas / main.go
Created April 21, 2017 09:42
A simple Go program for interacting with a Kubernetes cluster
package main
import (
"flag"
"fmt"
"github.com/chzyer/readline"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/tools/clientcmd"
@mhausenblas
mhausenblas / rc.yaml
Created April 18, 2017 10:45
Kubernetes Services Demystified
apiVersion: v1
kind: ReplicationController
metadata:
name: sise
spec:
replicas: 1
selector:
app: sise
template:
metadata: