Skip to content

Instantly share code, notes, and snippets.

View anguslees's full-sized avatar

Angus Lees anguslees

View GitHub Profile
@anguslees
anguslees / git-review-status.py
Created October 20, 2014 04:31
Simple script to check gerrit status of local git branches
#!/usr/bin/python
import re
import requests
import sys
import git
from pygerrit.rest import GerritRestAPI
@anguslees
anguslees / controller-norbac-v0.2.0.yaml
Created June 21, 2017 01:28
ksonnet/sealed-secrets controller.yaml - v0.2.0 without RBAC and serviceaccount
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: sealed-secrets-controller
namespace: kube-system
spec:
template:
metadata:
labels:
@anguslees
anguslees / echoheaders.jsonnet
Created June 26, 2017 01:24
basic echoheaders test serviice
local kube = import "kube.libsonnet";
local all = {
namespace:: "gus",
echo_ing: kube.Ingress("echoheaders") {
metadata+: { namespace: $.namespace },
spec+: {
backend: $.echo_svc.name_port,
},

Keybase proof

I hereby claim:

  • I am anguslees on github.
  • I am guslees (https://keybase.io/guslees) on keybase.
  • I have a public key ASDYlDcVcXGKmqaVeTvW4cm5wAgdfok2_WIRKkrCz2Nq-Ao

To claim this, I am signing this object:

@anguslees
anguslees / cert-manager.jsonnet
Created April 12, 2018 01:50
*wip* (untested) cert-manager, using kube.libsonnet
local kube = import "kube.libsonnet";
{
p:: "",
namespace:: {metadata+: {namespace: "kube-system"}},
Issuer(name):: kube._Object("certmanager.k8s.io/v1alpha1", "Issuer", name) {
},
ClusterIssuer(name):: kube._Object("certmanager.k8s.io/v1alpha1", "ClusterIssuer", name) {
@anguslees
anguslees / nodesh.sh
Last active December 2, 2020 01:05
"cloud-native" ssh replacement :P
#!/bin/sh
#
# The access this gives you is rather terrifing. Use sparingly.
#
set -e -x
node=$1
trap "kubectl delete pod nodesh-$node" EXIT
@anguslees
anguslees / .wl
Created June 18, 2018 05:13
ancient ~gus/.wl
; wanderlust setup -*- emacs-lisp -*-
; see nice example at http://www.tamaru.kuee.kyoto-u.ac.jp/~kokada/wl/src
(setq wl-user-mail-address-list
(list "gus@slug.org.au"
"gus@inodes.org"
"gus@madcow.inodes.org"
"gus@debian.org"
"gus@switchonline.com.au"
@anguslees
anguslees / billing.jsonnet
Last active January 3, 2020 05:28
jkcfg 'micro-service' example, rewritten in kubecfg/jsonnet
//
// A reimplementation of the "billing" micro-service example from
// https://github.com/jkcfg/jk/tree/master/examples/kubernetes/micro-service
//
// To use:
// 1. Install https://github.com/bitnami/kubecfg
// 2. Run:
// gist=https://gist.githubusercontent.com/anguslees/c2254bad4b7f7849b2d9704dc151710e/raw/acdda140ea24d688e700b19f84a1f2d30fccb8ac
// kubecfg -U $gist show billing.jsonnet # or other kubecfg subcommands
//
@anguslees
anguslees / flatcar-upgrader.jsonnet
Last active April 19, 2020 13:45
CoreOS Linux -> Flatcar upgrader
local kube = import "https://github.com/anguslees/k8s-home/raw/3818a2cd0c2065ee81c43c6fff5ef53b4d19825d/kube.libsonnet";
local utils = import "https://github.com/anguslees/k8s-home/raw/3818a2cd0c2065ee81c43c6fff5ef53b4d19825d/utils.libsonnet";
{
flatcar_upgrader: kube.DaemonSet("flatcar-upgrader") {
spec+: {
template+: {
spec+: {
nodeSelector+: {
"container-linux-update.v1.coreos.com/id": "coreos",
@anguslees
anguslees / snap.json
Created July 19, 2021 09:21
json portion of tmp/snap/0000000000114d8c-0000000013464bce.snap for etcd-io/etcd#13196
{
"Root": {
"Path": "/",
"CreatedIndex": 0,
"ModifiedIndex": 0,
"ExpireTime": "0001-01-01T00:00:00Z",
"Value": "",
"Children": {
"0": {
"Path": "/0",