From 407808be1d9aad6054bab89b754963addcc47489 Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Wed, 5 Apr 2023 19:25:53 +0200 Subject: [PATCH 1/7] Update main.tf --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index c3b1796..4ca900e 100644 --- a/main.tf +++ b/main.tf @@ -14,7 +14,7 @@ module "bastion" { project_id = var.project_id facility = var.facility - plan = var.plan_controlplane + plan = var.plan_bastion operating_system = var.bastion_operating_system ssh_private_key_path = module.sshkey.ssh_private_key_file cluster_name = var.cluster_name From a2db2b8b013e73681be451e40e2ae6e5b70fd816 Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Wed, 5 Apr 2023 19:26:34 +0200 Subject: [PATCH 2/7] Update main.tf --- modules/bastion/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bastion/main.tf b/modules/bastion/main.tf index 38b4433..5e1e0dd 100644 --- a/modules/bastion/main.tf +++ b/modules/bastion/main.tf @@ -30,7 +30,7 @@ data "template_file" "ignition_append" { locals { arch = "x86_64" - coreos_baseurl = "http://54.172.173.155/pub/openshift-v4/dependencies/rhcos" + coreos_baseurl = "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos" coreos_url = "${local.coreos_baseurl}/${var.ocp_version}/${var.ocp_version}.${var.ocp_version_zstream}" coreos_filenm = "rhcos-${var.ocp_version}.${var.ocp_version_zstream}-${local.arch}" coreos_img = "${local.coreos_filenm}-live-rootfs.${local.arch}.img" From 9b86146c26ab439debffcfb664d9ec93b81890a0 Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Wed, 5 Apr 2023 19:27:13 +0200 Subject: [PATCH 3/7] Update main.tf --- modules/bastion/main.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/bastion/main.tf b/modules/bastion/main.tf index 5e1e0dd..4b7f880 100644 --- a/modules/bastion/main.tf +++ b/modules/bastion/main.tf @@ -81,9 +81,9 @@ resource "null_resource" "ocp_install_ignition" { inline = [ - "curl -o /usr/share/nginx/html/${local.coreos_img} ${local.coreos_url}/${local.coreos_img}", - "curl -o /usr/share/nginx/html/${local.coreos_kernel} ${local.coreos_url}/${local.coreos_kernel}", - "curl -o /usr/share/nginx/html/${local.coreos_initrd} ${local.coreos_url}/${local.coreos_initrd}", + "curl -L -o /usr/share/nginx/html/${local.coreos_img} ${local.coreos_url}/${local.coreos_img}", + "curl -L -o /usr/share/nginx/html/${local.coreos_kernel} ${local.coreos_url}/${local.coreos_kernel}", + "curl -L -o /usr/share/nginx/html/${local.coreos_initrd} ${local.coreos_url}/${local.coreos_initrd}", "chmod -R 0755 /usr/share/nginx/html/" ] } From b4d98417c2caca8b9b605b573cff77e5b9f322eb Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Wed, 5 Apr 2023 19:28:44 +0200 Subject: [PATCH 4/7] Update main.tf --- modules/dns/modules/aws/main.tf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/dns/modules/aws/main.tf b/modules/dns/modules/aws/main.tf index caf5f87..3cc429c 100644 --- a/modules/dns/modules/aws/main.tf +++ b/modules/dns/modules/aws/main.tf @@ -8,6 +8,7 @@ data "aws_route53_zone" "basedomain" { resource "aws_route53_record" "dns_a_cluster_api" { zone_id = data.aws_route53_zone.basedomain.id type = "A" + ttl = 300 name = "api.${var.cluster_name}" records = var.node_ips count = (var.node_type == "lb" ? 1 : 0) @@ -16,6 +17,7 @@ resource "aws_route53_record" "dns_a_cluster_api" { resource "aws_route53_record" "dns_a_cluster_api_int" { zone_id = data.aws_route53_zone.basedomain.id type = "A" + ttl = 300 name = "api-int.${var.cluster_name}" records = var.node_ips count = (var.node_type == "lb" ? 1 : 0) @@ -24,6 +26,7 @@ resource "aws_route53_record" "dns_a_cluster_api_int" { resource "aws_route53_record" "dns_a_cluster_wildcard_https" { zone_id = data.aws_route53_zone.basedomain.id type = "A" + ttl = 300 name = "*.apps.${var.cluster_name}" records = var.node_ips count = (var.node_type == "lb" ? 1 : 0) @@ -32,6 +35,7 @@ resource "aws_route53_record" "dns_a_cluster_wildcard_https" { resource "aws_route53_record" "dns_a_node" { zone_id = data.aws_route53_zone.basedomain.id type = "A" + ttl = 300 name = "${var.node_type}-${count.index}.${var.cluster_name}" records = var.node_ips count = length(var.node_ips) @@ -40,9 +44,10 @@ resource "aws_route53_record" "dns_a_node" { resource "aws_route53_record" "dns_a_etcd" { zone_id = data.aws_route53_zone.basedomain.id type = "A" + ttl = 300 name = "etcd-${count.index}.${var.cluster_name}" records = var.node_ips - count = (var.node_type == "master" ? len(var.node_ips) : 0) + count = (var.node_type == "master" ? length(var.node_ips) : 0) } resource "aws_route53_record" "dns_srv_etcd" { @@ -51,6 +56,6 @@ resource "aws_route53_record" "dns_srv_etcd" { name = "_etcd-server-ssl._tcp" records = [for i, addr in var.node_ips : "0 10 2380 ${addr}."] - count = (var.node_type == "master" ? len(var.node_ips) : 0) + count = (var.node_type == "master" ? length(var.node_ips) : 0) } From 7f3e73bea163b4c2a0b6a17d60168fd936474dc6 Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Wed, 5 Apr 2023 19:30:53 +0200 Subject: [PATCH 5/7] Update ipxe.tpl --- modules/bastion/assets/ipxe.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bastion/assets/ipxe.tpl b/modules/bastion/assets/ipxe.tpl index 19cafc3..3321d23 100644 --- a/modules/bastion/assets/ipxe.tpl +++ b/modules/bastion/assets/ipxe.tpl @@ -7,6 +7,6 @@ set coreos-url http://${ bastion_ip }:8080 set coreos-img $${coreos-url}/rhcos-$${release}.$${zstream}-$${arch}-live-rootfs.$${arch}.img set console console=ttyS1,115200n8 -kernel $${coreos-url}/rhcos-$${release}.$${zstream}-$${arch}-live-kernel-$${arch} initrd=main coreos.live.rootfs_url=$${coreos-img} coreos.inst.install_dev=sda coreos.inst.ignition_url=http://${ bastion_ip }:8080/${ node_type }-append.ign $${console} console=tty0 console=ttyS0,115200n8 ip=dhcp +kernel $${coreos-url}/rhcos-$${release}.$${zstream}-$${arch}-live-kernel-$${arch} initrd=main coreos.live.rootfs_url=$${coreos-img} coreos.inst.ignition_url=http://${ bastion_ip }:8080/${ node_type }-append.ign random.trust_cpu=on rd.luks.options=discard console=tty1 console=ttyS1,115200n8 coreos.inst.persistent-kargs="console=tty1 console=ttyS1,115200n8" coreos.inst.install_dev=/dev/sda initrd --name main $${coreos-url}/rhcos-$${release}.$${zstream}-$${arch}-live-initramfs.$${arch}.img boot From cc86c26e57abd74425f4e0a5c557fa3b725444af Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Wed, 5 Apr 2023 19:31:30 +0200 Subject: [PATCH 6/7] Update get-ocp-installer.sh --- modules/prereq/assets/get-ocp-installer.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/prereq/assets/get-ocp-installer.sh b/modules/prereq/assets/get-ocp-installer.sh index ec58e74..f8aafe8 100755 --- a/modules/prereq/assets/get-ocp-installer.sh +++ b/modules/prereq/assets/get-ocp-installer.sh @@ -7,9 +7,9 @@ if [ -f $RDIR/artifacts/openshift-install.tar.gz ] && [ -f $RDIR/artifacts/oc.ta echo 'Openshift Installer Exists' else mkdir $RDIR/artifacts; - curl http://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest-${OCP_VERSION}/openshift-install-linux.tar.gz \ + curl -L http://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest-${OCP_VERSION}/openshift-install-linux.tar.gz \ --output $RDIR/artifacts/openshift-install.tar.gz; - curl http://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz \ + curl -L http://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/linux/oc.tar.gz \ --output $RDIR/artifacts/oc.tar.gz; fi From 0ec8a700398c7c2502a1eb572f64afc540ce7b75 Mon Sep 17 00:00:00 2001 From: Alberto Gonzalez Date: Wed, 5 Apr 2023 19:32:43 +0200 Subject: [PATCH 7/7] Update variables.tf --- variables.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index e7213fb..e9109ae 100644 --- a/variables.tf +++ b/variables.tf @@ -35,6 +35,10 @@ variable "facility" { default = "da11" } +variable "plan_bastion" { + description = "Plan for Bastion" + default = "c3.small.x86" +} variable "plan_controlplane" { description = "Plan for Control Plane Nodes" default = "c3.medium.x86" @@ -66,7 +70,7 @@ variable "cluster_name" { } variable "ocp_version" { - default = "4.9" + default = "4.12" description = "OpenShift minor release version" }