Skip to content

Commit 86eed79

Browse files
authored
add qat resource driver chart (#65)
* add qat resource driver chart Signed-off-by: Oksana Baranova <[email protected]>
1 parent db4b7d8 commit 86eed79

14 files changed

+328
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: v2
2+
name: intel-qat-resource-driver
3+
description: A Helm chart for a Dynamic Resource Allocation (DRA) Intel QAT Resource Driver
4+
5+
type: application
6+
version: 0.1.0
7+
appVersion: "v0.1.0"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Copyright 2024 Intel Corporation
2+
SPDX-License-Identifier: Apache-2.0
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Dynamic Resource Allocation (DRA) Intel QAT Driver Helm Chart
2+
3+
## The chart installs QAT resource driver:
4+
5+
- [QAT](https://github.com/intel/intel-resource-drivers-for-kubernetes/tree/main/doc/qat/README.md)
6+
7+
More info: [Intel Resource Drivers for Kubernetes](https://github.com/intel/intel-resource-drivers-for-kubernetes/tree/main)
8+
9+
10+
## Get Helm Repository Info
11+
```
12+
helm repo add intel https://intel.github.io/helm-charts/
13+
helm repo update
14+
```
15+
16+
You can execute `helm search repo intel` command to see pulled charts [optional].
17+
18+
## Install Helm Chart
19+
```
20+
helm install intel-qat-resource-driver intel/intel-qat-resource-driver
21+
```
22+
## Upgrade Chart
23+
```
24+
helm upgrade intel-qat-resource-driver intel/intel-qat-resource-driver [flags]
25+
```
26+
27+
## Uninstall Chart
28+
```
29+
helm uninstall intel-qat-resource-driver --namespace intel-qat-resource-driver
30+
```
31+
32+
## Configuration
33+
See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments:
34+
35+
```console
36+
helm show values intel/intel-qat-resource-driver
37+
```
38+
39+
You may also run `helm show values` on this chart's dependencies for additional options.
40+
41+
| Key | Type | Default |
42+
|-----|------|---------|
43+
| image.repository | string | `intel` |
44+
| image.name | string | `"intel-qat-resource-driver"` |
45+
| image.pullPolicy | string | `"IfNotPresent"` |
46+
| image.tag | string | `"v0.1.0"` |
47+
48+
If you change the image tag to be used in Helm chart deployment, ensure that the version of the container image is consistent with deployment YAMLs - they might change between releases.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Thank you for installing {{ .Chart.Name }}.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{/* Define common helpers */}}
2+
{{- define "intel-qat-resource-driver.chart" -}}
3+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
4+
{{- end }}
5+
6+
{{/* Define the base name for the driver */}}
7+
{{- define "intel-qat-resource-driver.baseName" -}}
8+
intel-qat-resource-driver
9+
{{- end }}
10+
11+
{{- define "intel-qat-resource-driver.name" -}}
12+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
13+
{{- end }}
14+
15+
{{- define "intel-qat-resource-driver.fullname" -}}
16+
{{- if .Values.fullnameOverride -}}
17+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
18+
{{- else -}}
19+
{{- printf "%s-%s" (include "intel-qat-resource-driver.baseName" .) .Release.Name | trunc 63 | trimSuffix "-" -}}
20+
{{- end -}}
21+
{{- end }}
22+
23+
{{- define "intel-qat-resource-driver.namespace" -}}
24+
{{- default .Release.Namespace .Values.namespaceOverride }}
25+
{{- end }}
26+
27+
{{/* Labels for templates */}}
28+
{{- define "intel-qat-resource-driver.labels" -}}
29+
helm.sh/chart: {{ include "intel-qat-resource-driver.chart" . }}
30+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
31+
app.kubernetes.io/managed-by: {{ .Release.Service }}
32+
{{- end }}
33+
34+
{{- define "intel-qat-resource-driver.clusterRoleName" -}}
35+
{{- printf "%s-role" (include "intel-qat-resource-driver.baseName" .) | trunc 63 | trimSuffix "-" }}
36+
{{- end }}
37+
38+
{{- define "intel-qat-resource-driver.clusterRoleBindingName" -}}
39+
{{- printf "%s-rolebinding" (include "intel-qat-resource-driver.baseName" .) | trunc 63 | trimSuffix "-" }}
40+
{{- end }}
41+
42+
{{- define "intel-qat-resource-driver.serviceAccountName" -}}
43+
{{- if .Values.serviceAccount.create -}}
44+
{{- default "intel-qat-sa" .Values.serviceAccount.name -}}
45+
{{- end -}}
46+
{{- end }}
47+
48+
{{/* Define full image name */}}
49+
{{- define "intel-qat-resource-driver.fullimage" -}}
50+
{{- printf "%s/%s:%s" .Values.image.repository .Values.image.name .Values.image.tag -}}
51+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
name: {{ include "intel-qat-resource-driver.clusterRoleName" . }}
5+
namespace: {{ include "intel-qat-resource-driver.namespace" . }}
6+
rules:
7+
- apiGroups: [""]
8+
resources: ["nodes"]
9+
verbs: ["get"]
10+
- apiGroups: ["resource.k8s.io"]
11+
resources: ["resourceslices"]
12+
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
13+
- apiGroups: ["resource.k8s.io"]
14+
resources: ["resourceclaims"]
15+
verbs: ["get"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
name: {{ include "intel-qat-resource-driver.clusterRoleBindingName" . }}
5+
namespace: {{ include "intel-qat-resource-driver.namespace" . }}
6+
subjects:
7+
- kind: ServiceAccount
8+
name: {{ include "intel-qat-resource-driver.serviceAccountName" . }}
9+
namespace: {{ include "intel-qat-resource-driver.namespace" . }}
10+
roleRef:
11+
kind: ClusterRole
12+
name: {{ include "intel-qat-resource-driver.clusterRoleName" . }}
13+
apiGroup: rbac.authorization.k8s.io
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: resource.k8s.io/v1alpha3
2+
kind: DeviceClass
3+
metadata:
4+
name: qat.intel.com
5+
6+
spec:
7+
selectors:
8+
- cel:
9+
expression: device.driver == "qat.intel.com"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: intel-qat-resource-driver
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
name: intel-qat-resource-driver-kubelet-plugin
5+
namespace: {{ include "intel-qat-resource-driver.namespace" . }}
6+
labels:
7+
{{- include "intel-qat-resource-driver.labels" . | nindent 4 }}
8+
spec:
9+
selector:
10+
matchLabels:
11+
app: intel-qat-resource-driver
12+
template:
13+
metadata:
14+
labels:
15+
app: intel-qat-resource-driver
16+
spec:
17+
serviceAccount: intel-qat-resource-driver-service-account
18+
serviceAccountName: {{ include "intel-qat-resource-driver.serviceAccountName" . }}
19+
containers:
20+
- name: kubelet-plugin
21+
image: {{ include "intel-qat-resource-driver.fullimage" . }}
22+
imagePullPolicy: {{ .Values.image.pullPolicy }}
23+
command: ["/kubelet-qat-plugin"]
24+
env:
25+
- name: NODE_NAME
26+
valueFrom:
27+
fieldRef:
28+
fieldPath: spec.nodeName
29+
- name: POD_NAMESPACE
30+
valueFrom:
31+
fieldRef:
32+
fieldPath: metadata.namespace
33+
- name: SYSFS_ROOT
34+
value: "/sysfs"
35+
volumeMounts:
36+
- name: plugins-registry
37+
mountPath: /var/lib/kubelet/plugins_registry
38+
- name: plugins
39+
mountPath: /var/lib/kubelet/plugins
40+
- name: cdi
41+
mountPath: /etc/cdi
42+
- name: varruncdi
43+
mountPath: /var/run/cdi
44+
- name: sysfs
45+
mountPath: /sysfs
46+
- name: qatconfiguration
47+
mountPath: /defaults
48+
securityContext:
49+
privileged: true
50+
readOnlyRootFilesystem: true
51+
seccompProfile:
52+
type: RuntimeDefault
53+
volumes:
54+
- name: plugins-registry
55+
hostPath:
56+
path: /var/lib/kubelet/plugins_registry
57+
- name: plugins
58+
hostPath:
59+
path: /var/lib/kubelet/plugins
60+
- name: cdi
61+
hostPath:
62+
path: /etc/cdi
63+
- name: varruncdi
64+
hostPath:
65+
path: /var/run/cdi
66+
- name: sysfs
67+
hostPath:
68+
path: /sys
69+
- name: qatconfiguration
70+
configMap:
71+
name: intel-qat-resource-driver-configuration
72+
optional: true
73+
{{- with .Values.kubeletPlugin.tolerations }}
74+
tolerations:
75+
{{- toYaml . | nindent 8 }}
76+
{{- end }}
77+
{{- with .Values.kubeletPlugin.nodeSelector }}
78+
nodeSelector:
79+
{{- toYaml . | nindent 8 }}
80+
{{- end }}
81+
{{- with .Values.kubeletPlugin.affinity }}
82+
affinity:
83+
{{- toYaml . | nindent 8 }}
84+
{{- end }}

0 commit comments

Comments
 (0)