Add bootstrapping scripts and nix expressions

This commit is contained in:
Jonas Juselius
2019-12-17 22:13:16 +01:00
parent a3fa5ebc36
commit 2f05becafe
17 changed files with 778 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
#!/usr/bin/env bash
TOP="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)/.."
if [ x$1 = x ]; then
ehco "usage: install-namespace.sh {namespace}"
exit 1
fi
namespace=$1
tmpfile=/tmp/new-$namespace.$$
cat << EOF > $tmpfile
apiVersion: v1
kind: Namespace
metadata:
labels:
name: $namespace
name: $namespace
---
apiVersion: v1
kind: Secret
metadata:
name: gitlab-registry-auth
namespace: $namespace
data:
.dockerconfigjson: eyJhdXRocyI6eyJodHRwczovL3JlZ2lzdHJ5Lml0cGFydG5lci5ubyI6eyJ1c2VybmFtZSI6ImpvbmFzIiwicGFzc3dvcmQiOiJTRldwLVk0bkVfdXpNZFJxeHp6SyIsImF1dGgiOiJhbTl1WVhNNlUwWlhjQzFaTkc1RlgzVjZUV1JTY1hoNmVrcz0ifX19
type: kubernetes.io/dockerconfigjson
EOF
kubectl apply -f $tmpfile
rm $tmpfile

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
kubectl delete secrets --all-namespaces --field-selector='type=kubernetes.io/service-account-token'

View File

@@ -0,0 +1,3 @@
#!/bin/sh
kubectl taint node $1 ClusterService="true":NoSchedule