• Stars
    star
    113
  • Rank 310,115 (Top 7 %)
  • Language HCL
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 8 years ago

Reviews

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

Repository Details

Simple Kubernetes cluster on CoreOS in AWS using Terraform

Kubernetes on CoreOS in AWS using Terraform

Provision a Kubernetes cluster with Terraform on AWS.

Inspired by kubestack

Status

This is no longer maintained. All the versions are old. Feel free to use this to inspire you.

Prep

Terraform

Terraform will be used to declare and provision a Kubernetes cluster.

Prep

Create a terraform.tfvars file in the top-level directory of the repo with content like:

ssh_key_name = name_of_my_key_pair_in_AWS
access_key = my_AWS_access_key
secret_key = my_AWS_secret_key

This file is ignored by git. You can also set these by using environment variables.

You also need to make sure you are running ssh-agent and have your AWS key added.

Usage

This repo includes a very simple Makefile that will handle generating an etcd discovery token.

To create the cluster, run make apply

To destroy the cluster, run make destroy

You can override any variables listed in variables.tf such as the ami to use, number of nodes, etc

Next Steps

When you create a cluster, it will output something like:

Outputs:
  kubernetes-api-server =
# Use these commands to configure kubectl
kubectl config set-cluster testing --insecure-skip-tls-verify=true --server=IP
kubectl config set-credentials admin --token='4c98e411'
kubectl config set-context testing --cluster= testing --user=admin
kubectl config use-context testing

Run these commands to configure kubectl. You can see these commands again by running terraform output kubernetes-api-server

Test this by running kubectl get nodes

You should now be able to use kubectl to create services. See the kubernetes examples to get started.

TODO

Differences from kubestack

Most of the differences are based on my personal opionions and/or just trying a different approach.

  • We use base CoreOS image and install Kubernetes at boot time. This was originally to skip the "build image, upload, test, repeat" cycle during development, but it does expose the install process more clearly.
  • We use etcd in proxy mode on the master and workers rather than pointing directly to etcd servers.

More Repositories

1

php-fpm-exporter

Prometheus exporter for php-fpm status.
Go
181
star
2

kubernetes-envoy-example

Teaching myself about Envoy on Kubernetes
Go
120
star
3

minikube-prometheus-demo

Simple demo using minikube to deploy Prometheus and Grafana
Shell
106
star
4

omnibus-nginx

Omnibus packaging for Openresty/nginx
Ruby
36
star
5

cookbook-gdebi

Simple cookbook that wraps gdebi
Ruby
34
star
6

lua-resty-riak

Lua riak protocol buffer client driver for the ngx_lua based on the cosocket API
Lua
25
star
7

gearman-exporter

Gearmand metrics exporter for Prometheus
Go
21
star
8

alertmanager-webhook-example

simple webhook receiver for Prometheus Alertmanager
Go
18
star
9

zocker

bocker with ZFS: ZFS based "docker" implementation in bash
Shell
16
star
10

lua-resty-beanstalkd

Simple Beanstalkd client for nginx/openresty
Lua
15
star
11

kube-log-tail

Deprecated. I now use https://github.com/wercker/stern
Go
15
star
12

ansible-runit

Ansible role for runit
Python
13
star
13

nginx-example-lua-module

C
13
star
14

logrus-middleware

Simple logging middleware for Go net/http
Go
12
star
15

zfsd

Simple HTTP interface for ZFS
Go
12
star
16

k8s-client

Simple Kubernetes client for Go
Go
11
star
17

knife-fifo

Project Fifo Support for Chef's Knife Command
Ruby
11
star
18

vagrant-chef-apply

Simple Vagrant provisioner using chef-apply
Ruby
10
star
19

stardust

Simple OpenResty web framework
Lua
8
star
20

grpc-fastcgi-proxy

WIP: grpc to fastcgi proxy
Go
7
star
21

zfs-flex-volume

Simple ZFS flexVolume driver for Kubernetes
Go
7
star
22

terraform-provider-etcd

etcd provider for Terraform
Go
7
star
23

alertmanager-config-controller

Construct an Alertmanager config from snippets stored in Kubernetes ConfigMaps
Go
6
star
24

terraform-provider-coreos

Terraform Provider for getting the latest CoreOS AMI
Go
6
star
25

protoc-gen-php-grpc

Experimental PHP gRPC server generation
PHP
6
star
26

project-fifo-ruby

Basic Ruby client for project-fifo
Ruby
6
star
27

iap-token-source

Go oauth2 Token Source for client authentication with GCP Identity Aware Proxy
Go
5
star
28

terraform-provider-kubernetes

Placeholder for a Kubernetes provider for Terraform
Go
5
star
29

json-rpc-example

Example JSON-RPC over HTTP server in Go using Gorilla
Go
5
star
30

k8s-nginx

Simple nginx proxy for kubernetes api
Shell
4
star
31

kitchen-fifo

Project-FIFO driver for Kitchen
Ruby
4
star
32

lua-resty-logstash-logger

Simple logger for ngx_lua for logging directly to logstash
Lua
4
star
33

diary

Simple Log package for Go
Go
3
star
34

vagrant-fifo

Vagrant provider for Project-FiFo
Ruby
3
star
35

lua-resty-redis-lock

Simple locking mechanism for redis in nginx/Lua
Lua
3
star
36

ngx_http_filter_cache

C
3
star
37

openresty-buildpack

Simple buildpack for openresty apps
Shell
3
star
38

slogotlp

OPenTelemetry otlp exporter for slog
Go
3
star
39

openresty-example-app

Example app using openresty-buildpack
Ruby
3
star
40

prometheus-http-discovery

Prometheus sidecar to discover targets by calling HTTP endpoints
Go
3
star
41

statsd-exporter-convert

Converter for statsd_exporter mappings config
Go
3
star
42

neckbeard

JSON log munger and forwarder for logstash
2
star
43

nginx-php-grpc

PHP gRPC server using only nginx
PHP
2
star
44

fog-fifo

Initial Fifo driver for fog
Ruby
2
star
45

single-box-kubernetes

Simple, single box Kubernetes install on CoreOS using Vagrant
Shell
2
star
46

twirpzap

Structured logs for twirp servers using zap
Go
2
star
47

grpc-the-hard-way

Go gRPC clients and servers written without using https://github.com/grpc/grpc-go
Go
2
star
48

configmap-aggregator

Aggregate multiple Kubernetes configmaps into a single one.
Go
2
star
49

blog

Brian's blog
Ruby
1
star
50

go-real-ip

Go net/http middleware inspired by nginx real_ip
Go
1
star
51

kubernetes-goodies-list

List of Interesting Kubernetes addons, etc
1
star
52

protoc-gen-grpc-transcode

Protoc plugin to generate json->grpc transcoder for Go
Go
1
star
53

simple-process-manager

Experimental simple process manager
Go
1
star
54

openresty-docker

Shell
1
star
55

ansible-runit-module

simple runit module for ansible
Python
1
star
56

cookbook-riak-cluster

Simple cookbook for creating riak clusters
Ruby
1
star
57

grpc-fastcgi-example

Example application for use with grpc-fastcgi-proxy
PHP
1
star
58

tcp2stdout

Copy from TCP socket to STDOUT
Go
1
star
59

dial-dns-cache

DNS caching Dialer for Go
Go
1
star
60

main-combiner

Combine multiple Go main packages into a single binary
Go
1
star
61

etcd-helper

Simple etcd cluster helper
Go
1
star
62

coreos-kubernetes-ansible

WIP for Ansible+CoreOS+Vagrant+Kubernetes
1
star
63

kubernetes-example-controller

Example Kubernetes controller for a custom resource
Go
1
star
64

go-metrics-map

Simple map-based store for go-metrics
Go
1
star
65

omnibus-couchdb

very simple omnibus for couch
Ruby
1
star
66

berkshelf-gitpattern

Simple helper for berkshelf to add locations with template
Ruby
1
star
67

lua-resty-statsd

Statsd client for OpenResty
Lua
1
star
68

static-pod-validate

CLI utility for validating Kubernetes static pod manifests
Go
1
star
69

k8s-pod-deleter

Delete Kubernetes pods that have failed
Go
1
star
70

pubsub-push-middleware

PubSub Push helper for Go HTTP servers
1
star
71

net-http-recover

Simple Go net/http recovery middleware
Go
1
star
72

octwirp

OpenCensus instrumentation for twirp services in Go
Go
1
star
73

kubernetes-grafana-updater

Update grafana dasboards and datasources from data in Kubernetes
Go
1
star
74

grpc-client-transcode

Experiment with client side gRPC to HTTP/1.1 transcoding.
Go
1
star
75

pubsuboutput

GCP PubSub output for Elastic Filebeat
Go
1
star
76

simple-queue

Silly, simple local queue written in go. Inspired by beanstalkd using sqlite
Go
1
star
77

sops-wrap

Convenience wrapper for Mozilla sops
Go
1
star