mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
changes related to selinux and permissions for openshift
* run the sgx container as container_device_plugin_t and init container as container_device_plugin_init_t. these labels are being added to container_selinux package upstream. * add rbac role for openshift Signed-off-by: Manish Regmi <manish.regmi@intel.com>
This commit is contained in:
parent
23eacb3188
commit
78d2fe24e3
@ -245,3 +245,11 @@ rules:
|
|||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
|
- apiGroups:
|
||||||
|
- security.openshift.io
|
||||||
|
resources:
|
||||||
|
- securitycontextconstraints
|
||||||
|
resourceNames:
|
||||||
|
- privileged
|
||||||
|
verbs:
|
||||||
|
- use
|
||||||
|
@ -17,6 +17,8 @@ spec:
|
|||||||
- name: intel-sgx-plugin
|
- name: intel-sgx-plugin
|
||||||
image: intel/intel-sgx-plugin:devel
|
image: intel/intel-sgx-plugin:devel
|
||||||
securityContext:
|
securityContext:
|
||||||
|
seLinuxOptions:
|
||||||
|
type: "container_device_plugin_t"
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
|
@ -106,6 +106,9 @@ func setInitContainer(spec *v1.PodSpec, imageName string) {
|
|||||||
ImagePullPolicy: "IfNotPresent",
|
ImagePullPolicy: "IfNotPresent",
|
||||||
Name: "intel-sgx-initcontainer",
|
Name: "intel-sgx-initcontainer",
|
||||||
SecurityContext: &v1.SecurityContext{
|
SecurityContext: &v1.SecurityContext{
|
||||||
|
SELinuxOptions: &v1.SELinuxOptions{
|
||||||
|
Type: "container_device_plugin_init_t",
|
||||||
|
},
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
},
|
},
|
||||||
VolumeMounts: []v1.VolumeMount{
|
VolumeMounts: []v1.VolumeMount{
|
||||||
|
@ -71,6 +71,9 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
|
|||||||
Image: devicePlugin.Spec.Image,
|
Image: devicePlugin.Spec.Image,
|
||||||
ImagePullPolicy: "IfNotPresent",
|
ImagePullPolicy: "IfNotPresent",
|
||||||
SecurityContext: &v1.SecurityContext{
|
SecurityContext: &v1.SecurityContext{
|
||||||
|
SELinuxOptions: &v1.SELinuxOptions{
|
||||||
|
Type: "container_device_plugin_t",
|
||||||
|
},
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
AllowPrivilegeEscalation: &no,
|
AllowPrivilegeEscalation: &no,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user