Skip to content

Commit

Permalink
Revert "To import RHCOS images from cloud object storage"
Browse files Browse the repository at this point in the history
This reverts commit 288440b.
  • Loading branch information
yussufsh committed Jun 9, 2022
1 parent bd1036a commit a683ff4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 95 deletions.
7 changes: 0 additions & 7 deletions docs/var.tfvars-doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ rhcos_image_name = "<rhcos-image-name>"
```
Note that the boot images should have a minimum disk size of 120GB

These set of variables should be provided when RHCOS image should be imported from public bucket of cloud object storage to your PowerVS service instance
```
rhcos_import_image = true # true/false (default=false)
rhcos_import_image_filename = "rhcos-411-85-202203181612-0-ppc64le-powervs.ova.gz" # RHCOS boot image file name available in cloud object storage
rhcos_import_image_storage_type = "tier1" # tier1/tier3 (default=tier1) Storage type in PowerVS where image needs to be uploaded
```

This variable specifies the name of the private network that is configured in your PowerVS service instance.
```
network_name = "ocp-net"
Expand Down
17 changes: 1 addition & 16 deletions modules/4_nodes/nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,11 @@ data "ibm_pi_network" "network" {
pi_cloud_instance_id = var.service_instance_id
}

# RHCOS Image Import
resource "ibm_pi_image" "rhcos_image_import" {
count = var.rhcos_import_image ? 1 : 0

pi_image_name = "${var.name_prefix}rhcos-${var.rhcos_import_image_storage_type}-image"
pi_cloud_instance_id = var.service_instance_id
pi_image_bucket_name = "rhcos-powervs-images-${var.rhcos_import_bucket_region}"
pi_image_bucket_region = var.rhcos_import_bucket_region
pi_image_bucket_file_name = var.rhcos_import_image_filename
pi_image_storage_type = var.rhcos_import_image_storage_type
}

data "ibm_pi_image" "rhcos" {
depends_on = [ibm_pi_image.rhcos_image_import]

pi_image_name = var.rhcos_import_image ? ibm_pi_image.rhcos_image_import[0].pi_image_name : var.rhcos_image_name
pi_image_name = var.rhcos_image_name
pi_cloud_instance_id = var.service_instance_id
}


#bootstrap
data "ignition_config" "bootstrap" {
merge {
Expand Down
5 changes: 0 additions & 5 deletions modules/4_nodes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,3 @@ variable "bastion_external_vip" {}
variable "rhel_username" {}
variable "private_key" {}
variable "ssh_agent" {}

variable "rhcos_import_image" {}
variable "rhcos_import_bucket_region" {}
variable "rhcos_import_image_filename" {}
variable "rhcos_import_image_storage_type" {}
53 changes: 19 additions & 34 deletions ocp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,6 @@ locals {
name_prefix = var.use_zone_info_for_names ? "${local.cluster_id}-${var.ibmcloud_zone}-" : "${local.cluster_id}-"
node_prefix = var.use_zone_info_for_names ? "${var.ibmcloud_zone}-" : ""
storage_type = lookup(var.bastion, "count", 1) > 1 ? "none" : var.storage_type
powervs_vpc_region_map = {
syd = "au-syd",
osa = "jp-osa",
tok = "jp-tok",
eu-de = "eu-de",
lon = "eu-gb",
tor = "ca-tor",
dal = "us-south",
sao = "br-sao",
us-east = "us-east"
}
}

data "ibm_is_subnet" "vpc_subnet" {
Expand Down Expand Up @@ -81,29 +70,25 @@ module "prepare" {
module "nodes" {
source = "./modules/4_nodes"

service_instance_id = var.service_instance_id
rhcos_image_name = var.rhcos_image_name
processor_type = var.processor_type
system_type = var.system_type
network_name = var.network_name
bastion_ip = lookup(var.bastion, "count", 1) > 1 ? module.prepare.bastion_vip : module.prepare.bastion_ip[0]
cluster_domain = var.cluster_domain
cluster_id = local.cluster_id
name_prefix = local.name_prefix
node_prefix = local.node_prefix
bootstrap = var.bootstrap
master = var.master
worker = var.worker
volume_shareable = var.volume_shareable
bastion_external_vip = module.prepare.bastion_external_vip
bastion_public_ip = module.prepare.bastion_public_ip
rhel_username = var.rhel_username
private_key = local.private_key
ssh_agent = var.ssh_agent
rhcos_import_image = var.rhcos_import_image
rhcos_import_bucket_region = lookup(local.powervs_vpc_region_map, var.ibmcloud_region, "au_syd")
rhcos_import_image_filename = var.rhcos_import_image_filename
rhcos_import_image_storage_type = var.rhcos_import_image_storage_type
service_instance_id = var.service_instance_id
rhcos_image_name = var.rhcos_image_name
processor_type = var.processor_type
system_type = var.system_type
network_name = var.network_name
bastion_ip = lookup(var.bastion, "count", 1) > 1 ? module.prepare.bastion_vip : module.prepare.bastion_ip[0]
cluster_domain = var.cluster_domain
cluster_id = local.cluster_id
name_prefix = local.name_prefix
node_prefix = local.node_prefix
bootstrap = var.bootstrap
master = var.master
worker = var.worker
volume_shareable = var.volume_shareable
bastion_external_vip = module.prepare.bastion_external_vip
bastion_public_ip = module.prepare.bastion_public_ip
rhel_username = var.rhel_username
private_key = local.private_key
ssh_agent = var.ssh_agent
}

module "install" {
Expand Down
13 changes: 3 additions & 10 deletions var.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,9 @@ worker = { memory = "32", processors = "0.5", "count" = 2 }

rhel_image_name = "rhel-8.3"
rhcos_image_name = "rhcos-4.9"

### Provide these parameters if RHCOS image needs to be imported from public bucket of cloud object storage to PVS.
### When this is provided, data provided through parameter "rhcos_image_name" will be ignored.
rhcos_import_image = false # true/false (default=false).
rhcos_import_image_filename = "rhcos-410-84-202201251004-0-ppc64le-powervs.ova.gz"
rhcos_import_image_storage_type = "tier1" # tier1/tier3 (default=tier1) Storage type in PowerVS

processor_type = "shared"
system_type = "s922"
network_name = "ocp-net"
processor_type = "shared"
system_type = "s922"
network_name = "ocp-net"

rhel_username = "root" #Set it to an appropriate username for non-root user access
connection_timeout = 30 # minutes
Expand Down
23 changes: 0 additions & 23 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -602,26 +602,3 @@ variable "csi_driver_version" {
description = "Set to csi-driver version."
default = "v0.1.1"
}

################################################################
# Image upload variables (used only for uploading RHCOS image
# from cloud object storage to PowerVS catalog)
################################################################
variable "rhcos_import_image" {
type = bool
description = "Set to true to upload RHCOS image to PowerVS from Cloud Object Storage."
default = false
}

variable "rhcos_import_image_filename" {
type = string
description = "Name of the RHCOS image object file. This file is expected to be in .owa.gz format"
default = "rhcos-411-85-202203181612-0-ppc64le-powervs.ova.gz"
}

variable "rhcos_import_image_storage_type" {
type = string
description = "Storage type in PowerVS where the RHCOS image needs to be uploaded"
default = "tier1"
}

0 comments on commit a683ff4

Please sign in to comment.