mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
Merge pull request #906 from bart0sh/PR136-terrascan-check
implement terrascan check
This commit is contained in:
commit
711fbbff07
14
.github/workflows/ci.yaml
vendored
14
.github/workflows/ci.yaml
vendored
@ -166,3 +166,17 @@ jobs:
|
|||||||
- name: Test SGX & FPGA Admission Webhook, Deploy Operator
|
- name: Test SGX & FPGA Admission Webhook, Deploy Operator
|
||||||
run: |
|
run: |
|
||||||
make test-with-kind
|
make test-with-kind
|
||||||
|
|
||||||
|
terrascan:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- name: Install terrascan
|
||||||
|
run: |
|
||||||
|
curl -L "$(curl -s https://api.github.com/repos/accurics/terrascan/releases/latest | grep -o -E "https://.+?_Linux_x86_64.tar.gz")" > terrascan.tar.gz
|
||||||
|
tar -xf terrascan.tar.gz terrascan && rm terrascan.tar.gz
|
||||||
|
install terrascan /usr/local/bin && rm terrascan
|
||||||
|
- name: Run Terrascan
|
||||||
|
run: make terrascan
|
||||||
|
|
||||||
|
9
Jenkinsfile
vendored
9
Jenkinsfile
vendored
@ -67,6 +67,15 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage("make lint"){
|
stage("make lint"){
|
||||||
parallel {
|
parallel {
|
||||||
|
stage("make terrascan") {
|
||||||
|
steps {
|
||||||
|
dir(path: "$REPO_DIR") {
|
||||||
|
sh "curl -sL `curl -s https://api.github.com/repos/accurics/terrascan/releases/latest | grep -o -E https://.+?_Linux_x86_64.tar.gz` | tar -zx terrascan"
|
||||||
|
sh "sudo mv terrascan /usr/local/bin/"
|
||||||
|
sh "make terrascan"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
stage("make lint") {
|
stage("make lint") {
|
||||||
steps {
|
steps {
|
||||||
dir(path: "$REPO_DIR") {
|
dir(path: "$REPO_DIR") {
|
||||||
|
9
Makefile
9
Makefile
@ -148,6 +148,15 @@ e2e-sgx:
|
|||||||
e2e-gpu:
|
e2e-gpu:
|
||||||
@$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.progress -ginkgo.focus "GPU" -delete-namespace-on-failure=false
|
@$(GO) test -v ./test/e2e/... -ginkgo.v -ginkgo.progress -ginkgo.focus "GPU" -delete-namespace-on-failure=false
|
||||||
|
|
||||||
|
terrascan:
|
||||||
|
@ls deployments/*/kustomization.yaml | while read f ; \
|
||||||
|
do \
|
||||||
|
echo "\n==== $$(basename $$(dirname $$f)) ====" ; \
|
||||||
|
terrascan scan -v --show-passed -d $$(dirname $$f) -i kustomize --severity high \
|
||||||
|
--skip-rules 'AC_K8S_0051,AC_K8S_0076,AC_K8S_0087' \
|
||||||
|
|| exit $$? ; \
|
||||||
|
done
|
||||||
|
|
||||||
pre-pull:
|
pre-pull:
|
||||||
ifeq ($(TAG),devel)
|
ifeq ($(TAG),devel)
|
||||||
@$(BUILDER) pull golang:1.17-bullseye
|
@$(BUILDER) pull golang:1.17-bullseye
|
||||||
|
@ -24,6 +24,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
terminationMessagePath: /tmp/termination-log
|
terminationMessagePath: /tmp/termination-log
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: devfs
|
- name: devfs
|
||||||
|
@ -24,6 +24,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: devfs
|
- name: devfs
|
||||||
mountPath: /dev/dsa
|
mountPath: /dev/dsa
|
||||||
|
2
deployments/fpga_admissionwebhook/kustomization.yaml
Normal file
2
deployments/fpga_admissionwebhook/kustomization.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bases:
|
||||||
|
- base
|
@ -24,6 +24,7 @@ spec:
|
|||||||
runAsUser: 65532
|
runAsUser: 65532
|
||||||
runAsGroup: 65532
|
runAsGroup: 65532
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
@ -20,6 +20,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /opt/intel/fpga-sw
|
- mountPath: /opt/intel/fpga-sw
|
||||||
name: intel-fpga-sw
|
name: intel-fpga-sw
|
||||||
@ -39,6 +40,7 @@ spec:
|
|||||||
terminationMessagePath: /tmp/termination-log
|
terminationMessagePath: /tmp/termination-log
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: devfs
|
- name: devfs
|
||||||
mountPath: /dev
|
mountPath: /dev
|
||||||
|
2
deployments/fpga_plugin/kustomization.yaml
Normal file
2
deployments/fpga_plugin/kustomization.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
resources:
|
||||||
|
- base
|
@ -19,6 +19,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /etc/kubernetes/node-feature-discovery/source.d/
|
- mountPath: /etc/kubernetes/node-feature-discovery/source.d/
|
||||||
name: nfd-source-hooks
|
name: nfd-source-hooks
|
||||||
@ -33,6 +34,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: devfs
|
- name: devfs
|
||||||
mountPath: /dev/dri
|
mountPath: /dev/dri
|
||||||
|
@ -24,6 +24,7 @@ spec:
|
|||||||
runAsUser: 1000
|
runAsUser: 1000
|
||||||
runAsGroup: 1000
|
runAsGroup: 1000
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
- name: manager
|
- name: manager
|
||||||
args:
|
args:
|
||||||
- "--metrics-addr=127.0.0.1:8080"
|
- "--metrics-addr=127.0.0.1:8080"
|
||||||
|
4
deployments/operator/kustomization.yaml
Normal file
4
deployments/operator/kustomization.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
bases:
|
||||||
|
- default
|
||||||
|
- manager
|
||||||
|
- webhook
|
@ -38,6 +38,7 @@ spec:
|
|||||||
runAsUser: 65532
|
runAsUser: 65532
|
||||||
runAsGroup: 65532
|
runAsGroup: 65532
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
env:
|
env:
|
||||||
- name: DEVICEPLUGIN_NAMESPACE
|
- name: DEVICEPLUGIN_NAMESPACE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
@ -27,6 +27,7 @@ spec:
|
|||||||
hugepages-2Mi: "128Mi"
|
hugepages-2Mi: "128Mi"
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
capabilities:
|
capabilities:
|
||||||
add:
|
add:
|
||||||
["IPC_LOCK"]
|
["IPC_LOCK"]
|
||||||
|
2
deployments/qat_dpdk_app/kustomization.yaml
Normal file
2
deployments/qat_dpdk_app/kustomization.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bases:
|
||||||
|
- base
|
@ -17,6 +17,7 @@ spec:
|
|||||||
- name: intel-qat-kernel-plugin
|
- name: intel-qat-kernel-plugin
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
privileged: true
|
privileged: true
|
||||||
image: intel/intel-qat-plugin:devel
|
image: intel/intel-qat-plugin:devel
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
|
@ -18,6 +18,7 @@ spec:
|
|||||||
image: intel/intel-qat-plugin:devel
|
image: intel/intel-qat-plugin:devel
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: devdir
|
- name: devdir
|
||||||
|
2
deployments/sgx_admissionwebhook/kustomization.yaml
Normal file
2
deployments/sgx_admissionwebhook/kustomization.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bases:
|
||||||
|
- base
|
@ -24,6 +24,7 @@ spec:
|
|||||||
runAsUser: 65532
|
runAsUser: 65532
|
||||||
runAsGroup: 65532
|
runAsGroup: 65532
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
@ -21,6 +21,7 @@ spec:
|
|||||||
image: intel/sgx-aesmd-demo:devel
|
image: intel/sgx-aesmd-demo:devel
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
sgx.intel.com/epc: "1Mi"
|
sgx.intel.com/epc: "1Mi"
|
||||||
|
@ -20,6 +20,7 @@ spec:
|
|||||||
command: ["/opt/intel/sgx-sample-app/sgx-sample-app"]
|
command: ["/opt/intel/sgx-sample-app/sgx-sample-app"]
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
capabilities:
|
capabilities:
|
||||||
add: ["IPC_LOCK"]
|
add: ["IPC_LOCK"]
|
||||||
resources:
|
resources:
|
||||||
|
2
deployments/sgx_enclave_apps/kustomization.yaml
Normal file
2
deployments/sgx_enclave_apps/kustomization.yaml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
bases:
|
||||||
|
- base
|
@ -18,6 +18,7 @@ spec:
|
|||||||
image: intel/intel-sgx-plugin:devel
|
image: intel/intel-sgx-plugin:devel
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: kubeletsockets
|
- name: kubeletsockets
|
||||||
|
@ -11,6 +11,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /etc/kubernetes/node-feature-discovery/source.d/
|
- mountPath: /etc/kubernetes/node-feature-discovery/source.d/
|
||||||
name: nfd-source-hooks
|
name: nfd-source-hooks
|
||||||
|
@ -11,6 +11,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /etc/kubernetes/node-feature-discovery/source.d/
|
- mountPath: /etc/kubernetes/node-feature-discovery/source.d/
|
||||||
name: nfd-source-hooks
|
name: nfd-source-hooks
|
||||||
|
@ -24,6 +24,7 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
readOnlyRootFilesystem: true
|
readOnlyRootFilesystem: true
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: devion
|
- name: devion
|
||||||
mountPath: /dev/ion
|
mountPath: /dev/ion
|
||||||
|
@ -33,6 +33,7 @@ const appLabel = "intel-dlb-plugin"
|
|||||||
func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet {
|
func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet {
|
||||||
devicePlugin := rawObj.(*devicepluginv1.DlbDevicePlugin)
|
devicePlugin := rawObj.(*devicepluginv1.DlbDevicePlugin)
|
||||||
yes := true
|
yes := true
|
||||||
|
no := false
|
||||||
|
|
||||||
daemonSet := apps.DaemonSet{
|
daemonSet := apps.DaemonSet{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
@ -77,7 +78,8 @@ 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{
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
|
AllowPrivilegeEscalation: &no,
|
||||||
},
|
},
|
||||||
VolumeMounts: []v1.VolumeMount{
|
VolumeMounts: []v1.VolumeMount{
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,7 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
|
|||||||
devicePlugin := rawObj.(*devicepluginv1.DsaDevicePlugin)
|
devicePlugin := rawObj.(*devicepluginv1.DsaDevicePlugin)
|
||||||
|
|
||||||
yes := true
|
yes := true
|
||||||
|
no := false
|
||||||
daemonSet := apps.DaemonSet{
|
daemonSet := apps.DaemonSet{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "DaemonSet",
|
Kind: "DaemonSet",
|
||||||
@ -77,7 +78,8 @@ 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{
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
|
AllowPrivilegeEscalation: &no,
|
||||||
},
|
},
|
||||||
VolumeMounts: []v1.VolumeMount{
|
VolumeMounts: []v1.VolumeMount{
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,7 @@ const appLabel = "intel-fpga-plugin"
|
|||||||
func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet {
|
func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet {
|
||||||
devicePlugin := rawObj.(*devicepluginv1.FpgaDevicePlugin)
|
devicePlugin := rawObj.(*devicepluginv1.FpgaDevicePlugin)
|
||||||
yes := true
|
yes := true
|
||||||
|
no := false
|
||||||
directoryOrCreate := v1.HostPathDirectoryOrCreate
|
directoryOrCreate := v1.HostPathDirectoryOrCreate
|
||||||
|
|
||||||
return &apps.DaemonSet{
|
return &apps.DaemonSet{
|
||||||
@ -79,7 +80,8 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
|
|||||||
ImagePullPolicy: "IfNotPresent",
|
ImagePullPolicy: "IfNotPresent",
|
||||||
Name: appLabel,
|
Name: appLabel,
|
||||||
SecurityContext: &v1.SecurityContext{
|
SecurityContext: &v1.SecurityContext{
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
|
AllowPrivilegeEscalation: &no,
|
||||||
},
|
},
|
||||||
TerminationMessagePath: "/tmp/termination-log",
|
TerminationMessagePath: "/tmp/termination-log",
|
||||||
VolumeMounts: []v1.VolumeMount{
|
VolumeMounts: []v1.VolumeMount{
|
||||||
@ -106,7 +108,8 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
|
|||||||
ImagePullPolicy: "IfNotPresent",
|
ImagePullPolicy: "IfNotPresent",
|
||||||
Name: "intel-fpga-initcontainer",
|
Name: "intel-fpga-initcontainer",
|
||||||
SecurityContext: &v1.SecurityContext{
|
SecurityContext: &v1.SecurityContext{
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
|
AllowPrivilegeEscalation: &no,
|
||||||
},
|
},
|
||||||
VolumeMounts: []v1.VolumeMount{
|
VolumeMounts: []v1.VolumeMount{
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,7 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
|
|||||||
devicePlugin := rawObj.(*devicepluginv1.GpuDevicePlugin)
|
devicePlugin := rawObj.(*devicepluginv1.GpuDevicePlugin)
|
||||||
|
|
||||||
yes := true
|
yes := true
|
||||||
|
no := false
|
||||||
daemonSet := apps.DaemonSet{
|
daemonSet := apps.DaemonSet{
|
||||||
TypeMeta: metav1.TypeMeta{
|
TypeMeta: metav1.TypeMeta{
|
||||||
Kind: "DaemonSet",
|
Kind: "DaemonSet",
|
||||||
@ -78,7 +79,8 @@ 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{
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
|
AllowPrivilegeEscalation: &no,
|
||||||
},
|
},
|
||||||
VolumeMounts: []v1.VolumeMount{
|
VolumeMounts: []v1.VolumeMount{
|
||||||
{
|
{
|
||||||
|
@ -35,6 +35,7 @@ const appLabel = "intel-qat-plugin"
|
|||||||
func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet {
|
func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet {
|
||||||
devicePlugin := rawObj.(*devicepluginv1.QatDevicePlugin)
|
devicePlugin := rawObj.(*devicepluginv1.QatDevicePlugin)
|
||||||
yes := true
|
yes := true
|
||||||
|
no := false
|
||||||
pluginAnnotations := devicePlugin.ObjectMeta.DeepCopy().Annotations
|
pluginAnnotations := devicePlugin.ObjectMeta.DeepCopy().Annotations
|
||||||
|
|
||||||
return &apps.DaemonSet{
|
return &apps.DaemonSet{
|
||||||
@ -71,7 +72,8 @@ 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{
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
|
AllowPrivilegeEscalation: &no,
|
||||||
},
|
},
|
||||||
VolumeMounts: []v1.VolumeMount{
|
VolumeMounts: []v1.VolumeMount{
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,7 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
|
|||||||
devicePlugin := rawObj.(*devicepluginv1.SgxDevicePlugin)
|
devicePlugin := rawObj.(*devicepluginv1.SgxDevicePlugin)
|
||||||
|
|
||||||
yes := true
|
yes := true
|
||||||
|
no := false
|
||||||
charDevice := v1.HostPathCharDev
|
charDevice := v1.HostPathCharDev
|
||||||
directoryOrCreate := v1.HostPathDirectoryOrCreate
|
directoryOrCreate := v1.HostPathDirectoryOrCreate
|
||||||
daemonSet := apps.DaemonSet{
|
daemonSet := apps.DaemonSet{
|
||||||
@ -70,7 +71,8 @@ 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{
|
||||||
ReadOnlyRootFilesystem: &yes,
|
ReadOnlyRootFilesystem: &yes,
|
||||||
|
AllowPrivilegeEscalation: &no,
|
||||||
},
|
},
|
||||||
VolumeMounts: []v1.VolumeMount{
|
VolumeMounts: []v1.VolumeMount{
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user