Skip to content

Instantly share code, notes, and snippets.

@donpdonp
Created July 23, 2015 15:41
Show Gist options
  • Save donpdonp/3de0e82b808f0c979756 to your computer and use it in GitHub Desktop.
Save donpdonp/3de0e82b808f0c979756 to your computer and use it in GitHub Desktop.
DigitalOcean + CoreOS with Terraform
$ ssh core@45.55.11.xxx
Warning: Permanently added '45.55.11.xxx' (ED25519) to the list of known hosts.
CoreOS stable (717.3.0)
core@rethink-cluster-sfo1 ~ $
#cloud-config
ssh_authorized_keys:
- ssh-ed25519 AAAA..... user@host
coreos:
update:
reboot-strategy: off
etcd:
#addr: 10.9.8.112:4001
#peer-addr: 10.9.8.112:7001
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
resource "digitalocean_droplet" "my-cluster" {
count = "2"
name = "my-cluster-sfo1"
size = "512mb"
image = "coreos-stable"
region = "sfo1"
private_networking = true
ssh_keys = ["xx:xx:xx:xx:xx...."]
user_data = "${file("cloud-config.yml")}"
}
$ terraform apply
digitalocean_droplet.rethink-cluster.0: Creating...
image: "" => "coreos-stable"
ipv4_address: "" => "<computed>"
digitalocean_droplet.rethink-cluster.1: Creating...
image: "" => "coreos-stable"
digitalocean_droplet.rethink-cluster.1: Creation complete
digitalocean_droplet.rethink-cluster.0: Creation complete
Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment