Skip to content

Add ability to disable creation of dns zone for unmanaged installs #5666

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sadasu
Copy link
Contributor

@sadasu sadasu commented Jun 2, 2025

Similar to managed installs, add ability to optionally create DNS zones for unmanged installs.

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR adds the ability to optionally create private DNS zones for unmanaged clusters. Without this feature they are always created. There are some instances we would like to use a DNS service other than Azure DNS and would like CAPI to withhold creation of private DNS Zones at those times. This feature adds a new field to NetworkSpec that allows us to skip creation of the DNS zone. Default behavior remains unchanged where DNS zones are created during cluster creation.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • cherry-pick candidate

Release note:

Add ability to optionally create the Private DNS Zone for unmanaged clusters instead of always creating one. Setting `PrivateDNSZone` within the `NetworkSpec` to `PrivateDNSZoneiCreationModeNone` will skip creating the Private DNS zone.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 2, 2025
@k8s-ci-robot
Copy link
Contributor

[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 assign vincepri for approval. For more information see the 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

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 2, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @sadasu. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 2, 2025
Copy link

codecov bot commented Jun 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.95%. Comparing base (2acf550) to head (14ce92f).
Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5666      +/-   ##
==========================================
+ Coverage   52.83%   52.95%   +0.11%     
==========================================
  Files         278      279       +1     
  Lines       29610    29634      +24     
==========================================
+ Hits        15645    15692      +47     
+ Misses      13148    13123      -25     
- Partials      817      819       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sadasu sadasu force-pushed the unmanaged-privateDNSZoneMode branch from 4c7fe79 to 1ed0e07 Compare June 2, 2025 20:49
@willie-yao
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 2, 2025
@willie-yao
Copy link
Contributor

/retest

@sadasu Can you please run make generate to fix the verify error?

@sadasu sadasu force-pushed the unmanaged-privateDNSZoneMode branch 2 times, most recently from 7ce774b to b660d6d Compare July 8, 2025 15:36
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 8, 2025
@willie-yao
Copy link
Contributor

/retest

@sadasu sadasu force-pushed the unmanaged-privateDNSZoneMode branch from b660d6d to 58dae51 Compare July 8, 2025 21:35
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 8, 2025
@sadasu
Copy link
Contributor Author

sadasu commented Jul 10, 2025

@willie-yao could you please take another look? Thanks!

@jhixson74
Copy link
Contributor

LGTM, I don't have anything to add here.

@sadasu sadasu force-pushed the unmanaged-privateDNSZoneMode branch 2 times, most recently from 6f2bf33 to 153fae0 Compare July 21, 2025 13:47
Similar to managed installs, add ability to optionally create
DNS zones for unmanged installs.
@sadasu sadasu force-pushed the unmanaged-privateDNSZoneMode branch from 153fae0 to 14ce92f Compare July 21, 2025 13:52
@@ -1251,3 +1251,11 @@ func (s *ClusterScope) getLastAppliedSecurityRules(nsgName string) map[string]in
}
return lastAppliedSecurityRules
}

// PrivateDNSZoneMode returns the cluster resource group.
Copy link

Choose a reason for hiding this comment

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

I don't think this comment is correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

6 participants