Skip to content

Commit

Permalink
Merge pull request #20 from agonzalezrh/main
Browse files Browse the repository at this point in the history
Some fixes and update OCP version to 4.12
  • Loading branch information
displague authored Apr 27, 2023
2 parents 0279b9f + 0ec8a70 commit 46457ac
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion modules/bastion/assets/ipxe.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions modules/bastion/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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/"
]
}
Expand Down
9 changes: 7 additions & 2 deletions modules/dns/modules/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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" {
Expand All @@ -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)
}

4 changes: 2 additions & 2 deletions modules/prereq/assets/get-ocp-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 5 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -66,7 +70,7 @@ variable "cluster_name" {
}

variable "ocp_version" {
default = "4.9"
default = "4.12"
description = "OpenShift minor release version"
}

Expand Down

0 comments on commit 46457ac

Please sign in to comment.