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

Ignition assets #2940

Merged
merged 7 commits into from
Feb 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions modules/aws/etcd/ignition.tf

This file was deleted.

22 changes: 5 additions & 17 deletions modules/aws/etcd/ignition_s3.tf
Original file line number Diff line number Diff line change
@@ -1,25 +1,13 @@
resource "aws_s3_bucket_object" "ignition_etcd" {
count = "${length(var.external_endpoints) == 0 ? var.instance_count : 0}"

bucket = "${var.s3_bucket}"
key = "ignition_etcd_${count.index}.json"
content = "${data.ignition_config.etcd.*.rendered[count.index]}"
acl = "private"

server_side_encryption = "AES256"

tags = "${merge(map(
"Name", "${var.cluster_name}-ignition-etcd-${count.index}",
"KubernetesCluster", "${var.cluster_name}",
"tectonicClusterID", "${var.cluster_id}"
), var.extra_tags)}"
locals {
ignition_etcd_keys = ["ignition_etcd_0.json", "ignition_etcd_1.json", "ignition_etcd_2.json"]
}

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

replace {
source = "${format("s3://%s/%s", var.s3_bucket, aws_s3_bucket_object.ignition_etcd.*.key[count.index])}"
verification = "sha512-${sha512(data.ignition_config.etcd.*.rendered[count.index])}"
source = "${format("s3://%s/%s", var.s3_bucket, local.ignition_etcd_keys[count.index])}"

# TODO: add verification
}
}
18 changes: 0 additions & 18 deletions modules/aws/etcd/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,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 @@ -96,13 +88,3 @@ variable "dns_server_ip" {
type = "string"
default = ""
}

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

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

This file was deleted.

28 changes: 12 additions & 16 deletions modules/aws/master-asg/ignition_s3.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
resource "aws_s3_bucket_object" "ignition_master" {
bucket = "${var.s3_bucket}"
key = "ignition_master.json"
content = "${data.ignition_config.main.rendered}"
acl = "private"

server_side_encryption = "AES256"
data "ignition_config" "s3" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It think these should be called something 'bootstrap_*' rather then "s3"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that will be the ignition config for all masters not only bootstrap, so may be ignition_masters

append {
source = "http://${var.cluster_name}-ncg.${var.base_domain}/ignition?profile=master"
}

tags = "${merge(map(
"Name", "${var.cluster_name}-ignition-master",
"KubernetesCluster", "${var.cluster_name}",
"tectonicClusterID", "${var.cluster_id}"
), var.extra_tags)}"
files = ["${data.ignition_file.kubeconfig.id}"]
}

data "ignition_config" "s3" {
replace {
source = "${format("s3://%s/%s", var.s3_bucket, aws_s3_bucket_object.ignition_master.key)}"
verification = "sha512-${sha512(data.ignition_config.main.rendered)}"
data "ignition_file" "kubeconfig" {
filesystem = "root"
path = "/etc/kubernetes/kubeconfig"
mode = 0644

content {
content = "${var.kubeconfig_content}"
}
}
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.

46 changes: 4 additions & 42 deletions modules/aws/master-asg/variables.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
variable "assets_s3_location" {
type = "string"
description = "Location on S3 of the Bootkube/Tectonic assets to use (bucket/key)"
}

variable "autoscaling_group_extra_tags" {
description = "Extra AWS tags to be applied to created autoscaling group resources."
type = "list"
Expand Down Expand Up @@ -45,10 +40,6 @@ variable "extra_tags" {
default = {}
}

variable "ign_s3_puller_id" {
type = "string"
}

variable "ec2_ami" {
type = "string"
default = ""
Expand Down Expand Up @@ -109,41 +100,12 @@ variable "subnet_ids" {
type = "list"
}

variable "ign_bootkube_service_id" {
type = "string"
description = "The ID of the bootkube systemd service unit"
}

variable "ign_bootkube_path_unit_id" {
type = "string"
}

variable "ign_tectonic_service_id" {
type = "string"
description = "The ID of the tectonic installer systemd service unit"
}

variable "ign_tectonic_path_unit_id" {
type = "string"
}

variable "ign_init_assets_service_id" {
type = "string"
}

variable "ign_rm_assets_service_id" {
type = "string"
}

variable "ign_rm_assets_path_unit_id" {
type = "string"
}

variable "s3_bucket" {
type = "string"
variable "dns_server_ip" {
type = "string"
default = ""
}

variable "dns_server_ip" {
variable "kubeconfig_content" {
type = "string"
default = ""
}
Loading