Skip to content

Comments

CORS-2613: AWS: Cross-account Shared VPC Support #7161

Closed
patrickdillon wants to merge 18 commits intoopenshift:masterfrom
patrickdillon:aws-phz-role-ic
Closed

CORS-2613: AWS: Cross-account Shared VPC Support #7161
patrickdillon wants to merge 18 commits intoopenshift:masterfrom
patrickdillon:aws-phz-role-ic

Conversation

@patrickdillon
Copy link
Contributor

@patrickdillon patrickdillon commented May 3, 2023

Adds the ability for the installer to perform operations on a pre-existing private hosted zone which belongs to another account by allowing the ARN for a role to be passed in the install config. When the role is provided, the installer will assume that role when performing operations on the hosted zone.

Enhancement: openshift/enhancements#1397

  • tag private hosted zone in another account
  • create records in private hosted zone in another account
  • destroy records and tags in/on phz in another account
  • regression testing
  • API updates
  • gate on TechPreviewNoUpgrade

Permissions checks will be moved to a separate PR.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label May 3, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 3, 2023

@patrickdillon: This pull request references CORS-2613 which is a valid jira issue.

Details

In response to this:

Adds the ability for the installer to perform operations on a pre-existing private hosted zone which belongs to another account by allowing the ARN for a role to be passed in the install config. When the role is provided, the installer will assume that role when performing operations on the hosted zone.

/wip

  • tag private hosted zone in another account
  • create records in private hosted zone in another account
  • destroy records and tags in/on phz in another account (WIP but currently broken)
  • permissions checking
  • regression testing

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.

@openshift-ci openshift-ci bot requested review from barbacbd and mtulio May 3, 2023 21:13
@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 3, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from patrickdillon. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details 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-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 4, 2023
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 4, 2023

@patrickdillon: This pull request references CORS-2613 which is a valid jira issue.

Details

In response to this:

Adds the ability for the installer to perform operations on a pre-existing private hosted zone which belongs to another account by allowing the ARN for a role to be passed in the install config. When the role is provided, the installer will assume that role when performing operations on the hosted zone.

/wip

  • tag private hosted zone in another account
  • create records in private hosted zone in another account
  • destroy records and tags in/on phz in another account (WIP but currently broken)
  • permissions checking
  • regression testing
  • API updates

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.

@patrickdillon
Copy link
Contributor Author

I have some serious doubts about the destroy code in 06c8282cc1159ae0e5fdf8eaae4fb9a22ee2611f, so I might need to pull those into a separate PR.

I believe we use the private hosted zone to determine the public records to destroy. That logic probably is not supportable when the zones are cross-account.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 16, 2023

@patrickdillon: This pull request references CORS-2613 which is a valid jira issue.

Details

In response to this:

Adds the ability for the installer to perform operations on a pre-existing private hosted zone which belongs to another account by allowing the ARN for a role to be passed in the install config. When the role is provided, the installer will assume that role when performing operations on the hosted zone.

Enhancement: openshift/enhancements#1397

/wip

  • tag private hosted zone in another account
  • create records in private hosted zone in another account
  • destroy records and tags in/on phz in another account (WIP but currently broken)
  • permissions checking
  • regression testing
  • API updates

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.

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 16, 2023
@barbacbd
Copy link
Contributor

@patrickdillon looks like go-genmock needs to be run and some of the installconfig/aws/ tests need to be adjusted:

  • TestGetSubDomainDNSRecords()
  • TestValidateForProvisioning()

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented May 31, 2023

@patrickdillon: This pull request references CORS-2613 which is a valid jira issue.

Details

In response to this:

Adds the ability for the installer to perform operations on a pre-existing private hosted zone which belongs to another account by allowing the ARN for a role to be passed in the install config. When the role is provided, the installer will assume that role when performing operations on the hosted zone.

Enhancement: openshift/enhancements#1397

/wip

  • tag private hosted zone in another account
  • create records in private hosted zone in another account
  • destroy records and tags in/on phz in another account (WIP but currently broken)
  • permissions checking
  • regression testing
  • API updates

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.

