Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

Commit

Permalink
decouple assets and ignition from main bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
enxebre committed Jan 23, 2018
1 parent ad15908 commit 331684f
Show file tree
Hide file tree
Showing 50 changed files with 701 additions and 785 deletions.
37 changes: 0 additions & 37 deletions modules/aws/etcd/ignition.tf

This file was deleted.

25 changes: 0 additions & 25 deletions modules/aws/etcd/ignition_s3.tf

This file was deleted.

13 changes: 11 additions & 2 deletions modules/aws/etcd/nodes.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
locals {
ami_owner = "595879546273"
arn = "aws"
ami_owner = "595879546273"
arn = "aws"
ignition_etcd_keys = ["ignition_etcd_0.json", "ignition_etcd_1.json", "ignition_etcd_2.json"]
}

data "aws_ami" "coreos_ami" {
Expand Down Expand Up @@ -98,6 +99,14 @@ resource "aws_iam_role_policy" "etcd" {
EOF
}

data "ignition_config" "s3" {
count = "${length(var.external_endpoints) == 0 ? var.instance_count : 0}"

replace {
source = "${format("s3://%s/%s", var.s3_bucket, local.ignition_etcd_keys[count.index])}"
}
}

resource "aws_instance" "etcd_node" {
count = "${length(var.external_endpoints) == 0 ? var.instance_count : 0}"
ami = "${coalesce(var.ec2_ami, data.aws_ami.coreos_ami.image_id)}"
Expand Down
20 changes: 1 addition & 19 deletions modules/aws/etcd/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ variable "ec2_type" {
type = "string"
}

variable "ec2_ami" {
type = "string"
default = ""
}

variable "extra_tags" {
description = "Extra AWS tags to be applied to created resources."
type = "map"
Expand Down Expand Up @@ -74,18 +69,10 @@ variable "sg_ids" {
description = "The security group IDs to be applied."
}

variable "ign_etcd_dropin_id_list" {
type = "list"
}

variable "s3_bucket" {
type = "string"
}

variable "ign_etcd_crt_id_list" {
type = "list"
}

variable "etcd_iam_role" {
type = "string"
default = ""
Expand All @@ -97,12 +84,7 @@ variable "dns_server_ip" {
default = ""
}

variable "ign_profile_env_id" {
type = "string"
default = ""
}

variable "ign_systemd_default_env_id" {
variable "ec2_ami" {
type = "string"
default = ""
}
89 changes: 0 additions & 89 deletions modules/aws/master-asg/ignition.tf

This file was deleted.

36 changes: 0 additions & 36 deletions modules/aws/master-asg/ignition_s3.tf

This file was deleted.

18 changes: 18 additions & 0 deletions modules/aws/master-asg/master.tf
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,24 @@ resource "aws_autoscaling_group" "masters" {
}
}

data "ignition_config" "s3" {
append {
source = "http://${var.cluster_name}-ncg.${var.base_domain}/ignition?profile=controller"
}

files = ["${data.ignition_file.kubeconfig.id}"]
}

data "ignition_file" "kubeconfig" {
filesystem = "root"
path = "/etc/kubernetes/kubeconfig"
mode = 0644

content {
content = "${var.kubeconfig_content}"
}
}

resource "aws_launch_configuration" "master_conf" {
instance_type = "${var.ec2_type}"
image_id = "${coalesce(var.ec2_ami, data.aws_ami.coreos_ami.image_id)}"
Expand Down
45 changes: 0 additions & 45 deletions modules/aws/master-asg/resources/detect-master.sh

This file was deleted.

35 changes: 0 additions & 35 deletions modules/aws/master-asg/resources/init-assets.sh

This file was deleted.

1 change: 0 additions & 1 deletion modules/aws/master-asg/variables-ignition.tf

This file was deleted.

Loading

0 comments on commit 331684f

Please sign in to comment.