From dbc84b500b250d0b2e633fa7aa4c156e6d8b7758 Mon Sep 17 00:00:00 2001 From: Oguz Pastirmaci Date: Fri, 7 Aug 2026 15:37:49 -0700 Subject: [PATCH] Update DRANET Helm chart --- Makefile | 2 - deployments/helm/dranet/README.md | 21 +++++- .../helm/dranet/templates/daemonset.yaml | 18 +++++ .../helm/dranet/templates/serviceaccount.yaml | 4 + deployments/helm/dranet/values.schema.json | 74 ++++++++++++++++++- deployments/helm/dranet/values.yaml | 6 +- 6 files changed, 117 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index bfcadf3e..a04f2e5b 100644 --- a/Makefile +++ b/Makefile @@ -131,5 +131,3 @@ kind-image: image-build # The main release target, which pushes all images and helm charts. release: image-push helm-push - - diff --git a/deployments/helm/dranet/README.md b/deployments/helm/dranet/README.md index 866b85ba..0b6f7679 100644 --- a/deployments/helm/dranet/README.md +++ b/deployments/helm/dranet/README.md @@ -25,21 +25,38 @@ The following table lists the configurable parameters and their default values: | `podLabels` | Labels to add to pods | `{}` | | `logVerbosity` | Log verbosity level | `4` | | `metricsPort` | Port for the metrics/healthz server and readiness probe | binary default: `9177` | -| `metricsPath` | HTTP path for the readiness probe | `/healthz` | +| `metricsPath` | HTTP path for the startup and readiness probes | `/healthz` | | `tolerations` | Pod tolerations | `[{operator: Exists, effect: NoSchedule}]` | | `resources.requests.cpu` | CPU resource request | `100m` | | `resources.requests.memory` | Memory resource request | `50Mi` | | `resources.limits.cpu` | CPU resource limit | `""` (not set) | | `resources.limits.memory` | Memory resource limit | `""` (not set) | +| `serviceAccount.annotations` | Annotations to add to the service account | `{}` | | `args.filter` | CEL expression to filter network interface attributes | see binary default | +| `args.dbPath` | Persistent bbolt database path; set to `""` to use in-memory state | binary default: `/var/run/dranet/dranet.db` | | `args.inventoryMinPollInterval` | Minimum interval between two consecutive inventory polls | binary default: `2s` | | `args.inventoryMaxPollInterval` | Maximum interval between two consecutive inventory polls | binary default: `1m` | | `args.inventoryPollBurst` | Number of inventory polls that can be run in a burst | binary default: `5` | | `args.moveIBInterfaces` | If true, InfiniBand (IPoIB) interfaces are moved into the pod network namespace | binary default: `true` | -| `args.cloudProviderHint` | Hint for the cloud provider plugin (`GCE`, `AZURE`, `OKE`, `NONE`); auto-detected if unset | binary default: `""` | +| `args.cloudProviderHint` | Hint for the cloud provider plugin (`GCE`, `AZURE`, `OKE`, `AWS`, `ALIBABA`, `webhook`, `NONE`); auto-detected if unset | binary default: `""` | +| `args.profileProvider` | Provider for user profile configuration (`cloud`, `webhook`, `none`) | binary default: `cloud` | +| `args.webhookURL` | HTTP, HTTPS, or Unix socket URL; required when either provider uses `webhook` | binary default: `""` | +| `args.featureGates` | Comma-separated feature gate settings in `key=value` format | binary default: `""` | > **Note:** All `args.*` fields are optional. When omitted, the flag is not passed to the binary and the binary's built-in default applies. +The chart mounts `/var/run/dranet` from the host so the default database survives +DRANET pod replacement. Custom database paths must be placed under that directory +to remain persistent. Set `args.dbPath` to an empty string to use in-memory state. + +When upgrading from a chart that does not mount `/var/run/dranet`, the existing +container-local database cannot be copied into the new host path. Before the first +upgrade that enables this mount, stop workloads that use DRANET-managed devices. +After the upgrade, restart those workloads. + +When `args.profileProvider` or `args.cloudProviderHint` is `webhook`, set +`args.webhookURL` to the webhook endpoint. + Parameters can be set at install time using `--set` or a custom values file: ```sh diff --git a/deployments/helm/dranet/templates/daemonset.yaml b/deployments/helm/dranet/templates/daemonset.yaml index 4ba7df9b..9c1fc44b 100644 --- a/deployments/helm/dranet/templates/daemonset.yaml +++ b/deployments/helm/dranet/templates/daemonset.yaml @@ -57,6 +57,9 @@ spec: {{- if .Values.args.filter }} - {{ print "--filter=" .Values.args.filter | quote }} {{- end }} + {{- if (hasKey .Values.args "dbPath") }} + - {{ printf "--db-path=%s" .Values.args.dbPath | quote }} + {{- end }} {{- if .Values.args.inventoryMinPollInterval }} - --inventory-min-poll-interval={{ .Values.args.inventoryMinPollInterval }} {{- end }} @@ -72,6 +75,15 @@ spec: {{- if .Values.args.cloudProviderHint }} - --cloud-provider-hint={{ .Values.args.cloudProviderHint }} {{- end }} + {{- if (hasKey .Values.args "profileProvider") }} + - {{ printf "--profile-provider=%s" .Values.args.profileProvider | quote }} + {{- end }} + {{- if (hasKey .Values.args "webhookURL") }} + - {{ printf "--webhook-url=%s" .Values.args.webhookURL | quote }} + {{- end }} + {{- if (hasKey .Values.args "featureGates") }} + - {{ printf "--feature-gates=%s" .Values.args.featureGates | quote }} + {{- end }} - --kubelet-root-dir={{ .Values.kubeletRootDir }} env: - name: NODE_NAME @@ -113,6 +125,8 @@ spec: - name: bpf-programs mountPath: /sys/fs/bpf mountPropagation: HostToContainer + - name: dranet-run + mountPath: /var/run/dranet volumes: - name: device-plugin hostPath: @@ -132,3 +146,7 @@ spec: - name: bpf-programs hostPath: path: /sys/fs/bpf + - name: dranet-run + hostPath: + path: /var/run/dranet + type: DirectoryOrCreate diff --git a/deployments/helm/dranet/templates/serviceaccount.yaml b/deployments/helm/dranet/templates/serviceaccount.yaml index 22ac568e..0e3a5de4 100644 --- a/deployments/helm/dranet/templates/serviceaccount.yaml +++ b/deployments/helm/dranet/templates/serviceaccount.yaml @@ -3,5 +3,9 @@ kind: ServiceAccount metadata: name: {{ include "dranet.serviceAccountName" . }} namespace: {{ .Release.Namespace }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} labels: {{- include "dranet.labels" . | nindent 4 }} diff --git a/deployments/helm/dranet/values.schema.json b/deployments/helm/dranet/values.schema.json index 9e1ce10b..62c8dabc 100644 --- a/deployments/helm/dranet/values.schema.json +++ b/deployments/helm/dranet/values.schema.json @@ -67,6 +67,20 @@ "type": "string", "description": "CEL expression to filter network interface attributes" }, + "dbPath": { + "type": "string", + "description": "Persistent bbolt database path under /var/run/dranet; set to an empty string to use in-memory state", + "allOf": [ + { + "pattern": "^$|^/var/run/dranet/.+" + }, + { + "not": { + "pattern": "(^|/)\\.\\.?(/|$)" + } + } + ] + }, "inventoryMinPollInterval": { "type": "string", "pattern": "^[0-9]+(ns|us|ms|s|m|h)$", @@ -86,10 +100,61 @@ }, "cloudProviderHint": { "type": "string", - "enum": ["GCE", "AZURE", "OKE", "AWS", "ALIBABA", "NONE"], + "enum": ["GCE", "AZURE", "OKE", "AWS", "ALIBABA", "webhook", "NONE"], "description": "Hint for the cloud provider plugin; auto-detected if unset" + }, + "profileProvider": { + "type": "string", + "enum": ["cloud", "webhook", "none"], + "description": "Provider for user profile configuration" + }, + "webhookURL": { + "type": "string", + "description": "HTTP, HTTPS, or Unix socket URL for cloud and profile webhook providers" + }, + "featureGates": { + "type": "string", + "description": "Comma-separated feature gate settings in key=value format" } - } + }, + "allOf": [ + { + "if": { + "properties": { + "cloudProviderHint": { + "const": "webhook" + } + }, + "required": ["cloudProviderHint"] + }, + "then": { + "properties": { + "webhookURL": { + "minLength": 1 + } + }, + "required": ["webhookURL"] + } + }, + { + "if": { + "properties": { + "profileProvider": { + "const": "webhook" + } + }, + "required": ["profileProvider"] + }, + "then": { + "properties": { + "webhookURL": { + "minLength": 1 + } + }, + "required": ["webhookURL"] + } + } + ] }, "nodeSelector": { "type": "object" @@ -119,7 +184,10 @@ "additionalProperties": false, "properties": { "annotations": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "string" + } } } } diff --git a/deployments/helm/dranet/values.yaml b/deployments/helm/dranet/values.yaml index 84ecf6cb..ddf26ba6 100644 --- a/deployments/helm/dranet/values.yaml +++ b/deployments/helm/dranet/values.yaml @@ -19,14 +19,18 @@ logVerbosity: 4 metricsPort: ~ metricsPath: /healthz -# dranet daemon arguments — omit any field to use the binary's built-in default +# DRANET daemon arguments. Omit a field to use the binary's built-in default. args: {} # filter: '!("dra.net/type" in attributes) || attributes["dra.net/type"].StringValue != "veth"' +# dbPath: "/var/run/dranet/dranet.db" # inventoryMinPollInterval: "2s" # inventoryMaxPollInterval: "1m" # inventoryPollBurst: 5 # moveIBInterfaces: true # cloudProviderHint: "" +# profileProvider: "cloud" +# webhookURL: "" +# featureGates: "" # kubeletRootDir is the kubelet data directory (its --root-dir). The driver's # registration socket lives under /plugins_registry (which the