Skip to content
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

Set security context of workloads #1325

Merged
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Set security context in metrics collector
This commit sets the following security context for the metric collector
pods:

```
securityContext:
    privileged: false
    readOnlyRootFilesystem: true
```

this as required by: RHOBS-1001

Signed-off-by: Jacob Baungard Hansen <jacobbaungard@redhat.com>
  • Loading branch information
jacobbaungard committed Feb 19, 2024
commit 4f6078b172088871627082abe718693b4e33d09c
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,14 @@ func createDeployment(params CollectorParams) *appsv1.Deployment {
})
}

privileged := false
readOnlyRootFilesystem := true

metricsCollectorDep.Spec.Template.Spec.Containers[0].SecurityContext = &corev1.SecurityContext{
Privileged: &privileged,
ReadOnlyRootFilesystem: &readOnlyRootFilesystem,
}

if params.obsAddonSpec.Resources != nil {
metricsCollectorDep.Spec.Template.Spec.Containers[0].Resources = *params.obsAddonSpec.Resources
}
Expand Down