Skip to content
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

OCPBUGS-33311: aws: fix NLB creation in secret regions #8636

Merged

Conversation

r4f4
Copy link
Contributor

@r4f4 r4f4 commented Jun 20, 2024

This PR bumps CAPA to incorporate a fix for creating NLBs in secret regions [1], which do not support security groups.

It also uses the opportunity to do some refactoring in the part of the code that creates route53 records.

[1] kubernetes-sigs/cluster-api-provider-aws#5030

@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jun 20, 2024
@openshift-ci-robot
Copy link
Contributor

@r4f4: This pull request references Jira Issue OCPBUGS-33311, which is invalid:

  • expected the bug to target the "4.17.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This PR bumps CAPA to incorporate a fix for creating NLBs in secret regions [1], which do not support security groups.

It also uses the opportunity to do some refactoring in the part of the code that creates route53 records.

[1] kubernetes-sigs/cluster-api-provider-aws#5030

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 openshift-eng/jira-lifecycle-plugin repository.

@r4f4
Copy link
Contributor Author

r4f4 commented Jun 20, 2024

/hold

Until the fix is merged upstream.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 20, 2024
@openshift-ci openshift-ci bot requested review from bfournie and mtulio June 20, 2024 13:29
@r4f4
Copy link
Contributor Author

r4f4 commented Jun 20, 2024

/uncc @bfournie @mtulio
Will cc back in when it's ready for review.

@openshift-ci openshift-ci bot removed request for mtulio and bfournie June 20, 2024 13:32
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 23, 2024
@r4f4 r4f4 force-pushed the aws-secret-region-nlb-sgs branch from 3e22210 to 3e3f56a Compare July 31, 2024 19:35
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 31, 2024
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 23, 2024
This is leftover from before CAPA had support for a public LB as the
secondary controlPlane load balancer. We had to configure the AWSCluster
in such a way the primary load balancer would either be `InternetFacing`
if publish was set to "External" or `Internal` otherwise.

Now the primary LB is always `Internal` and the secondary LB only exists
when publish is "External".
@r4f4 r4f4 force-pushed the aws-secret-region-nlb-sgs branch from 3e3f56a to 331a4f0 Compare September 18, 2024 10:39
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 18, 2024
@r4f4
Copy link
Contributor Author

r4f4 commented Sep 18, 2024

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 18, 2024
@r4f4
Copy link
Contributor Author

r4f4 commented Sep 18, 2024

The CAPA bump including the fix was done as part of #8676

@r4f4
Copy link
Contributor Author

r4f4 commented Sep 18, 2024

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 18, 2024
@openshift-ci-robot
Copy link
Contributor

@r4f4: This pull request references Jira Issue OCPBUGS-33311, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.18.0) matches configured target version for branch (4.18.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (yunjiang@redhat.com), skipping review request.

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@r4f4
Copy link
Contributor Author

r4f4 commented Sep 18, 2024

/cc @patrickdillon

Copy link
Contributor

openshift-ci bot commented Sep 18, 2024

@r4f4: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/integration-tests 3e222105e6cbdf7e82942397b9f81ade452dcb1b link true /test integration-tests

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-sigs/prow repository. I understand the commands that are listed here.

@r4f4
Copy link
Contributor Author

r4f4 commented Sep 24, 2024

/cc @barbacbd

@openshift-ci openshift-ci bot requested a review from barbacbd September 24, 2024 15:03
pkg/asset/installconfig/aws/route53.go Show resolved Hide resolved
@@ -146,9 +146,6 @@ func (*Provider) InfraReady(ctx context.Context, in clusterapi.InfraReadyInput)
return fmt.Errorf("failed to find HostedZone ID for NLB: %w", err)
}
apiHost := awsCluster.Status.Network.SecondaryAPIServerELB.DNSName
if awsCluster.Status.Network.APIServerELB.Scheme == capa.ELBSchemeInternetFacing {
apiHost = awsCluster.Status.Network.APIServerELB.DNSName
}
apiIntHost := awsCluster.Spec.ControlPlaneEndpoint.Host
err = client.CreateOrUpdateRecord(ctx, in.InstallConfig.Config, apiHost, apiIntHost, phzID, aliasZoneID)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like its going to attempt to make a record for a public zone even when the install is internal. Is this true or did I miss something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was handled by the CreateOrUpdateRecord function but I factored it in later commits in this PR.

