Skip to content

Commit 0c37ec5

Browse files
committed
qat: Document AppArmor anntotation configurability in operatop deployments
Signed-off-by: Oleg Zhurakivskyy <[email protected]>
1 parent f9bc72f commit 0c37ec5

File tree

4 files changed

+16
-4
lines changed

4 files changed

+16
-4
lines changed

cmd/qat_plugin/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ When using the operator for deploying the plugin with provisioning config, use `
148148

149149
There's also a possibility for a node specific congfiguration through passing a nodename via `NODE_NAME` into initcontainer's environment and passing a node specific profile (`qat-$NODE_NAME.conf`) via ConfigMap volume mount.
150150

151+
CR annotations in [deviceplugin_v1_qatdeviceplugin.yaml](../../deployments/operator/samples/deviceplugin_v1_qatdeviceplugin.yaml) propagate to the DaemonSet annotations. In case AppArmor "unconfined" annotation needs to be dropped in the operator deployments (enabled by default), manually drop it from the CR sample.
152+
153+
For non-operator plugin deployments such annotations can be dropped with the kustomization if required.
151154

152155
### Verify Plugin Registration
153156

deployments/operator/samples/deviceplugin_v1_qatdeviceplugin.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ apiVersion: deviceplugin.intel.com/v1
22
kind: QatDevicePlugin
33
metadata:
44
name: qatdeviceplugin-sample
5-
# example apparmor annotation
6-
# see more details here:
5+
annotations:
6+
container.apparmor.security.beta.kubernetes.io/intel-qat-plugin: unconfined
7+
# see more details on AppArmor here:
78
# - https://kubernetes.io/docs/tutorials/clusters/apparmor/#securing-a-pod
89
# - https://github.com/intel/intel-device-plugins-for-kubernetes/issues/381
9-
# annotations:
10-
# container.apparmor.security.beta.kubernetes.io/intel-qat-plugin: unconfined
1110
spec:
1211
image: intel/intel-qat-plugin:0.28.0
1312
initImage: intel/intel-qat-initcontainer:0.28.0

deployments/qat_plugin/base/intel-qat-plugin.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ metadata:
44
name: intel-qat-plugin
55
labels:
66
app: intel-qat-plugin
7+
annotations:
8+
container.apparmor.security.beta.kubernetes.io/intel-qat-plugin: unconfined
79
spec:
810
selector:
911
matchLabels:
@@ -12,6 +14,8 @@ spec:
1214
metadata:
1315
labels:
1416
app: intel-qat-plugin
17+
annotations:
18+
container.apparmor.security.beta.kubernetes.io/intel-qat-plugin: unconfined
1519
spec:
1620
automountServiceAccountToken: false
1721
containers:

pkg/controllers/qat/controller_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ func (c *controller) newDaemonSetExpected(rawObj client.Object) *apps.DaemonSet
3939
no := false
4040
pluginAnnotations := devicePlugin.ObjectMeta.DeepCopy().Annotations
4141

42+
if pluginAnnotations == nil {
43+
pluginAnnotations = make(map[string]string)
44+
}
45+
46+
pluginAnnotations["container.apparmor.security.beta.kubernetes.io/intel-qat-plugin"] = "unconfined"
47+
4248
daemonSet := apps.DaemonSet{
4349
TypeMeta: metav1.TypeMeta{
4450
Kind: "DaemonSet",

0 commit comments

Comments
 (0)