containerd/containerd · error
resource is unreasonably small (< 1kbit)
Error message
resource is unreasonably small (< 1kbit)
What it means
Kata/CRI bandwidth annotation validation (inherited from kubernetes pkg/util/bandwidth) rejects a bandwidth resource quantity smaller than 1k (1000 bits per second) because TC shaping with such a tiny rate is meaningless. The check runs when extracting ingress/egress values from pod annotations.
Source
Thrown at internal/cri/bandwidth/utils.go:47
See the License for the specific language governing permissions and
limitations under the License.
*/
// Package bandwidth provides utilities for bandwidth shaping
package bandwidth
import (
"fmt"
"k8s.io/apimachinery/pkg/api/resource"
)
var minRsrc = resource.MustParse("1k")
var maxRsrc = resource.MustParse("1P")
func validateBandwidthIsReasonable(rsrc *resource.Quantity) error {
if rsrc.Value() < minRsrc.Value() {
return fmt.Errorf("resource is unreasonably small (< 1kbit)")
}
if rsrc.Value() > maxRsrc.Value() {
return fmt.Errorf("resource is unreasonably large (> 1Pbit)")
}
return nil
}
// ExtractPodBandwidthResources extracts the ingress and egress from the given pod annotations
func ExtractPodBandwidthResources(podAnnotations map[string]string) (ingress, egress *resource.Quantity, err error) {
if podAnnotations == nil {
return nil, nil, nil
}
str, found := podAnnotations["kubernetes.io/ingress-bandwidth"]
if found {
ingressValue, err := resource.ParseQuantity(str)
if err != nil {
return nil, nil, err
}View on GitHub (pinned to 4246446a2b)
Solutions
- Set the annotation to a value >= 1k, e.g. "1M" or "10M".
- Use proper unit suffixes (k/M/G) in the bandwidth annotations.
- Remove the bandwidth annotation if throttling is not actually needed.
Example fix
// before annotations: kubernetes.io/ingress-bandwidth: "100" // after annotations: kubernetes.io/ingress-bandwidth: "100M"
Defensive patterns
Strategy: validation
Validate before calling
func validBandwidth(v string) bool {
q, err := resource.ParseQuantity(v)
if err != nil { return false }
min := resource.MustParse("1k")
max := resource.MustParse("1P")
return q.Value() >= min.Value() && q.Value() <= max.Value()
}
// use: if !validBandwidth(pod.Annotations["kubernetes.io/ingress-bandwidth"]) { reject pod / drop annotation } Type guard
func isReasonableBandwidth(q *resource.Quantity) bool {
return q != nil && q.Value() >= resource.MustParse("1k").Value() && q.Value() <= resource.MustParse("1P").Value()
} Prevention
- Always include unit suffixes (k/M/G) in bandwidth annotations.
- Add admission-webhook or lint checks for bandwidth annotation ranges (1k..1P).
- Never write bare integers into bandwidth annotations.
- Document valid ranges in your platform's pod annotation guidelines.
When it happens
Trigger: A pod annotation like kubernetes.io/ingress-bandwidth or kubernetes.io/egress-bandwidth is set to a quantity whose value() is below minRsrc = resource.MustParse("1k") (e.g. "100" or "1b").
Common situations: Typo in bandwidth annotation units (e.g. "100" instead of "100M"), testing with tiny values, copying annotations with stripped unit suffixes.
Related errors
- resource is unreasonably large (> 1Pbit)
- reading pod bandwidth annotations: %w
- get cni namespace options: %w
- sandbox config must include metadata
- destination path can not be C drive
AI-assisted analysis of containerd/containerd@4246446a2b (2026-09-02).
Data as JSON: /api/errors/8239d141b5e578b0.
Report an issue: GitHub.