Skip to content

Instantly share code, notes, and snippets.


Herman hermanbanken

View GitHub Profile
hermanbanken /
Created Nov 22, 2020
Kustomize Vars example

This was initially posted in an kubernetes-sigs/kustomize issue.

We are using Kustomize's vars feature. Initially we didn't understand how to use it for our purpose, but it is a 100% fit. One example is our Ingress resource, which looks like this:

# file: base/ingress.yaml
kind: Ingress
  name: services
hermanbanken / config.js
Created Oct 3, 2020
TURN on Jitsi on kubernetes (k8s)
View config.js
// adapted from default
export const settings = {
useStunTurn: true,
p2p: {
enabled: false, // disabled for testing
useStunTurn: true,
// Some other settings for resolution & parallel talking as relevant for our usecase
hermanbanken /
Last active Aug 26, 2020
Envoy Cluster SubSet Load Balancing
hermanbanken /
Last active May 14, 2020
Scan for credentials (GNU/BSD)
# Remember, never run shell scripts from the internet: go ahead verify the SHA!
curl | \
sed s/=grep/=ggrep/ | \
bash -x
View repro1.yaml
kind: Deployment
# repro1.yaml
apiVersion: apps/v1
kind: Deployment
name: demo
namespace: default
replicas: 2
# in next apply we'll remove this replicas property
hermanbanken /
Last active Jan 10, 2020
Reproducible Image SHA with Kaniko

Reproducible Container Image SHA's with Kaniko

At Q42 we use Docker a lot nowadays. A few projects use full-fledged Kubernetes on GKE with Docker images. Other projects use docker with AppEngine Flex, which has become our standard for quickly deploying a standalone workload, because it does the boring things like hosting & SSL (LetsEncrypt) for us.

In one particularly large project (Hue) we have a multitude of different micro-services that all have separate Docker images. Combined with CI/CD releasing to our test & staging environments,

View demux.go
type Muxed struct {
IsLast bool;
Payload []byte;
type State struct {
ReplyTo chan interface{}
// Incoming attaches [channel(buffer: 1)], if Mux finds multi-packet reply,
hermanbanken / WWDC-swiftui-basic-binding.swift
Last active Jun 11, 2019
101 SwiftUI.BindableObject with a Combine.Publisher
View WWDC-swiftui-basic-binding.swift
// This is the bare-minimum you need to know to create a SwiftUI.BindableObject with a Combine.Publisher
final class MyUserData: BindableObject {
// this ==vvvvvvv must be a `Publisher` type
let didChange = PassthroughSubject<MyUserData, Never>()
var myProperty = false {
didSet {
// this ==vvvvvvv
View WWDC.2019.Combine.snippets.swift
// Test.swift
// Q42
// Created by Herman Banken on 6/4/19.
import Foundation
import Combine
import RxSwift
You can’t perform that action at this time.