Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/manifests/assets/dns/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apiVersion: v1
spec:
# clusterIP will be automatically managed.
# selector is set at runtime
internalTrafficPolicy: Local
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You would also need to update daemonsetConfigChanged in pkg/operator/controller/controller_dns_daemonset.go to ensure existing an daemon set got updated.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Bit confused here, I assume this shall help me keeping iTP to local.

trafficDistribution: PreferSameNode
ports:
- name: dns
Expand Down
11 changes: 11 additions & 0 deletions pkg/operator/controller/controller_dns_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,17 @@ func TestDNSServiceChanged(t *testing.T) {
}
}

func TestDesiredDNSServiceInternalTrafficPolicy(t *testing.T) {
dns := &operatorv1.DNS{
ObjectMeta: metav1.ObjectMeta{Name: "default"},
}
daemonsetRef := metav1.OwnerReference{}
svc := desiredDNSService(dns, "172.30.0.10", false, daemonsetRef)

assert.NotNil(t, svc.Spec.InternalTrafficPolicy)
assert.Equal(t, corev1.ServiceInternalTrafficPolicyLocal, *svc.Spec.InternalTrafficPolicy)
}

func Test_shouldEnableTopologyAwareHints(t *testing.T) {
emptyLabels := map[string]string{}
someCPU := map[corev1.ResourceName]resource.Quantity{
Expand Down