Skip to content

Commit

Permalink
csi: add sc privileged to logrotate sidecar container
Browse files Browse the repository at this point in the history
deployments on openshift where we need csi container pods
to be run on privileged, the logrotate sidecar container was missing the
privileged permission letting, side car to not run properly

Signed-off-by: parth-gr <[email protected]>
(cherry picked from commit 21ca333)
  • Loading branch information
parth-gr committed Oct 1, 2024
1 parent d01bb26 commit 44aa394
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
# This is necessary for the Bidirectional mount propagation
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
image: {{ .CSIPluginImage }}
command:
- "/bin/sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ spec:
{{ if and .Privileged .CSILogRotation }}
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
{{ end }}
volumeMounts:
- name: socket-dir
Expand Down
6 changes: 6 additions & 0 deletions pkg/operator/ceph/csi/template/csi-logrotate-sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ command:
image: {{ .CSIPluginImage }}
imagePullPolicy: IfNotPresent
name: log-collector
{{ if .Privileged }}
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
{{ end }}
volumeMounts:
- mountPath: {{ .CsiLogRootPath }}/logrotate-config/{{ .CsiComponentName }}
name: csi-logs-logrotate
Expand Down
2 changes: 2 additions & 0 deletions pkg/operator/ceph/csi/template/nfs/csi-nfsplugin-holder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
# This is necessary for the Bidirectional mount propagation
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
image: {{ .CSIPluginImage }}
command:
- "/bin/sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ spec:
{{ if and .Privileged .CSILogRotation }}
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
{{ end }}
volumeMounts:
- name: socket-dir
Expand Down
2 changes: 2 additions & 0 deletions pkg/operator/ceph/csi/template/rbd/csi-rbdplugin-holder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ spec:
# This is necessary for the Bidirectional mount propagation
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
image: {{ .CSIPluginImage }}
command:
- "/bin/sh"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ spec:
{{ if and .Privileged .CSILogRotation }}
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
{{ end }}
volumeMounts:
- name: socket-dir
Expand Down Expand Up @@ -263,6 +265,8 @@ spec:
{{ if and .Privileged .CSILogRotation }}
securityContext:
privileged: true
capabilities:
drop: ["ALL"]
{{ end }}
volumeMounts:
- name: socket-dir
Expand Down

0 comments on commit 44aa394

Please sign in to comment.