DigitalOcean DOKS
SBOM and vulnerability scanning on DigitalOcean Kubernetes (DOKS): connect kubectl with doctl, size the node, handle DOCR pull credentials and node replacement.
Last updated
DOKS is a managed, conformant cluster whose worker nodes have public IPs, so the scanner reaches api.stackradar.io with no NAT gateway or proxy work. What is specific to DigitalOcean is how its Container Registry credentials arrive on pods, how little of a small Droplet is left for your own pods, and that DigitalOcean replaces worker nodes on its own schedule.
Prerequisites
- A DOKS cluster and doctl authenticated (doctl auth init).
- Helm 3.8+ and kubectl.
- A free StackRadar account.
Point kubectl at your DigitalOcean Kubernetes (DOKS) cluster
bashdoctl kubernetes cluster kubeconfig save <cluster-id|cluster-name> kubectl get nodesThe saved context is named do-<region>-<cluster-name> and becomes the current context. Its credentials are renewed automatically as needed, which relies on doctl staying installed on that machine; pass --expiry-seconds for a plain token with a fixed lifetime instead, for a CI runner for example.
Reference: doctl kubernetes cluster kubeconfig save.
Install the scanner
Create a cluster in the StackRadar dashboard and copy its cluster ID and cluster-scoped API key (see API keys & cluster scoping):
bashexport STACKRADAR_API_KEY=<your-api-key> export STACKRADAR_CLUSTER_ID=<your-cluster-id>Then install the scanner chart (Helm 3.8+ for the OCI method). The command pins the current release,
0.7.1— published versions are immutable, so the install is reproducible.bashhelm install stackradar-scanner \ oci://ghcr.io/lockdep/charts/stackradar-scanner \ --version 0.7.1 \ --namespace stackradar --create-namespace \ --set stackradar.apiKey=$STACKRADAR_API_KEY \ --set stackradar.clusterId=$STACKRADAR_CLUSTER_IDVerify
bashkubectl get pods --namespace stackradarOnce the pod is
Running, the scanner sends a heartbeat and the cluster shows as connected in the dashboard. Expect the first findings within minutes. If the cluster never connects, see Troubleshooting.
Sizing a DOKS node for the scanner
DigitalOcean reserves memory on every worker for the kubelet, containerd, Cilium, CoreDNS and its own agents, so a 4 GiB Droplet leaves about 2.5 GiB for pods and an 8 GiB Droplet about 6 GiB. Nodes with under 2 GB allocatable are recommended for development only. The scanner requests 512Mi of memory and is capped at 1Gi, so on a 4 GiB node it can take two fifths of what pods may use while a large image is being catalogued; on an 8 GiB node that drops to a sixth. CPU is 50m requested with no limit, which is the right shape for a short burst of syft work. Disk is the number that matters more on small Droplets: the chart requests 1Gi of ephemeral storage and limits it at 6Gi, which bounds the 4Gi emptyDir where image layers are unpacked. There is no PersistentVolumeClaim, so the do-block-storage class is never used and no Volume is billed.
Reference: DOKS limits and allocatable memory.
DigitalOcean Container Registry (DOCR)
Linking a registry to a cluster on the registry’s Settings tab creates a pull Secret in kube-system, copies it into every namespace and adds it to each namespace’s default ServiceAccount. Pods therefore carry the Secret in spec.imagePullSecrets at creation even though their Deployment template never mentions it, and the first command below shows its name (registry-<name> when created with doctl registry kubernetes-manifest). The scanner can reuse it once you opt in: set scanner.resolveImagePullSecrets to true and name the Secret in scanner.imagePullSecretNames, which the chart turns into a secrets get grant on those names only. The alternative is a credential of the scanner’s own: doctl registry docker-config emits a Docker config that is read-only unless you pass --read-write and non-expiring unless you pass --expiry-seconds. Either way the token is account-wide and can pull from every registry the account owns.
# What the DOCR integration put on your pods:
kubectl get pods -n <namespace> -o jsonpath='{range .items[*]}{.metadata.name}: {.spec.imagePullSecrets[*].name}{"\n"}{end}'
# Option A: let the scanner read that Secret
helm upgrade stackradar-scanner oci://ghcr.io/lockdep/charts/stackradar-scanner \
--namespace stackradar --reuse-values --version <installed-version> \
--set-string scanner.resolveImagePullSecrets=true \
--set 'scanner.imagePullSecretNames={registry-<name>}'
# Option B: a read-only DOCR credential of the scanner's own
doctl registry docker-config <name> > docker-config.json
kubectl create secret generic stackradar-registry --namespace stackradar \
--type=kubernetes.io/dockerconfigjson --from-file=.dockerconfigjson=docker-config.json
rm docker-config.jsonReference: Use DOCR with DOKS. Both routes, and what each registry wants for the credential, are in authenticating to a private registry.
What is specific to DigitalOcean Kubernetes (DOKS)
Patch upgrades replace your nodes
DigitalOcean applies Kubernetes patch releases automatically during the cluster’s 4-hour maintenance window; minor versions move only when you ask. An upgrade does not patch a worker in place: with surge upgrades on (the default for new clusters) up to 10 duplicate nodes are created, pods are drained across as PodDisruptionBudgets allow, and the old Droplets are deleted along with everything on their local disks. The scanner pod is rescheduled like any other, its emptyDir scratch is discarded, and a scan that was in flight restarts on the new node. Images whose digest StackRadar already holds are skipped (scanner.skipExistingDigests), so a node swap does not rescan the cluster.
Pools are fixed in size, not in count
A node pool’s Droplet size cannot be changed after creation; you add a pool of the new size and drain the old one. The scanner has no node preference and lands wherever the scheduler puts it, so after such a migration check kubectl get pod -n stackradar -o wide and set nodeSelector in the chart values if you want it pinned to the pool with headroom. DOKS also caps a node at 110 pods, which the single scanner pod will not trouble.
Images from a private registry? The scanner pulls each image itself. Give it one read-only credential via dockerConfigSecret, or let it read the imagePullSecrets your pods declare by turning on scanner.resolveImagePullSecrets and naming those Secrets — it is off by default, so the chart never grants cluster-wide Secret access. Both are in authenticating to a private registry. No public egress at all? Same page: restricted-network installs.
What happens after install
The scanner reports the cluster's workload inventory first — namespaces, workloads, containers, plus the Helm releases and GitOps applications that deliver them — so the dashboard shows every discovered workload and its scan coverage right away. Its first pass covers the whole cluster, not just new deploys: the initial sync lists every pod already running, and each container image is queued for scanning immediately. The scanner generates a CycloneDX SBOM per image and uploads it for matching against 900K+ OSV.dev advisories, then keeps coverage current as pods start, restart, or change — no scan schedules to configure. See architecture & data flow for what runs where and exactly what data leaves the cluster.
Next steps
- Architecture & data flowHow the StackRadar scanner works: what runs in your cluster, exactly what data leaves it, how SBOMs are matched to vulnerabilities, and where data is stored.
- TroubleshootingFixes for common StackRadar scanner issues: 401/403 API errors, a cluster that never appears in the dashboard, Helm install failures, and missing SBOMs.