-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CORS-2280: IBMCloud: Add TF support for private DNS #6282
CORS-2280: IBMCloud: Add TF support for private DNS #6282
Conversation
Skipping CI for Draft Pull Request. |
Add support for creating, configuring, and destroying Terraform resources for private (Internal) IPI clusters on IBM Cloud, using DNS Services, rather than CIS (public/External). Partial: https://issues.redhat.com/browse/CORS-2255
0570110
to
9d7a9bc
Compare
|
/retitle CORS-2280: IBMCloud: Add TF support for private DNS |
/retest |
/lgtm |
/assign @patrickdillon |
@@ -67,7 +67,7 @@ resource "ibm_is_security_group" "bootstrap" { | |||
resource "ibm_is_security_group_rule" "bootstrap_ssh_inbound" { | |||
group = ibm_is_security_group.bootstrap.id | |||
direction = "inbound" | |||
remote = local.public_endpoints ? "0.0.0.0/0" : var.control_plane_security_group_id_list.0.id | |||
remote = local.public_endpoints ? "0.0.0.0/0" : var.control_plane_security_group_id_list[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any other instance of this variable changed. Is this missing id
or did the type change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually a bug fix, for a bug that was never noticed until we started testing Internal
, which hasn't been supported until this and the previous CORS-2280 PR for Golang changes.
For instance, using this PR with a revert of the line above, Terraform fails since the control_plane_security_group_id_list
is a list of Id's (strings) already, not SecurityGroup data sources.
# go/src/github.com/openshift/installer/bin/openshift-install version
go/src/github.com/openshift/installer/bin/openshift-install unreleased-master-6395-g75c6ab06c034cfc841b672b936a6a750930606d7
built from commit 75c6ab06c034cfc841b672b936a6a750930606d7
release image registry.ci.openshift.org/origin/release:4.12
release architecture amd64
# git -C go/src/github.com/openshift/installer/ diff cjschaef/ibmcloud_private_terraform..75c6ab06c034cfc841b672b936a6a750930606d7
diff --git a/data/data/ibmcloud/bootstrap/main.tf b/data/data/ibmcloud/bootstrap/main.tf
index 4471b3325..2f0aaea6a 100644
--- a/data/data/ibmcloud/bootstrap/main.tf
+++ b/data/data/ibmcloud/bootstrap/main.tf
@@ -67,7 +67,7 @@ resource "ibm_is_security_group" "bootstrap" {
resource "ibm_is_security_group_rule" "bootstrap_ssh_inbound" {
group = ibm_is_security_group.bootstrap.id
direction = "inbound"
- remote = local.public_endpoints ? "0.0.0.0/0" : var.control_plane_security_group_id_list[0]
+ remote = local.public_endpoints ? "0.0.0.0/0" : var.control_plane_security_group_id_list.0.id
tcp {
port_min = 22
port_max = 22
# go/src/github.com/openshift/installer/bin/openshift-install create cluster --dir clusters/private-sg-id-list-1/
WARNING Found override for release image. Please be warned, this is not advised
INFO Consuming Worker Machines from target directory
INFO Consuming OpenShift Install (Manifests) from target directory
INFO Consuming Master Machines from target directory
INFO Consuming Common Manifests from target directory
INFO Consuming Openshift Manifests from target directory
INFO Obtaining RHCOS image file from 'https://rhcos.mirror.openshift.com/art/storage/releases/rhcos-4.12/412.86.202208101039-0/x86_64/rhcos-412.86.202208101039-0-ibmcloud.x86_64.qcow2.gz?sha256=09b599849b945bdd405b18765225160f50e07ca205fe9787f70f188c8a96f293'
INFO The file was found in cache: /root/.cache/openshift-installer/image_cache/rhcos-412.86.202208101039-0-ibmcloud.x86_64.qcow2. Reusing...
INFO Creating infrastructure resources...
ERROR
ERROR Error: Unsupported attribute
ERROR
ERROR on main.tf line 70, in resource "ibm_is_security_group_rule" "bootstrap_ssh_inbound":
ERROR 70: remote = local.public_endpoints ? "0.0.0.0/0" : var.control_plane_security_group_id_list.0.id
ERROR ├────────────────
ERROR │ var.control_plane_security_group_id_list[0] is "r018-a45f4ff4-b452-44a7-bc12-72bc0e424644"
ERROR
ERROR Can't access attributes on a primitive-typed value (string).
ERROR failed to fetch Cluster: failed to generate asset "Cluster": failure applying terraform for "bootstrap" stage: failed to create cluster: failed to apply Terraform: exit status 1
ERROR
ERROR Error: Unsupported attribute
ERROR
ERROR on main.tf line 70, in resource "ibm_is_security_group_rule" "bootstrap_ssh_inbound":
ERROR 70: remote = local.public_endpoints ? "0.0.0.0/0" : var.control_plane_security_group_id_list.0.id
ERROR ├────────────────
ERROR │ var.control_plane_security_group_id_list[0] is "r018-a45f4ff4-b452-44a7-bc12-72bc0e424644"
ERROR
ERROR Can't access attributes on a primitive-typed value (string).
vpc_crn = module.vpc.vpc_crn | ||
base_domain = var.base_domain | ||
cluster_domain = var.cluster_domain | ||
is_external = local.public_endpoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider making is_external
more descriptive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I'll see about following up this PR with some more descriptive
@@ -54,11 +54,29 @@ module "cis" { | |||
cis_id = var.ibmcloud_cis_crn | |||
base_domain = var.base_domain | |||
cluster_domain = var.cluster_domain | |||
is_external = local.public_endpoints |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider passing this in as a boolean to the ibm-variables where the logic is moved to tfvars in the installer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The boolean is based on PublishStrategy currently, and just passed around after that.
If it makes sense to add boolean version of the PublishStrategy (basically) to tfvars that gets used in place of that Internel
/External
string, I can do that in a follow up PR.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: patrickdillon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
@cjschaef: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Add support for creating, configuring, and destroying Terraform
resources for private (Internal) IPI clusters on IBM Cloud, using
DNS Services, rather than CIS (public/External).
Partial: https://issues.redhat.com/browse/CORS-2255