Skip to content

Commit

Permalink
helm: Add selinuxMount flag to enable/disable /etc/selinux host mount
Browse files Browse the repository at this point in the history
Add selinuxMount flag to enable/disable /etc/selinux host mount inside pods
to support selinux-enabled filesystems

Signed-off-by: Francesco Astegiano <francesco.astegiano@gmail.com>
  • Loading branch information
Aste88 authored and mergify[bot] committed Feb 16, 2022
1 parent ea89b26 commit 4235178
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions charts/ceph-csi-cephfs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ charts and their default values.
| `secret.name` | Specifies the cephFS secret name | `csi-cephfs-secret` |
| `secret.adminID` | Specifies the admin ID of the cephFS secret | `<plaintext ID>` |
| `secret.adminKey` | Specifies the key that corresponds to the adminID | `<Ceph auth key corresponding to ID above>` |
| `selinuxMount` | Mount the host /etc/selinux inside pods to support selinux-enabled filesystems | `true` |

### Command Line

Expand Down
4 changes: 4 additions & 0 deletions charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ spec:
name: host-mount
- mountPath: /sys
name: host-sys
{{- if .Values.selinuxMount }}
- mountPath: /etc/selinux
name: etc-selinux
readOnly: true
{{- end }}
- mountPath: /lib/modules
name: lib-modules
readOnly: true
Expand Down Expand Up @@ -176,9 +178,11 @@ spec:
- name: host-sys
hostPath:
path: /sys
{{- if .Values.selinuxMount }}
- name: etc-selinux
hostPath:
path: /etc/selinux
{{- end }}
- name: host-mount
hostPath:
path: /run/mount
Expand Down
2 changes: 2 additions & 0 deletions charts/ceph-csi-cephfs/templates/nodeplugin-psp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
readOnly: false
- pathPrefix: '/sys'
readOnly: false
{{- if .Values.selinuxMount }}
- pathPrefix: '/etc/selinux'
readOnly: true
{{- end }}
- pathPrefix: '/lib/modules'
readOnly: true
- pathPrefix: '{{ .Values.kubeletDir }}'
Expand Down
4 changes: 4 additions & 0 deletions charts/ceph-csi-cephfs/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ provisioner:
podSecurityPolicy:
enabled: false

# Mount the host /etc/selinux inside pods to support
# selinux-enabled filesystems
selinuxMount: true

topology:
# Specifies whether topology based provisioning support should
# be exposed by CSI
Expand Down
1 change: 1 addition & 0 deletions charts/ceph-csi-rbd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ charts and their default values.
| `secret.userID` | Specifies the user ID of the rbd secret | `<plaintext ID>` |
| `secret.userKey` | Specifies the key that corresponds to the userID | `<Ceph auth key corresponding to ID above>` |
| `secret.encryptionPassphrase` | Specifies the encryption passphrase of the secret | `test_passphrase` |
| `selinuxMount` | Mount the host /etc/selinux inside pods to support selinux-enabled filesystems | `true` |

### Command Line

Expand Down
4 changes: 4 additions & 0 deletions charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ spec:
name: host-mount
- mountPath: /sys
name: host-sys
{{- if .Values.selinuxMount }}
- mountPath: /etc/selinux
name: etc-selinux
readOnly: true
{{- end }}
- mountPath: /lib/modules
name: lib-modules
readOnly: true
Expand Down Expand Up @@ -193,9 +195,11 @@ spec:
- name: host-sys
hostPath:
path: /sys
{{- if .Values.selinuxMount }}
- name: etc-selinux
hostPath:
path: /etc/selinux
{{- end }}
- name: lib-modules
hostPath:
path: /lib/modules
Expand Down
2 changes: 2 additions & 0 deletions charts/ceph-csi-rbd/templates/nodeplugin-psp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ spec:
readOnly: false
- pathPrefix: '/sys'
readOnly: false
{{- if .Values.selinuxMount }}
- pathPrefix: '/etc/selinux'
readOnly: true
{{- end }}
- pathPrefix: '/lib/modules'
readOnly: true
- pathPrefix: '{{ .Values.cephLogDirHostPath }}'
Expand Down
4 changes: 4 additions & 0 deletions charts/ceph-csi-rbd/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ storageClass:
# mountOptions:
# - discard

# Mount the host /etc/selinux inside pods to support
# selinux-enabled filesystems
selinuxMount: true

secret:
# Specifies whether the secret should be created
create: false
Expand Down

0 comments on commit 4235178

Please sign in to comment.