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

Add source of DNS configuration to AWSPlatformStatus #1397

Closed
wants to merge 3 commits into from

Conversation

sadasu
Copy link
Contributor

@sadasu sadasu commented Feb 3, 2023

When and AWS customer wishes to use their own DNS solution instead of Route53, they are expected to create the API and API-Int Load Balancers and use their LB names to configure their custom DNS prior to cluster installation. The customer created API and API-Int LB information is provided via install-config.

AWSPlatformStatus is updated with a special "provider" if the user does not want OpenShift to configure the default cloud DNS solution.

Enhancement Proposal : openshift/enhancements#1400

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Feb 3, 2023

Hello @sadasu! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

For merging purposes, this repository follows the no-Feature-Freeze process which means that in addition to the standard lgtm and approved labels this repository requires either:

bugzilla/valid-bug - applied if your PR references a valid bugzilla bug

OR

qe-approved, docs-approved, and px-approved - these labels can be applied by anyone in the openshift org via the /label <labelname> command.

Who should apply these qe/docs/px labels?

  • For a no-Feature-Freeze team who is merging a feature before code freeze, they need to get those labels applied to their api repo PR by the appropriate teams (i.e. qe, docs, px)
  • For a Feature Freeze (traditional) team who is merging a feature before FF, they can self-apply the labels (via /label commands), they are basically irrelevant for those teams
  • For a Feature Freeze team who is merging a feature after FF, the PR should be rejected barring an exception

@openshift-ci openshift-ci bot requested review from deads2k and sttts February 3, 2023 20:28
@sadasu sadasu changed the title Add DNS config for API, API-Int and Ingress to AWSPlatformStatus WIP: Add DNS config for API, API-Int and Ingress to AWSPlatformStatus Feb 4, 2023
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 4, 2023
@sadasu sadasu force-pushed the custom-dns branch 4 times, most recently from bccf116 to c1fa499 Compare February 10, 2023 14:41
@sadasu sadasu changed the title WIP: Add DNS config for API, API-Int and Ingress to AWSPlatformStatus Add DNS config for API, API-Int and Ingress to AWSPlatformStatus Feb 10, 2023
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 10, 2023
@sadasu sadasu force-pushed the custom-dns branch 4 times, most recently from 5285fc0 to b96d90f Compare February 14, 2023 19:43
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 18, 2023
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 21, 2023