@patrickdillon patrickdillon force-pushed the aws-phz-role-ic branch 2 times, most recently from 1d834c0 to 1fdcec8 Compare June 1, 2023 13:59
@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jun 1, 2023

@patrickdillon: This pull request references CORS-2613 which is a valid jira issue.

Details

In response to this:

Adds the ability for the installer to perform operations on a pre-existing private hosted zone which belongs to another account by allowing the ARN for a role to be passed in the install config. When the role is provided, the installer will assume that role when performing operations on the hosted zone.

Enhancement: openshift/enhancements#1397

/wip

  • tag private hosted zone in another account
  • create records in private hosted zone in another account
  • destroy records and tags in/on phz in another account
  • regression testing
  • API updates
  • gate on TechPreviewNoUpgrade

Permissions checks will be moved to a separate PR.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jun 1, 2023

@patrickdillon: This pull request references CORS-2613 which is a valid jira issue.

Details

In response to this:

Adds the ability for the installer to perform operations on a pre-existing private hosted zone which belongs to another account by allowing the ARN for a role to be passed in the install config. When the role is provided, the installer will assume that role when performing operations on the hosted zone.

Enhancement: openshift/enhancements#1397

  • tag private hosted zone in another account
  • create records in private hosted zone in another account
  • destroy records and tags in/on phz in another account
  • regression testing
  • API updates
  • gate on TechPreviewNoUpgrade

Permissions checks will be moved to a separate PR.

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.

@openshift-ci-robot
Copy link
Contributor

openshift-ci-robot commented Jun 1, 2023

@patrickdillon: This pull request references CORS-2613 which is a valid jira issue.

Details

In response to this:

Adds the ability for the installer to perform operations on a pre-existing private hosted zone which belongs to another account by allowing the ARN for a role to be passed in the install config. When the role is provided, the installer will assume that role when performing operations on the hosted zone.

Enhancement: openshift/enhancements#1397

  • tag private hosted zone in another account
  • create records in private hosted zone in another account
  • destroy records and tags in/on phz in another account
  • regression testing
  • API updates
  • gate on TechPreviewNoUpgrade

Permissions checks will be moved to a separate PR.

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.

Adds a hosted zone role field. If provided,
this role will be assumed whenever operations
are performed on the provided hosted zone. This
enables the private hosted zone to belong to a different
account than the rest of the cluster.
If a hosted zone role is specified in the install config, users
must also supply a hosted zone.
The hostedZoneRole will need to be used when destroying the cluster.
Updates the route53 clients to allow passing config with
assume role credentials. This allows the function caller
to determine whether the service should authenticate with
the default credentials or creds for another account.
Add the ability to assume a role in a different account
when destroying records in a private hosted zone. When the
hostedZoneRole is passed in the metadata, that role will be used
when running destroy.
Plumb the hosted zone role through to terraform, so that it can
be used to create records when the hosted zone belongs to another
account.
Adds the ability in terraform to assume a role when performing operations
on a private hosted zone which belongs to a different account than
the rest of the cluster.
Display to users any errors when retrieving a hosted zone
specified in the install config.
The most recent k8s api bump requires a context is passed to
the wait.ExponentialBackoffWithContext function.
When a hostedZoneRole is specified for an AWS
shared VPC install, write it to the DNS config
so it can be used by the cluster ingress operator.
metal3-io/baremetal-operator@6c1abd0
moved the hardware profile package to the api. This commit points to
the new package locations.
Update tests and mocks due to changes for adding cross-account
private hosted-zone support.
$ go mod edit \
-replace=github.com/metal3-io/baremetal-operator=github.com/openshift/baremetal-operator@master \
-replace=github.com/metal3-io/baremetal-operator/apis=github.com/openshift/baremetal-operator/apis@master \
-replace=github.com/metal3-io/baremetal-operator/pkg/hardwareutils=github.com/openshift/baremetal-operator/pkg/hardwareutils@master

$ go mod edit -require=github.com/openshift/api@master

$ go mod edit -replace=sigs.k8s.io/controller-runtime=sigs.k8s.io/controller-runtime@v0.15.0

