fix: create per cluster api server dns zone to avoid circular dependency#8673
Merged
Conversation
cameronmeissner
approved these changes
Jun 9, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the e2e provisioning flow to avoid a circular dependency by switching from a single shared API server private DNS zone to creating/using a dedicated private DNS zone per cluster (keyed by the cluster API server FQDN).
Changes:
- Removed shared API server private DNS zone creation from shared infra provisioning.
- Updated cluster preparation to set up private DNS for the API server using the cluster VNet and node resource group.
- Changed the private DNS approach to use a per-FQDN private zone with an apex (
"@") A record.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| e2e/shared_infra.go | Removes shared API server DNS zone helper + shared zone creation during shared infra setup. |
| e2e/cluster.go | Creates/updates a per-cluster private DNS zone (named after the API server FQDN) and links it to the cluster VNet; wires this into the cluster prep DAG. |
Comment on lines
695
to
696
| // setupPrivateDNSForAPIServer adds an A record for the cluster's API server FQDN | ||
| // to the shared private DNS zone. The zone and VNet link are created once by ensureSharedInfra. |
Comment on lines
+736
to
739
| if allMatch { | ||
| toolkit.Logf(ctx, "private DNS zone %q already up to date", fqdn) | ||
| return nil | ||
| } |
c859d9b to
a96fc6f
Compare
cameronmeissner
approved these changes
Jun 9, 2026
a96fc6f to
d320471
Compare
timmy-wright
approved these changes
Jun 10, 2026
Comment on lines
+736
to
739
| if allMatch { | ||
| toolkit.Logf(ctx, "private DNS zone %q already up to date", fqdn) | ||
| return nil | ||
| } |
Comment on lines
923
to
+934
| func createPrivateZone(ctx context.Context, nodeResourceGroup, privateZoneName string) (*armprivatedns.PrivateZone, error) { | ||
| pzResp, err := config.Azure.PrivateZonesClient.Get( | ||
| ctx, | ||
| nodeResourceGroup, | ||
| privateZoneName, | ||
| nil, | ||
| ) | ||
| if err == nil { | ||
| return &pzResp.PrivateZone, nil | ||
| } | ||
| return createPrivateZoneWithRetry(ctx, nodeResourceGroup, privateZoneName) | ||
| } |
Comment on lines
985
to
995
| _, err := config.Azure.VirutalNetworkLinksClient.Get( | ||
| ctx, | ||
| resourceGroup, | ||
| privateZoneName, | ||
| networkLinkName, | ||
| nil, | ||
| ) | ||
|
|
||
| if err == nil { | ||
| // private dns link already created | ||
| return nil | ||
| } | ||
|
|
d320471 to
71a2ab7
Compare
timmy-wright
approved these changes
Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was a circular dependency because we were trying to be smart to use single private zone, create one per cluster