r4f4 added 3 commits October 2, 2024 00:59
This function was doing way more than its name says: it was creating
records in both private and public zones. The argument names were also
not very descriptive and very hard to decipher at a glance.

This change moves the logic out of the function and into the aws
`InfraReady` hook. This not only makes the logic more readable, but it
also paves the way for the use of Classic Load Balancer types.
Tagging the resource as "owned" should be part of the creation.
This should remove any ambiguity/misunderstanding when the field names
are not clear enough.
@r4f4 r4f4 force-pushed the aws-secret-region-nlb-sgs branch from d5dbdb9 to 20cd86a Compare October 1, 2024 23:00
@r4f4
Copy link
Contributor Author

r4f4 commented Oct 1, 2024

Update: consolidated createRecord and CreateOrUpdateRecord into one function.

@patrickdillon
Copy link
Contributor

/lgtm

One of the commit messages says:

it also paves the way for the use of Classic Load Balancer types.

Not sure if there is motivation to ever use Classic LBs?

But code changes are a marked improvement. Thanks!

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 3, 2024
@r4f4
Copy link
Contributor Author

r4f4 commented Oct 3, 2024

/lgtm

One of the commit messages says:

it also paves the way for the use of Classic Load Balancer types.

Not sure if there is motivation to ever use Classic LBs?

It was the motivation at the beginning but then we realized it was better to have CAPA support NLBs without security groups then to try to use classic LBs for secret regions.

Copy link
Contributor

@barbacbd barbacbd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

Copy link
Contributor

openshift-ci bot commented Oct 3, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: barbacbd

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 3, 2024
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD cc5c347 and 2 for PR HEAD 20cd86a in total

3 similar comments
@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD cc5c347 and 2 for PR HEAD 20cd86a in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD cc5c347 and 2 for PR HEAD 20cd86a in total

@openshift-ci-robot
Copy link
Contributor

/retest-required

Remaining retests: 0 against base HEAD cc5c347 and 2 for PR HEAD 20cd86a in total

@openshift-merge-bot openshift-merge-bot bot merged commit 04c1340 into openshift:master Oct 4, 2024
29 checks passed
@openshift-ci-robot
Copy link
Contributor

@r4f4: Jira Issue OCPBUGS-33311: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-33311 has been moved to the MODIFIED state.

In response to this:

This PR bumps CAPA to incorporate a fix for creating NLBs in secret regions [1], which do not support security groups.

It also uses the opportunity to do some refactoring in the part of the code that creates route53 records.

[1] kubernetes-sigs/cluster-api-provider-aws#5030

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 openshift-eng/jira-lifecycle-plugin repository.

@r4f4
Copy link
Contributor Author

r4f4 commented Oct 4, 2024

/cherry-pick release-4.17

@openshift-cherrypick-robot

@r4f4: new pull request created: #9071

In response to this:

/cherry-pick release-4.17

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-sigs/prow repository.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-altinfra
This PR has been included in build ose-installer-altinfra-container-v4.18.0-202410041009.p0.g04c1340.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-terraform-providers
This PR has been included in build ose-installer-terraform-providers-container-v4.18.0-202410041009.p0.g04c1340.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-baremetal-installer
This PR has been included in build ose-baremetal-installer-container-v4.18.0-202410041009.p0.g04c1340.assembly.stream.el9.
All builds following this will include this PR.

@openshift-bot
Copy link
Contributor

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-artifacts
This PR has been included in build ose-installer-artifacts-container-v4.18.0-202410041009.p0.g04c1340.assembly.stream.el9.
All builds following this will include this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants