Failed to perform collection on k3s cluster nodes
What steps did you take and what happened: [A clear and concise description of what the bug is.]
Attempted to install Eraser on cluster running k3s, and although the manager was able to successfully run, all collectors failed. This failed using both the manifest and the helm installation process, for versions v0.5.0 and v0.4.0, as well as for the manifest installation v1.0.0-beta.3.
All version experienced the same error logs on the collector pods:
Defaulted container "collector" out of: collector, eraser, trivy-scanner
{"level":"error","ts":1674667563.8705308,"logger":"collector","msg":"failed to get image client","error":"rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService\nrpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService","stacktrace":"main.main\n\t/workspace/pkg/collector/collector.go:60\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:250"}
What did you expect to happen:
Eraser to set up image cleaning
Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]
Environment:
- Eraser version:
v0.4.0,v0.5.0,v1.0.0-beta.3 - Kubernetes version: (use
kubectl version): Client Version: v1.25.2 Kustomize Version: v4.5.7 Server Version: v1.25.4+k3s1
This might be due to k3s containerd.sock path is not using the default value (/run/containerd/containerd.sock) but instead /run/k3s/containerd/containerd.sock https://github.com/k3s-io/k3s/blob/89f7062431b85984d30d2348ea118056b512278f/pkg/agent/run_linux.go#L16
I am not familiar with k3s, but if there is a way to change path to default value for k3s, this should unblock you.
Is it possible instead to expose the containerd path used by Eraser as a config value (i.e. in the helm values file)?
@taliamax yes, we can add to backlog for path to be part of configmap. If you are interested in contributing, feel free to pick up this issue.
Related #647
related https://github.com/aquasecurity/trivy/pull/3599 for trivy support