Skip to content

Commit

Permalink
Use the host's network namespace for scans
Browse files Browse the repository at this point in the history
'hostNetwork: true' grants access to the host's sysctl configurations.
'dnsPolicy: ClusterFirstWithHostnet' is required to access services.
  • Loading branch information
yuumasato committed Mar 15, 2024
1 parent 45fb1c6 commit a10228d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/controller/compliancescan/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,8 @@ func newScanPodForNode(scanInstance *compv1alpha1.ComplianceScan, node *corev1.N
NodeSelector: map[string]string{
corev1.LabelHostname: node.Labels[corev1.LabelHostname],
},
HostNetwork: true,
DNSPolicy: "ClusterFirstWithHostNet",
RestartPolicy: corev1.RestartPolicyOnFailure,
Volumes: []corev1.Volume{
{
Expand Down

0 comments on commit a10228d

Please sign in to comment.