Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,3 @@ kind-image: image-build

# The main release target, which pushes all images and helm charts.
release: image-push helm-push


21 changes: 19 additions & 2 deletions deployments/helm/dranet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions deployments/helm/dranet/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -132,3 +146,7 @@ spec:
- name: bpf-programs
hostPath:
path: /sys/fs/bpf
- name: dranet-run
hostPath:
path: /var/run/dranet
type: DirectoryOrCreate
4 changes: 4 additions & 0 deletions deployments/helm/dranet/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
74 changes: 71 additions & 3 deletions deployments/helm/dranet/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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)$",
Expand All @@ -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"
Expand Down Expand Up @@ -119,7 +184,10 @@
"additionalProperties": false,
"properties": {
"annotations": {
"type": "object"
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion deployments/helm/dranet/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <kubeletRootDir>/plugins_registry (which the
Expand Down
Loading