-
Notifications
You must be signed in to change notification settings - Fork 138
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
Add logmodule daemonset reconciler #3825
base: main
Are you sure you want to change the base?
Conversation
It needs to be the communication endpoints of the oneagentm and not the api-url
The logmodule also relays on the oneagent connection-info
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #3825 +/- ##
==========================================
+ Coverage 65.06% 65.52% +0.46%
==========================================
Files 397 405 +8
Lines 21414 21767 +353
==========================================
+ Hits 13932 14262 +330
- Misses 6143 6157 +14
- Partials 1339 1348 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -98,3 +98,15 @@ type ImageRefSpec struct { | |||
// Indicates a tag of the image to use | |||
Tag string `json:"tag,omitempty"` | |||
} | |||
|
|||
func (ref ImageRefSpec) String(defaultRepo, defaultTag string) string { |
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.
do we really need to pass default repo and tag as parameters? Not that it matters a lot but it somehow looks weird because of the word "default"
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.
ImageRefSpec
is not only used by the LogModule, but I agree, there is a better solution
@@ -98,3 +98,15 @@ type ImageRefSpec struct { | |||
// Indicates a tag of the image to use | |||
Tag string `json:"tag,omitempty"` | |||
} | |||
|
|||
func (ref ImageRefSpec) String(defaultRepo, defaultTag string) string { |
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.
why are you adding this to extensions?
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.
I will move the ImageRefSpec
elsewhere, it is not extensions specific
@@ -18,7 +19,7 @@ import ( | |||
|
|||
const ( | |||
logModuleSecretSuffix = "-logmodule-config" | |||
deploymentConfigFilename = "deployment.conf" | |||
DeploymentConfigFilename = "deployment.conf" |
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.
should this be moved to the config.go
file of the pacakge?
@@ -126,7 +127,7 @@ func (r *Reconciler) getSecretData(ctx context.Context) (map[string][]byte, erro | |||
} | |||
|
|||
deploymentConfigContent := map[string]string{ | |||
serverKey: r.dk.ApiUrl(), | |||
serverKey: fmt.Sprintf("{%s}", r.dk.Status.OneAgent.ConnectionInfoStatus.Endpoints), |
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.
can we move this to properties?
return ds, nil | ||
} | ||
|
||
func GetName(dkName string) string { |
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.
isn't this the pod/daemonset name? just name makes is confusing when used in other places
we also have this in the properties for other components
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.
we are in the daemonset
package, that would be imported (probably with an alias) like lmdaemonset
, then it would read lmdaemonset.GetName
. So we avoid stuttering.
podLogsVolumePath = "/var/log/pods" | ||
dockerLogsVolumeName = "var-lib-docker-containers" | ||
dockerLogsVolumePath = "/var/lib/docker/containers" | ||
containerLogsVolumeName = "var-log-containers" |
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.
we could rename the volume name to logs-container
or similar (same for others) as that's much more explicit than just reusing the path.
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.
maybe more human readable version: container-logs
?
require.NotNil(t, daemonset) | ||
|
||
assert.Subset(t, daemonset.Spec.Template.Labels, customLabels) | ||
// assert.Subset(t, daemonset.Labels, customLabels) TODO: Should this be the case? |
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.
should it? Checking the activegate, custom labels are only put on the pods
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.
that is why I am asking :D
Description
K8S-10617
Adds the logmodule reconciler that will create a
DaemonSet
based on thespec.templates.logModule
.Has some minor adjustments for the
configsecret
reconciler:How can this be tested?
What to configure in the
DynaKube
spec.logModule.enabled: true
templates
> ✨What to configure in the tenant
https://zib50933.dev.dynatracelabs.com/ui/settings/builtin:logmonitoring.log-storage-settings
Add rule
, this is a "catch-all" example:What to check to see it "work"
If you see logs such as: