ClamAV Operator Helm Chart
Helm chart for deploying the ClamAV Operator — a Kubernetes operator for cluster-wide antivirus scanning using ClamAV. Supports standalone (embedded signatures) and remote clamd modes, incremental scanning, Prometheus monitoring, and scheduled scans.
CRDs Installed
| CRD | Description |
nodescans.clamav.io | Scan a single node |
clusterscans.clamav.io | Scan all (or selected) nodes |
scanpolicies.clamav.io | Reusable scan configuration |
scanschedules.clamav.io | Cron-based scheduled scanning |
scancacheresources.clamav.io | Incremental scan state cache |
Prerequisites
- Kubernetes 1.24+
- Helm 3.0+
- No external ClamAV service required (standalone mode is the default)
- cert-manager (optional, but strongly recommended for production webhook TLS — see Webhook TLS)
Installation
Install from local sources
# Create namespace and install (standalone mode by default)
helm install clamav-operator ./helm/clamav-operator \
--namespace clamav-system \
--create-namespace
# Install with custom values
helm install clamav-operator ./helm/clamav-operator \
--namespace clamav-system \
--create-namespace \
--values my-values.yaml
# Install with inline parameters
helm install clamav-operator ./helm/clamav-operator \
--namespace clamav-system \
--create-namespace \
--set scanner.mode=standalone \
--set scanner.freshclam.enabled=true
Configuration
Operator Parameters
| Parameter | Description | Default |
operator.replicaCount | Number of operator replicas | 1 |
operator.image.repository | Operator image repository | ghcr.io/solucteam/clamav-operator |
operator.image.tag | Operator image tag | "" (chart version) |
operator.resources.limits.cpu | Operator CPU limit | 500m |
operator.resources.limits.memory | Operator memory limit | 256Mi |
Scanner Parameters
| Parameter | Description | Default |
scanner.image.repository | Scanner image repository | ghcr.io/solucteam/clamav-node-scanner |
scanner.image.tag | Scanner image tag | "" (chart appVersion) |
scanner.mode | Scan mode: standalone or remote | standalone |
scanner.resources.requests.cpu | Scanner CPU request | 500m |
scanner.resources.requests.memory | Scanner memory request | 512Mi |
scanner.resources.limits.cpu | Scanner CPU limit | 2000m |
scanner.resources.limits.memory | Scanner memory limit | 1Gi |
Scanner Standalone Parameters
| Parameter | Description | Default |
scanner.standalone.clamscanPath | Path to clamscan binary | /usr/bin/clamscan |
scanner.standalone.clamavDbPath | Path to signature database | /var/lib/clamav |
Scanner Remote Parameters (Legacy)
| Parameter | Description | Default |
scanner.clamav.host | ClamAV service host | clamav.clamav.svc.cluster.local |
scanner.clamav.port | ClamAV service port | 3310 |
Freshclam Parameters
| Parameter | Description | Default |
scanner.freshclam.enabled | Enable the freshclam signature-update CronJob | true |
scanner.freshclam.schedule | Cron schedule for updates | 0 */6 * * * |
scanner.freshclam.image.repository | Freshclam image | clamav/clamav |
scanner.freshclam.image.tag | Freshclam image tag | 1.3 |
scanner.freshclam.resources.limits.cpu | Freshclam CPU limit | 500m |
scanner.freshclam.resources.limits.memory | Freshclam memory limit | 256Mi |
Standalone mode limitation: In standalone mode, the freshclam CronJob writes signatures to its own volume (emptyDir or PVC). Scanner job pods do not mount that volume — they read signatures from CLAMAV_DB_PATH inside the scanner container image. Enabling freshclam therefore has no effect on what scanner jobs scan with in standalone mode. Signatures must be baked into the scanner image at build time. The freshclam CronJob is only effective in remote mode, where it shares a PVC with the running clamd daemon.
Signature Persistence Parameters
| Parameter | Description | Default |
scanner.signatures.persistent | Use a PVC for signatures | false |
scanner.signatures.pvcName | PVC name | clamav-signatures |
scanner.signatures.storageClass | StorageClass (empty = default) | "" |
scanner.signatures.accessMode | PVC access mode. Use ReadWriteMany for multi-node signature sharing (requires NFS/CephFS/EFS/…). ReadWriteOnce only works if all scanner pods land on the same node as freshclam. | ReadWriteOnce |
scanner.signatures.size | PVC size | 1Gi |
ReadWriteMany is required when signatures.persistent=true. Scanner jobs run on different nodes; a ReadWriteOnce PVC can only be mounted by pods on the single node where it is bound — all other scanner pods fail with "Multi-Attach error". RWX requires a storage backend that supports it: NFS, CephFS, Azure Files, AWS EFS, GCP Filestore. Standard block storage (EBS, GCP Persistent Disk) does not support RWX — use the image-embedded approach instead (persistent: false).
Registry Signature Parameters
| Parameter | Description | Default |
scanner.signature.source | Signature delivery: image (baked-in, default) or registry (pull CVDs at boot) | image |
scanner.signature.registryURL | Registry v2 base URL (e.g. Harbor) | "" |
scanner.signature.refs | Comma-separated artifact refs (Harbor project included) | "" |
scanner.signature.existingSecret | Secret with registry credentials (keys username/password) | "" |
scanner.signature.caSecret.name | Secret holding the registry TLS CA bundle (private CA). Scanner Job pods mount it and receive NODE_EXTRA_CA_CERTS. | "" |
scanner.signature.caSecret.key | Secret data key holding the PEM bundle | ca.crt |
Private CA: when the registry certificate is signed by a private CA (e.g. internal Harbor), set caSecret.name to a Secret containing the PEM bundle. Scanner Job pods mount it and get NODE_EXTRA_CA_CERTS pointing at the mounted file — Node's fetch (undici) trusts the private CA natively, no scanner-side change needed. The image-baked signatures remain the automatic fallback if the pull fails.
Incremental Scan Parameters
| Parameter | Description | Default |
scanner.incremental.enabled | Enable incremental scanning | true |
scanner.incremental.strategy | Strategy: full, incremental, smart | smart |
scanner.incremental.fullScanInterval | Full scan every N incremental runs (smart) | 10 |
scanner.incremental.maxFileAgeHours | Max file age for incremental scans | 24 |
scanner.incremental.skipUnchangedFiles | Skip files with same mtime+size | true |
Automatic cache invalidation on signature update (v3 cache format): The scanner computes a fingerprint of all .cvd/.cld files in CLAMAV_DB_PATH (mtime + size). This fingerprint is stored with the cache. If signatures have been updated since the last scan, the fingerprint differs and the incremental cache is automatically discarded — forcing a full scan on the next run. This guarantees that every file is re-evaluated against the new signatures, even files whose content and metadata are unchanged. No manual cache deletion is required after a freshclam update.
Webhook & TLS Parameters
| Parameter | Description | Default |
webhook.enabled | Enable admission + conversion webhooks | true |
webhook.port | Webhook server port (synced to --webhook-port flag and Service) | 9443 |
webhook.certManager.enabled | Use cert-manager to manage webhook TLS | true |
webhook.certificates.autoGenerate | Auto-generate self-signed certs (dev only, not rotated) | true |
webhook.certificates.caBundle | Base64-encoded CA bundle for manual TLS | "" |
cert-manager is enabled by default. From v0.5.0, webhook.certManager.enabled defaults to true. Install cert-manager before deploying the operator, or explicitly set webhook.certManager.enabled: false to fall back to auto-generated self-signed certs (not automatically rotated — not recommended for production).
When webhook.certManager.enabled: true the chart creates a full self-signed CA chain (SelfSigned Issuer → CA Certificate → CA Issuer → leaf Certificate). The ValidatingWebhookConfiguration is annotated with cert-manager.io/inject-ca-from so cert-manager's cainjector populates caBundle automatically.
A Helm post-install/post-upgrade hook Job patches the three CRDs (nodescans, clusterscans, scanschedules) with conversion.strategy: Webhook so the /convert endpoint is correctly wired.
CRD Patcher Hook Parameters
| Parameter | Description | Default |
crdPatcher.image.repository | kubectl image used by the post-install hook Job | registry.k8s.io/kubectl |
crdPatcher.image.tag | Image tag — pin to your cluster minor version | "1.29" |
crdPatcher.image.pullPolicy | Image pull policy | IfNotPresent |
crdPatcher.imagePullSecrets | Pull secrets for the hook Job (air-gap / private registry) | [] |
# Air-gap example
crdPatcher:
image:
repository: my-registry.internal/kubectl
tag: "1.30"
imagePullSecrets:
- name: regcred
Scanner Image Pull Secrets
| Parameter | Description | Default |
scanner.imagePullSecrets | Pull secrets injected into every scanner Job pod | [] |
# Private registry example
scanner:
imagePullSecrets:
- name: regcred
These secrets are forwarded from the operator pod environment (SCANNER_IMAGE_PULL_SECRETS) into the imagePullSecrets field of each Job's pod spec.
Network Policy Parameters
| Parameter | Description | Default |
networkPolicy.enabled | Enable NetworkPolicy resources | true |
networkPolicy.controlPlaneCIDR | CIDR of the Kubernetes API server / control-plane nodes. Used for egress to the API server and ingress from the API server to the webhook port. Set to your actual control-plane CIDR in production. | "0.0.0.0/0" |
networkPolicy.apiServerPort | API server port. Standard clusters use 6443; some managed clusters (AKS, GKE) expose it on 443. | 6443 |
networkPolicy.nodesCIDR | CIDR of cluster nodes. Kubelet liveness/readiness probes originate from node IPs — a namespaceSelector cannot match them. Set to your node subnet in production. | "0.0.0.0/0" |
networkPolicy.ingress | Additional ingress rules (e.g. Prometheus scrape). Kubelet probe and webhook rules are generated automatically. | [] |
networkPolicy.egress | Additional egress rules for the operator pod (ClamAV, DNS, …). API server egress is generated automatically. | [] |
networkPolicy.freshclamEgress | Egress rules for the freshclam CronJob pod. Only rendered when scanner.mode=standalone and scanner.freshclam.enabled=true. | [] |
Why ipBlock and not namespaceSelector?
The Kubernetes API server and the kubelet both run as host processes on nodes, not as pods. namespaceSelector only matches pod-to-pod traffic; it has no effect on traffic that originates outside the pod network. Without ipBlock rules, the operator pod cannot reach the API server (startup checks fail with i/o timeout) and kubelet probes are silently dropped (liveness/readiness never pass).
# Production example — restrict to actual CIDRs
networkPolicy:
enabled: true
controlPlaneCIDR: "10.0.0.10/32" # exact API server IP
apiServerPort: 6443
nodesCIDR: "10.0.1.0/24" # worker node subnet
Default Scan Schedule Parameters
Disabled by default. Enable to automatically run cluster-wide scans on a cron schedule without creating resources manually.
| Parameter | Description | Default |
defaultScanSchedule.enabled | Create a default ScanSchedule resource | false |
defaultScanSchedule.name | ScanSchedule resource name | default-schedule |
defaultScanSchedule.schedule | Cron expression | 0 2 * * * (daily at 02:00) |
defaultScanSchedule.suspend | Pause scheduled runs without deleting the resource | false |
defaultScanSchedule.concurrencyPolicy | Forbid / Allow / Replace | Forbid |
defaultScanSchedule.scanPolicy | ScanPolicy to use | default-policy |
defaultScanSchedule.concurrent | Max nodes scanned in parallel | 3 |
defaultScanSchedule.priority | NodeScan priority: high / medium / low | low |
defaultScanSchedule.nodeSelector | Restrict to specific nodes (empty = all nodes) | {} |
defaultScanSchedule.successfulScansHistoryLimit | Successful ClusterScans to retain | 3 |
defaultScanSchedule.failedScansHistoryLimit | Failed ClusterScans to retain | 1 |
defaultScanSchedule.startingDeadlineSeconds | Max delay (s) before skipping a missed run | "" |
# Enable automatic nightly scans on worker nodes only
defaultScanSchedule:
enabled: true
schedule: "0 2 * * *"
concurrent: 3
priority: low
nodeSelector:
matchLabels:
node-role.kubernetes.io/worker: ""
Other Parameters
| Parameter | Description | Default |
crds.install | Insta | |