ocp-power-automation / ocp4-upi-powervs

OpenShift on Power Virtual Server
Apache License 2.0
23 stars 46 forks source link

OPENSHIFTP-174: generate a stable graph for the load balancer members #531

Closed prb112 closed 3 months ago

prb112 commented 4 months ago

Load Balancer Members graph is unstable. You can see the IPs change for all the members when the bootstrap count is moved to zero. There is a bug in the load_balancer.tf that makes it unstable. This is the fix.

  # module.ibmcloud[0].ibm_is_lb_pool_member.api_member_external[0] will be updated in-place
~ target_address      = "192.168.200.185" -> "192.168.200.84"

  # module.ibmcloud[0].ibm_is_lb_pool_member.api_member_external[1] will be updated in-place
~ target_address      = "192.168.200.84" -> "192.168.200.236"

  # module.ibmcloud[0].ibm_is_lb_pool_member.api_member_external[2] will be updated in-place
~ target_address      = "192.168.200.236" -> "192.168.200.175"

  # module.ibmcloud[0].ibm_is_lb_pool_member.api_member_external[3] will be destroyed
- target_address      = "192.168.200.175" -> null
yussufsh commented 4 months ago

@prb112 The changes make sense but did you try moving bootstrap IP to the end of the list to see if Terraform does not shuffle and remove the last resource only? From:

api_servers = var.bootstrap_count == 0 ? var.master_ips : concat([var.bootstrap_ip], var.master_ips)

To:

api_servers = var.bootstrap_count == 0 ? var.master_ips : concat(var.master_ips,[var.bootstrap_ip])

This is a simple fix to keep the code as reusable as it is now. Please test it out for me. Thanks.

prb112 commented 4 months ago

Hi Yussuf,

I considered the api_servers = var.bootstrap_count == 0 ? var.master_ips : concat(var.master_ips,[var.bootstrap_ip])

The reason I eventually chose the approach is this situation:

  1. Install - 3 Masters + 1 Bootstrap = Count of 4
  2. Change Bootstrap count to Zero
  3. Change Master Count to 4

The count will not be stable.

Thoughts?

Thanks, Paul

prb112 commented 3 months ago

Hey Yussuf, Thoughts on the above? thanks, Paul

yussufsh commented 3 months ago

Did you try my suggestion and see if there is a drift?

prb112 commented 3 months ago

Did you try my suggestion and see if there is a drift?

Hey Yussuf, since Bootstrap is expected to be removed from the LB immediately post install. This shouldn't be a problem. I've reverted to my original fix.

Thanks, Paul

ppc64le-cloud-bot commented 3 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: prb112, yussufsh

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: - ~~[OWNERS](https://github.com/ocp-power-automation/ocp4-upi-powervs/blob/main/OWNERS)~~ [yussufsh] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment