Skip to content

Instantly share code, notes, and snippets.

Avatar
🇳🇱

Herman hermanbanken

🇳🇱
View GitHub Profile
@hermanbanken
hermanbanken / kustomize_vars.md
Created Nov 22, 2020
Kustomize Vars example
View kustomize_vars.md

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
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: services
@hermanbanken
hermanbanken / config.js
Created Oct 3, 2020
TURN on Jitsi on kubernetes (k8s)
View config.js
// adapted from default
export const settings = {
...defaultSettings,
useStunTurn: true,
p2p: {
enabled: false, // disabled for testing
useStunTurn: true,
},
// Some other settings for resolution & parallel talking as relevant for our usecase
}
@hermanbanken
hermanbanken / README.md
Last active Aug 26, 2020
Envoy Cluster SubSet Load Balancing
View README.md
@hermanbanken
hermanbanken / README.md
Last active May 14, 2020
Scan for credentials (GNU/BSD)
View README.md
# Remember, never run shell scripts from the internet: go ahead verify the SHA!
curl https://gist.githubusercontent.com/hermanbanken/96925cb9593137fd6816cefd8ac7e93a/raw/070f6bde93b362388b5612648ef17ae612e3cc5c/scan_filenames.sh | \
sed s/=grep/=ggrep/ | \
bash -x
View repro1.yaml
kind: Deployment
# repro1.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo
namespace: default
spec:
replicas: 2
# in next apply we'll remove this replicas property
@hermanbanken
hermanbanken / 20191224-reproducible-image-sha.md
Last active Jan 10, 2020
Reproducible Image SHA with Kaniko
View 20191224-reproducible-image-sha.md

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
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
didChange.send(self)
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.