Skip to content

Instantly share code, notes, and snippets.

@ddgenome
ddgenome / rbac-noaccess.ts
Created January 15, 2019 16:56
Kubernetes RBAC role, service account, and role binding for no access to in-cluster Kubernetes API
import * as k8s from "@kubernetes/client-node";
import { DeepPartial } from "ts-essentials";
const serviceAccount: DeepPartial<k8s.V1ServiceAccount> = {
apiVersion: "v1",
kind: "ServiceAccount",
metadata: {
name: "noaccess",
},
};
const role: DeepPartial<k8s.V1Role> = {
@ddgenome
ddgenome / kaniko-gvisor-test.bash
Last active February 28, 2020 18:50
Run various versions of kaniko against runc and various versions of gVisor
#!/bin/bash
# test kaniko under gvisor
declare Pkg=kgtest
declare Version=0.1.0
set -o pipefail
# usage: msg MSG
function msg () {
@ddgenome
ddgenome / kube-context.bash
Last active May 15, 2020 15:07
Select kubectl context based on regular expression matching
# alias k for kubectl
# usage: k KUBECTL_ARGS...
function k () {
kubectl "$@"
}
# print or switch kubectl kubeconfig contexts
# usage: kc [MATCH_REGEXP]
function kc ()
{
#! /bin/sh
echo "hello, skills!"
date -u "$@"