$ go mod edit -replace k8s.io/client-go=k8s.io/client-go@v0.27.2

(with $ go mod tidy run between each command)
Bumps core Installer to Go v1.20. Terraform and providers will be
updated separately.
$ go mod vendor
Update generated CRD for explain after API vendoring.
Fixes deprecation issue:
pkg/destroy/vsphere/vsphere.go:243:9: SA1019: wait.PollImmediateInfiniteWithContext
is deprecated: This method does not return errors from context, use PollWithContextCancel.
Note that the new method will no longer return ErrWaitTimeout
and instead return errors defined by the context package.
Will be removed in a future release. (staticcheck)
Specifying installconfig.platform.aws.hostedZoneRole and using
a cross-account hosted zone in a shared vpc requires a
TechPreviewNoUpgrade feature gate.
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 1, 2023

@patrickdillon: The following tests 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/okd-e2e-aws-ovn-upgrade 4666d72 link false /test okd-e2e-aws-ovn-upgrade
ci/prow/e2e-vsphere-ovn 4666d72 link true /test e2e-vsphere-ovn
ci/prow/e2e-libvirt 4666d72 link false /test e2e-libvirt
ci/prow/e2e-aws-ovn-upi 4666d72 link true /test e2e-aws-ovn-upi
ci/prow/e2e-azure-ovn-upi 4666d72 link true /test e2e-azure-ovn-upi
ci/prow/e2e-vsphere-upi-zones 4666d72 link false /test e2e-vsphere-upi-zones
ci/prow/e2e-vsphere-upi 4666d72 link true /test e2e-vsphere-upi
ci/prow/okd-scos-e2e-aws-ovn 4666d72 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

Details

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.

Copy link
Contributor

@mtulio mtulio left a comment

Choose a reason for hiding this comment

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

@patrickdillon aws changes look good to me. 💯
I am adding some suggestions to improve the UX, feel free to skip it.
I will take a look again tomorrow at the whole change.

create the hosted zone on your behalf.
type: string
hostedZoneRole:
description: HostedZoneRole is the ARN of a role to be assumed
Copy link
Contributor

Choose a reason for hiding this comment

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

I would be specific of the name of the AWS service

Suggested change
description: HostedZoneRole is the ARN of a role to be assumed
description: HostedZoneRole is the ARN of an IAM role to be assumed

HostedZone is the ID of an existing hosted zone into which to add DNS records for the cluster's internal API. An existing hosted zone can only be used when also using existing subnets. The hosted zone must be associated with the VPC containing the subnets. Leave the hosted zone unset to have the installer create the hosted zone on your behalf.

hostedZoneRole <string>
HostedZoneRole is the ARN of a role to be assumed when performing operations on the provided HostedZone. HostedZoneRole can be used in a shared VPC scenario when the private hosted zone belongs to a different account than the rest of the cluster resources. If HostedZoneRole is set, HostedZone must also be set.
Copy link
Contributor

Choose a reason for hiding this comment

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

If tou accept the suggestion above, need to change here too:

Suggested change
HostedZoneRole is the ARN of a role to be assumed when performing operations on the provided HostedZone. HostedZoneRole can be used in a shared VPC scenario when the private hosted zone belongs to a different account than the rest of the cluster resources. If HostedZoneRole is set, HostedZone must also be set.
HostedZoneRole is the ARN of an IAM role to be assumed when performing operations on the provided HostedZone. HostedZoneRole can be used in a shared VPC scenario when the private hosted zone belongs to a different account than the rest of the cluster resources. If HostedZoneRole is set, HostedZone must also be set.

@patrickdillon
Copy link
Contributor Author

@r4f4 @barbacbd @mtulio #7225 is the new, aws-only version of this PR after #7220 merged

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2023
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Details

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.

@patrickdillon
Copy link
Contributor Author

/close
In favor of #7225

@openshift-ci openshift-ci bot closed this Jun 3, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 3, 2023

@patrickdillon: Closed this PR.

Details

In response to this:

/close
In favor of #7225

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants