• Stars
    star
    397
  • Rank 108,561 (Top 3 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 7 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Configs and scripts for bootstrapping an opinionated Kubernetes cluster anywhere.

k8s-snowflake

Build Status

Configs and scripts for bootstrapping an opinionated Kubernetes cluster anywhere.

Except it's my snowflake opinionated k8s distro :)

NOTE: current support is only for Azure and Google Cloud.

Table of Contents

Provisioning

These are opinionated scripts. If you don't like my opinions maybe consider using one of the hundred-thousand other tools for provisioning a cluster.

I literally made this because I didn't like the opinion of other things... so here we are. :P

I purposely tried to keep this as minimal and simple as possible from the OS base up.

Base OS

Every node uses Intel's Clear Linux as the base. This is for reasons of security and performance. If you would like to learn more on that you should click the link to their site.

Encrypted etcd secret data at rest

Data is encrypted with aescbc. You verify it's encrypted by following these instructions.

RBAC and Pod Security Policies

Kubernetes is installed with RBAC and is set up with a few roles and bindings that map to pod security policies.

There is a restricted pod security policy which does not allow running privileged pods and does not allow privilege escalation which is through the linux no_new_privs flag.

There is also a permissive pod security policy.

There are two cluster role bindings created (which grant permissions across namespaces):

  • restricted: cannot create privileged pods, cannot escalate privileges, cannot run containers as root, cannot use the host network, IPC or PID namespace
  • permissive: can create pods that are privileged and use the privileged pod security policy

Container Runtime

The cluster uses cri-containerd with runc as the container runtime.

Networking

The cluster uses cilium as a networking plugin. I like cilium because it uses BPF and XDP and their design is something I could wrap my head around. You should checkout their repo it's one of the cleanest implementations I have seen. You should checkout their really sweet BPF and XDP Reference Guide too!

Azure

Make sure you have the az tool installed. You can find instructions on downloading that here.

Make sure you are logged in.

To provision your cluster, clone this repo and run:

$ ./azure/setup.sh

The script automatically sets up an admin user with kubeconfig locally so you should be able to just run kubectl after!

NOTE: if you want to change the number of nodes, etc checkout the environment variables at the top of azure/setup.sh.

Google Cloud

Make sure you have the gcloud tool installed. You can find instructions on downloading that here.

Make sure you are logged in.

To provision your cluster, clone this repo and run:

$ VM_USER="your_ssh_user" ./gcloud/setup.sh

The script automatically sets up an admin user with kubeconfig locally so you should be able to just run kubectl after!

NOTE: if you want to change the number of nodes, etc checkout the environment variables at the top of gcloud/setup.sh.

Acknowledgements

Thanks to @kelseyhightower for kubernetes-the-hard-way which helped a lot of this.

If you are wondering why I didn't use something like cloud-init it's because Clear Linux has a pretty weirdly behaving version of cloud-init and I love bash, m'kay.

More Repositories

1

dockerfiles

Various Dockerfiles I use on the desktop and on servers.
Dockerfile
13,270
star
2

dotfiles

My dotfiles. Buyer beware ;)
Shell
3,166
star
3

.vim

My .vim dotfiles and configurations.
Vim Script
618
star
4

gmailfilters

A tool to sync Gmail filters from a config file to your account.
Go
552
star
5

branch-cleanup-action

A GitHub action to automatically delete the branch after a pull request has been merged.
Shell
427
star
6

dockfmt

Dockerfile format and parser. Like `gofmt` but for Dockerfiles.
Go
425
star
7

tdash

A terminal dashboard with stats from Google Analytics, GitHub, Travis CI, and Jenkins. Very much built specific to me.
Go
307
star
8

netscan

Scan network ips and ports.
Go
255
star
9

s3server

Server to index & view files in a s3 or Google Cloud Storage bucket.
Go
235
star
10

morningpaper2remarkable

A bot to sync the morning paper to a remarkable tablet.
Go
219
star
11

gitable

Bot to automatically sync and update an airtable sheet with GitHub pull request and issue data.
Go
201
star
12

advent-of-cuda

Doing advent of code with CUDA and rust.
Rust
200
star
13

onion

Tor networking plugin for Docker containers. Route all container tcp traffic through Tor.
Go
198
star
14

hashtag-pull

Get all twitter, vine, and instagram posts with a certain hashtag, print the feed, and save to a database for future use. (old & depreciated)
PHP
180
star
15

gadgets

A repo to keep track of interesting gadgets and toys that I find or someone tells me about.
158
star
16

pony

Local file-based password, API key, secret, recovery code store backed by GPG.
Go
149
star
17

cliaoke

Command Line Karaoke.
Go
147
star
18

jenkins-dsl

Jenkins DSLs for my Jenkins instance, keeps forks up to date, mirrors repositories to private git, builds all Dockerfiles and more.
Groovy
132
star
19

containers

OCI compatible & runc configs for various containers.
Shell
129
star
20

aws-fargate-action

A GitHub action to deploy to AWS Fargate on push to the master branch.
HCL
121
star
21

blog

Source for my blog.
CSS
114
star
22

tupperwarewithspears

Distributed load testing with containers, Apache benchmark, with OpenVSwitch for networking.
Go
108
star
23

openai.vim

OpenAI GPT-3 plugin for vim.
Vim Script
96
star
24

shaking-finger-action

A GitHub action that displays a gif of Conan O'Brien shaking his finger to a pull request on fail.
Shell
95
star
25

cni-benchmarks

A simple program to benchmark various container networking (CNI) plugins.
Go
84
star
26

lkml.wtf

Source code for lkml.wtf.
HTML
78
star
27

jessfraz

74
star
28

pastebinit

Go implementation of pastebinit.
Go
73
star
29

tor

Development fork of https://git.torproject.org/tor.git
C
67
star
30

random-forest-classifier

A random forest classifier in Javascript.
JavaScript
58
star
31

irssi

Official Docker image for irssi.
Shell
50
star
32

strace2elastic

Strace container output to a file, then shove the syscalls into elastic search.
Python
49
star
33

printinator

A MacOS menubar for 3D printers.
Swift
47
star
34

macgyver

The Macgyver of Dlopening: `dlopen` yourself!
Go
45
star
35

ship

Command line tool to track packages using the AfterShip API.
Go
45
star
36

what-can-i-say-im-a-hopeless-open-source-romantic

Repo for designing shirts!
42
star
37

directory-theme

A customizable theme for your Apache or Nginx directory. (old & depreciated)
HTML
39
star
38

terraform-cluster

Scripts to create a minimal mesos or nomad cluster using terraform.
HCL
39
star
39

ykpiv

Go bindings for ykpiv so you can write Go to interact with your yubikeys.
Go
35
star
40

libyubikey

Go bindings for libyubikey so you can write Go to interact with your yubikeys.
Go
35
star
41

dstats

Docker stats dashboard for your terminal. (WIP that was never finished)
JavaScript
34
star
42

tripitcalb0t

Bot to automatically create Google Calendar events from TripIt flight data.
Go
29
star
43

battery

Linux battery status checker.
Makefile
28
star
44

apparmor-docs

Auto generated pdfs of apparmor .odt files direct from launchpad branch.
Makefile
28
star
45

junk

A place for everything without a home.
Go
27
star
46

party-clippy

Go server that shows clippy. Nice for curl in demos.
Go
23
star
47

systemd-butts

Chrome extension to replace systemd with butts on websites.
JavaScript
20
star
48

github-rate-limit

A little web app deployed to Vercel to return a more human-readable JSON output from the GitHub rate limit endpoint.
Go
17
star
49

goodreads-dewey

A tool to get the dewey decimal number for books in your Goodreads account.
Go
16
star
50

docker-presentation

Instructions on building a server with Docker and Nginx on Ubuntu trusty 14.04. (old & depreciated)
Shell
16
star
51

weirdtrickmafia.fm

Site for the podcast.
HTML
15
star
52

linux

Fork of Linux kernel for development (includes linux-security & linux-next).
C
13
star
53

jessfraz-overlay

Portage overlay with custom Gentoo ebuilds.
Shell
12
star
54

secping

A tool for reading the SECURITY_CONTACTS file in a kubernetes repository.
Go
11
star
55

usbc-pal

10
star
56

go-benchmarks

Run go test benchmarks for versions over time.
Dockerfile
6
star
57

snippetlib

Site for hosing code snippets. (old & deprecated)
Less
5
star
58

generator-xbars

Yeoman generator for node with express, handlebars, & bootstrap. (old & depreciated)
JavaScript
3
star
59

present.j3ss.co

Go talk slides made with https://golang.org/x/tools/cmd/present.
Shell
3
star
60

notorious-svg

Barrel Creative Days Project.
CSS
2
star