// DNSConfig contains the LB IP and DNS Record type to configure a DNS entry.
type DNSConfig struct {
// recordType is the DNS record type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there a subset that we support here? Would we expect an MX for example? Could this be an enum of the ones we support?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it would be useful to make this an enum type. Updating.

@JoelSpeed
Copy link
Contributor

Heads up, I'm on PTO for the next 2 weeks, so if you need additional reviews in that time, I'd recommend poking in #forum-api-review

@sadasu sadasu changed the title Add DNS config for API, API-Int and Ingress to AWSPlatformStatus Add API and API-Int LB information to AWSPlatformStatus when DNS is also pe-configured Jun 29, 2023
@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 29, 2023
@openshift-ci openshift-ci bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 29, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 29, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

The full list of commands accepted by this bot can be found 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

@sadasu sadasu changed the title Add API and API-Int LB information to AWSPlatformStatus when DNS is also pe-configured Add API and API-Int LB information to AWSPlatformStatus when DNS pre-configured Jun 29, 2023
Copy link
Contributor

@patrickdillon patrickdillon left a comment

Choose a reason for hiding this comment

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

Left some more comments for discussion. There are still quite a few references to load balancers in the code comments.

// +default={"provider": "ClusterProvided"}
// +kubebuilder:default={"provider": "ClusterProvided"}
// +openshift:enable:FeatureSets=TechPreviewNoUpgrade
DNSConfig *DNSConfigurationType `json:"dnsConfig"`
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be optional, right? Upgraded clusters won't have this value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Kubebuilder will automatically add the default value of provider="ClusterProvided". There is a integration test to that effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But, updating anyways.

Copy link
Contributor

Choose a reason for hiding this comment

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

Kubebuilder will automatically add the default value of provider="ClusterProvided". There is a integration test to that effect.

Interesting. I didn't know you could do that! That's cool.

I'm having a hard time wrapping my head around the idea of something being both required and having a default value; to me they seem mutually exclusive, or at least to mutually diminish one another. Just a personal observation/opinion.

Joel helpfullly brought up UPI installs--we don't technically know that all existing clusters are using IPI-style cloud DNS. Users could opt for UPI in order to establish their own non-route53 DNS solutions. I don't know how many that would be, but I'm pretty confident it's non-zero. So if we default this value, I think the values would likely be incorrect in some cases.

Copy link
Contributor Author

@sadasu sadasu Jul 19, 2023

Choose a reason for hiding this comment

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

With the current implementation, if DNSConfig.Provider is left unset by the user, it will be given the default of "CloudProvided". "CloudProvided" represents how the cluster behaves today (without the custom DNS feature.) Afaik, this should work for UPI too. Are there some functionality/semantics issues that I am missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I replaced "CloudProvided" with "Default" to indicate that that the right defaults for UPI or IPI are in use.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced "Default" with "".

Comment on lines 534 to 538
// DNSUserProvided indicates that the user provides the LB and DNS for API and API-Int.
DNSUserProvided DNSProviderType = "UserProvided"

// DNSClusterProvided indicates that the cluster provides the LB and DNS for API and API-Int.
DNSClusterProvided DNSProviderType = "ClusterProvided"
Copy link
Contributor

Choose a reason for hiding this comment

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

These values seem a little squishy to me. I am having trouble keeping track of all the discussions around this feature, so I'm not sure if these values have been gamed out.

My understanding of the intention here is that when the value is UserProvided that would indicate that we need to run CoreDNS. That to me has some cognitive dissonance.

For the sake of discussion, what about something along the lines of
CloudProvider - this is standard IPI, DNS is in the cloud provider
ClusterProvider - uses on-cluster baremetal dns provider (coredns)
UserProvider - cluster/ipi does not provide DNS, this would be for something like ROSA where they are running dnsmasq in pods

Do these values better capture the current/future use cases we are aware of?

Copy link
Contributor Author

@sadasu sadasu Jul 18, 2023

Choose a reason for hiding this comment

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

Because in a way, the cluster is taking care of DNS for both the CloudProvider and ClusterProvider cases. I have updated the values for Provider as UserProvided and CloudProvided. Comments have been updated accordingly.

I see the cluster's need to run the CoreDNS pod for Ingress as an implementation detail. Agree that there have been several discussions on this topic. The enhancement proposal reflects the current approach we are taking.

// DNSConfigurationType contains information about API and API-Int Load Balancers
// and who is responsible for that configuration.
// +union
type DNSConfigurationType struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

To enable external DNS, I think we are only concerned about using coreDNS to run ingress. Should that be taken into account for the shape of this API? Any concerns there?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this comment was unclear. My concern is that this shape may give the impression that this is the DNS config for everything (API & Ingress) but I believe our current direction is that this will only treat ingress.

Copy link
Contributor Author

@sadasu sadasu Jul 18, 2023

Choose a reason for hiding this comment

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

The comment suggests you are looking at this config as "who provides DNS for Ingress?" Whereas, this API is currently designed to indicate "who provides DNS for the cluster?". I think the 2nd question is the most generic form of the question.

We need DNS for Ingress to be functional during cluster bringup so we have a CoreDNS pod that provides that during cluster bring up. When the cluster is up, we do want the user to update their DNS solution for the *.apps entry too. When all steps are completed, the customer's DNS solution resolves API, API-Int and Ingress.

The enhancement proposal openshift/enhancements#1400 talks about this in greater detail.

@sadasu sadasu changed the title Add API and API-Int LB information to AWSPlatformStatus when DNS pre-configured Add source of DNS configuration to AWSPlatformStatus Jul 18, 2023
@sadasu sadasu force-pushed the custom-dns branch 3 times, most recently from 567239c to d9303e4 Compare July 20, 2023 20:14
@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 20, 2023
@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 20, 2023
@openshift-ci openshift-ci bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 20, 2023
@openshift-ci openshift-ci bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 20, 2023
sadasu added 3 commits July 21, 2023 16:24
When a customer configures their own DNS solution for API and API-Int
in place of the default cloud provided DNS, the state of the DNS
provider is added to the Infrastructure CR's AWSPlatformStatus.
This feature is in TechPreview.
Update the MaxLength within the format package of gomega. This allows
for the test suite to compare strings of size greater than 4000 which
for required for the new tests added for the custom DNS feature.
@sadasu
Copy link
Contributor Author

sadasu commented Jul 25, 2023

@JoelSpeed @patrickdillon could you please take another look?

@patrickdillon
Copy link
Contributor

@JoelSpeed @patrickdillon could you please take another look?

Our enhancement discussion has revealed a path that may very well make these changes unneeded, so we should probably resolve that before iterating much further.

@sadasu
Copy link
Contributor Author

sadasu commented Jul 25, 2023

@JoelSpeed @patrickdillon could you please take another look?

Our enhancement discussion has revealed a path that may very well make these changes unneeded, so we should probably resolve that before iterating much further.

@patrickdillon is there a desire for having the cluster have specific knowledge about whether external DNS is in use? If yes, then we would need this.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 31, 2023

@sadasu: 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/verify-crd-schema 3011226 link true /test verify-crd-schema

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.

@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 31, 2023
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

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.

@sadasu
Copy link
Contributor Author

sadasu commented Oct 4, 2023

This PR is no longer needed since the design for this epic has changed.

@sadasu sadasu closed this Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants