Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bakins/kubernetes-coreos-terraform
Simple Kubernetes cluster on CoreOS in AWS using Terraform
https://github.com/bakins/kubernetes-coreos-terraform
Last synced: 5 days ago
JSON representation
Simple Kubernetes cluster on CoreOS in AWS using Terraform
- Host: GitHub
- URL: https://github.com/bakins/kubernetes-coreos-terraform
- Owner: bakins
- License: mit
- Created: 2015-05-28T20:29:26.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-27T02:01:34.000Z (over 8 years ago)
- Last Synced: 2024-08-04T18:01:21.202Z (3 months ago)
- Language: HCL
- Size: 29.3 KB
- Stars: 113
- Watchers: 12
- Forks: 31
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubernetes on CoreOS in AWS using Terraform
Provision a [Kubernetes](http://kubernetes.io) cluster with [Terraform](https://www.terraform.io) on AWS.
Inspired by [kubestack](https://github.com/kelseyhightower/kubestack)
## Status
This is no longer maintained. All the versions are old. Feel free to use this to inspire you.
## Prep
- [Install Terraform](https://www.terraform.io/intro/getting-started/install.html)## 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](https://www.terraform.io/docs/configuration/variables.html).
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](./Makefile) that will handle generating an etcd [discovery token](https://coreos.com/docs/cluster-management/setup/cluster-discovery/).
To create the cluster, run `make apply`
To destroy the cluster, run `make destroy`
You can override any variables listed in [variables.tf](./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](https://github.com/GoogleCloudPlatform/kubernetes/tree/master/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.