Skip to content

Commit

Permalink
Ignition assets (openshift#2940)
Browse files Browse the repository at this point in the history
* platform/aws: add ncg ignition for workers

* platform/aws: add ncg ignition for masters

* platform/aws: add ignition for bootstrap master

* platform/aws: remove leader election code

* platform/aws: add ignition for etcd

* platform/aws: add support for the NCG

* terraform fmt
  • Loading branch information
enxebre authored and mxinden committed Feb 27, 2018
1 parent e5c8b41 commit cd71f30
Show file tree
Hide file tree
Showing 34 changed files with 683 additions and 537 deletions.
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" {
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

0 comments on commit cd71f30

Please sign in to comment.