← Back to Pull requests

add default domain external dns reconciler #513

Merged
OliverMKing merged 8 files (480 lines) on Nov 18, 2025 17:48 UTC
View on GitHub
OliverMKing OliverMKing commented on Nov 18, 2025 03:30 UTC
Author

Description

adds a default domain external dns reconciler. This will make it so 0 touch steps are required by user before external dns reconciles default domain records.

Diff: 480 lines (+469 / -11) across 8 files Reviewer: meecethereese Review duration: 857m
All Vouch review confidence checks passed
Residual risk 0.09 = Change Risk (0.50) × (1 − Review Confidence (0.83)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 480 lines diff across 8 files
0.50
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.72 · 5 substantive comment(s)
0.72
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
82%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.369
Real PR Conversation Timeline
9 items
OliverMKing OliverMKing commented on Nov 18, 2025 03:30 UTC
Author

/ok-to-test sha=cd9fd74

OliverMKing OliverMKing commented on Nov 18, 2025 03:46 UTC
Author

/ok-to-test sha=461fa61

jack4it jack4it commented on code on Nov 18, 2025 04:23 UTC
Code Review
pkg/controller/dns/default_domain_cluster_external_dns.go:1
@@ -0,0 +1,79 @@
+package dns
+
+import (
+	approutingv1alpha1 "github.com/Azure/aks-app-routing-operator/api/v1alpha1"
+	"github.com/Azure/aks-app-routing-operator/pkg/config"
+	"github.com/Azure/aks-app-routing-operator/pkg/controller/common"
+	"github.com/Azure/aks-app-routing-operator/pkg/controller/controllername"
+	"github.com/Azure/aks-app-routing-operator/pkg/manifests"
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	ctrl "sigs.k8s.io/controller-runtime"
+	"sigs.k8s.io/controller-runtime/pkg/client"
+)
+
+const defaultDomainDNSResourceName = "default-domain-dns"
+
+var name = controllername.New("default", "domain", "dns")
+
+// NewDefaultDomainDNSReconciler creates a new reconciler for managing external DNS records for the default domain in the cluster.
+func NewDefaultDomainDNSReconciler(
+	manager ctrl.Manager,
+	conf *config.Config,
+) error {
+	return common.NewResourceReconciler(
+		manager,
+		name,
+		defaultDomainObjects(conf),
+		reconcileInterval,
+	)
+}
+
+func defaultDomainObjects(conf *config.Config) []client.Object {
+	objs := []client.Object{
+		defaultDomainServiceAccount(conf),
+		defaultDomainClusterExternalDNS(conf),
+	}
+
+	// Can safely assume the namespace exists if using kube-system.
+	// This will basically never happen but is a legacy thing for some tests and should
+	// be kept for compatibility.
+	if conf.NS != "kube-system" {
+		objs = append([]client.Object{manifests.Namespace(conf, conf.NS)}, objs...) // put namespace at front, so we can create resources in order
+	}
+
+	return objs
+}
+
+func defaultDomainServiceAccount(conf *config.Config) *corev1.ServiceAccount {
+	return &corev1.ServiceAccount{
+		ObjectMeta: metav1.ObjectMeta{
+			Name:      defaultDomainDNSResourceName,
+			Namespace: conf.NS,
+			Annotations: map[string]string{
+				"azure.workload.identity/use":       "true",

azure.workload.identity/use should be the pod label instead of this SA annotation

OliverMKing OliverMKing commented on Nov 18, 2025 15:34 UTC
Author

/ok-to-test sha=bc9f0d9

meecethereese meecethereese commented on code on Nov 18, 2025 15:35 UTC
Code Review
pkg/config/config_test.go:1
@@ -310,10 +337,13 @@ var validateTestCases = []struct {
 			OperatorDeployment:       "app-routing-operator",
 			CrdPath:                  validCrdPath,
 			EnableDefaultDomain:      true,
+			EnabledWorkloadIdentity:  true,
 			DefaultDomainCertPath:    "",
 			DefaultDomainKeyPath:     "",

np, but incase the order of the ORs were to change in the future this test could end up only evaluating the missing key path

OliverMKing OliverMKing commented on Nov 18, 2025 15:58 UTC
Author

/ok-to-test sha=6bb07ad

meecethereese meecethereese approved these changes on Nov 18, 2025 16:14 UTC
Approved Reviewer

Approved these changes.

OliverMKing OliverMKing commented on code on Nov 18, 2025 17:48 UTC
Code Review
pkg/controller/dns/default_domain_cluster_external_dns.go:1
@@ -0,0 +1,79 @@
+package dns
+
+import (
+	approutingv1alpha1 "github.com/Azure/aks-app-routing-operator/api/v1alpha1"
+	"github.com/Azure/aks-app-routing-operator/pkg/config"
+	"github.com/Azure/aks-app-routing-operator/pkg/controller/common"
+	"github.com/Azure/aks-app-routing-operator/pkg/controller/controllername"
+	"github.com/Azure/aks-app-routing-operator/pkg/manifests"
+	corev1 "k8s.io/api/core/v1"
+	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
+	ctrl "sigs.k8s.io/controller-runtime"
+	"sigs.k8s.io/controller-runtime/pkg/client"
+)
+
+const defaultDomainDNSResourceName = "default-domain-dns"
+
+var name = controllername.New("default", "domain", "dns")
+
+// NewDefaultDomainDNSReconciler creates a new reconciler for managing external DNS records for the default domain in the cluster.
+func NewDefaultDomainDNSReconciler(
+	manager ctrl.Manager,
+	conf *config.Config,
+) error {
+	return common.NewResourceReconciler(
+		manager,
+		name,
+		defaultDomainObjects(conf),
+		reconcileInterval,
+	)
+}
+
+func defaultDomainObjects(conf *config.Config) []client.Object {
+	objs := []client.Object{
+		defaultDomainServiceAccount(conf),
+		defaultDomainClusterExternalDNS(conf),
+	}
+
+	// Can safely assume the namespace exists if using kube-system.
+	// This will basically never happen but is a legacy thing for some tests and should
+	// be kept for compatibility.
+	if conf.NS != "kube-system" {
+		objs = append([]client.Object{manifests.Namespace(conf, conf.NS)}, objs...) // put namespace at front, so we can create resources in order
+	}
+
+	return objs
+}
+
+func defaultDomainServiceAccount(conf *config.Config) *corev1.ServiceAccount {
+	return &corev1.ServiceAccount{
+		ObjectMeta: metav1.ObjectMeta{
+			Name:      defaultDomainDNSResourceName,
+			Namespace: conf.NS,
+			Annotations: map[string]string{
+				"azure.workload.identity/use":       "true",

Good catch!

Reviewers
Assignees
OliverMKing OliverMKing
Labels
risk: low confidence: 82.8% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 50.2% (MEDIUM) · Higher = larger blast radius
50.2%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 82.8% · Lower = rushed or shallow review
82.8%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 8.6% · Safe to merge
8.6%