-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fix scheduling of system-probe related checks in the core agent and missing permissions for network policies #168
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -825,6 +825,20 @@ func defaultPodSpec() corev1.PodSpec { | |||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
func defaultSystemProbePodSpec() corev1.PodSpec { | ||||||||||||||||||||||||||
agentWithSystemProbeVolumeMounts := []corev1.VolumeMount{} | ||||||||||||||||||||||||||
agentWithSystemProbeVolumeMounts = append(agentWithSystemProbeVolumeMounts, defaultMountVolume()...) | ||||||||||||||||||||||||||
agentWithSystemProbeVolumeMounts = append(agentWithSystemProbeVolumeMounts, []corev1.VolumeMount{ | ||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||
Name: "sysprobe-socket-dir", | ||||||||||||||||||||||||||
ReadOnly: true, | ||||||||||||||||||||||||||
MountPath: "/opt/datadog-agent/run", | ||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||
Name: "system-probe-config", | ||||||||||||||||||||||||||
MountPath: "/etc/datadog-agent/system-probe.yaml", | ||||||||||||||||||||||||||
SubPath: "system-probe.yaml", | ||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||
Comment on lines
+836
to
+840
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does it mean that before we didn't mount the config map that contains the system-probe.yaml configuration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly (in core agent; not in system probe itself ofc) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The thing is that, before the When There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW running There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But the metrics are showing up in the app ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes status is fine too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think you have to do
Comment on lines
+836
to
+840
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the
Suggested change
|
||||||||||||||||||||||||||
}...) | ||||||||||||||||||||||||||
return corev1.PodSpec{ | ||||||||||||||||||||||||||
ServiceAccountName: "foo-agent", | ||||||||||||||||||||||||||
InitContainers: []corev1.Container{ | ||||||||||||||||||||||||||
|
@@ -850,7 +864,7 @@ func defaultSystemProbePodSpec() corev1.PodSpec { | |||||||||||||||||||||||||
Command: []string{"bash", "-c"}, | ||||||||||||||||||||||||||
Args: []string{"for script in $(find /etc/cont-init.d/ -type f -name '*.sh' | sort) ; do bash $script ; done"}, | ||||||||||||||||||||||||||
Env: defaultEnvVars(), | ||||||||||||||||||||||||||
VolumeMounts: defaultMountVolume(), | ||||||||||||||||||||||||||
VolumeMounts: agentWithSystemProbeVolumeMounts, | ||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||
Name: "seccomp-setup", | ||||||||||||||||||||||||||
|
@@ -888,7 +902,7 @@ func defaultSystemProbePodSpec() corev1.PodSpec { | |||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||
Env: defaultEnvVars(), | ||||||||||||||||||||||||||
VolumeMounts: defaultMountVolume(), | ||||||||||||||||||||||||||
VolumeMounts: agentWithSystemProbeVolumeMounts, | ||||||||||||||||||||||||||
LivenessProbe: defaultLivenessProbe(), | ||||||||||||||||||||||||||
ReadinessProbe: defaultReadinessProbe(), | ||||||||||||||||||||||||||
}, | ||||||||||||||||||||||||||
|
@@ -1976,6 +1990,7 @@ func Test_newExtendedDaemonSetFromInstance_endpointsChecksConfig(t *testing.T) { | |||||||||||||||||||||||||
|
||||||||||||||||||||||||||
test.Run(t) | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
func extendedDaemonSetWithSystemProbe(ddaHash string, podSpec corev1.PodSpec) *edsdatadoghqv1alpha1.ExtendedDaemonSet { | ||||||||||||||||||||||||||
return &edsdatadoghqv1alpha1.ExtendedDaemonSet{ | ||||||||||||||||||||||||||
ObjectMeta: metav1.ObjectMeta{ | ||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1153,6 +1153,23 @@ func getVolumeMountsForAgent(spec *datadoghqv1alpha1.DatadogAgentSpec) []corev1. | |||||||||||||||||||||||
}, | ||||||||||||||||||||||||
}...) | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
// SystemProbe volumes | ||||||||||||||||||||||||
if datadoghqv1alpha1.BoolValue(spec.Agent.SystemProbe.Enabled) { | ||||||||||||||||||||||||
volumeMounts = append(volumeMounts, []corev1.VolumeMount{ | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
Name: datadoghqv1alpha1.SystemProbeSocketVolumeName, | ||||||||||||||||||||||||
MountPath: datadoghqv1alpha1.SystemProbeSocketVolumePath, | ||||||||||||||||||||||||
ReadOnly: true, | ||||||||||||||||||||||||
}, | ||||||||||||||||||||||||
{ | ||||||||||||||||||||||||
Name: datadoghqv1alpha1.SystemProbeConfigVolumeName, | ||||||||||||||||||||||||
MountPath: datadoghqv1alpha1.SystemProbeConfigVolumePath, | ||||||||||||||||||||||||
SubPath: datadoghqv1alpha1.SystemProbeConfigVolumeSubPath, | ||||||||||||||||||||||||
}, | ||||||||||||||||||||||||
Comment on lines
+1165
to
+1169
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can the config file be mounted read-only ?
Suggested change
|
||||||||||||||||||||||||
}...) | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
return append(volumeMounts, spec.Agent.Config.VolumeMounts...) | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you reference also adding networkpolicies RBAC in the PR description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done