This repository was archived by the owner on Jul 30, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed
hack/terraform-quickstart Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,17 @@ resource "aws_instance" "worker_node" {
2525 }
2626}
2727
28+ resource "aws_instance" "master_node" {
29+ ami = " ${ data . aws_ami . coreos_ami . image_id } "
30+ instance_type = " m3.medium"
31+ key_name = " ${ var . ssh_key } "
32+ count = " ${ var . additional_masters } "
33+
34+ tags {
35+ Name = " ${ var . instance_tags } "
36+ }
37+ }
38+
2839data "aws_ami" "coreos_ami" {
2940 most_recent = true
3041
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ output "worker_ips" {
66 value = [" ${ aws_instance . worker_node . * . public_ip } " ]
77}
88
9+ output "master_ips" {
10+ value = [" ${ aws_instance . master_node . * . public_ip } " ]
11+ }
12+
913output "self_host_etcd" {
1014 value = " ${ var . self_host_etcd } "
1115}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ set -euo pipefail
33
44export BOOTSTRAP_IP=` terraform output bootstrap_node_ip`
55export WORKER_IPS=` terraform output -json worker_ips | jq -r ' .value[]' `
6+ export MASTER_IPS=` terraform output -json master_ips | jq -r ' .value[]' `
67export SELF_HOST_ETCD=` terraform output self_host_etcd`
78export SSH_OPTS=" -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
89
@@ -11,5 +12,10 @@ cd ../quickstart
1112
1213for IP in $WORKER_IPS
1314do
14- ./init-worker.sh $IP cluster/auth/kubeconfig
15+ ./init-node.sh $IP cluster/auth/kubeconfig
16+ done
17+
18+ for IP in $MASTER_IPS
19+ do
20+ TAG_MASTER=true ./init-node.sh $IP cluster/auth/kubeconfig
1521done
Original file line number Diff line number Diff line change @@ -27,6 +27,12 @@ variable "num_workers" {
2727 default = " 1"
2828}
2929
30+ variable "additional_masters" {
31+ description = " number of additional master nodes not including bootstrap node"
32+ type = " string"
33+ default = " 0"
34+ }
35+
3036variable "region" {
3137 description = " aws region"
3238 type = " string"
You can’t perform that action at this time.
0 commit comments