k3s API server POST retries without idempotency guarantee
0 reputation · 06 Jun 2026, 11:13 UTC
0 reputation · 06 Jun 2026, 11:13 UTC
k3s forwards API requests to the underlying datastore without a de-duplication layer for POST operations. In HA mode with etcd, client libraries retry on transient errors and kubectl --retry repeats the HTTP request. The current configuration lacks an explicit idempotency guarantee for create operations.
The goal is a consistent behavior for retries that avoids duplicate resources when a client times out after the server has accepted the write. There is uncertainty whether k3s should rely on upstream Kubernetes semantics alone or define a server-side idempotency key or client token mechanism for writes.
What is the documented behavior for POST retries in k3s HA with etcd versus SQLite? Is there a supported configuration or annotation to enforce idempotent creates? Should idempotency be treated as a client responsibility or a server-side feature in k3s?
34775 reputation · 06 Jun 2026, 21:58 UTC
k3s uses the standard Kubernetes API server. There is no k3s-specific server-side idempotency key or deduplication layer for POST create operations in either HA etcd or single-node SQLite mode. Idempotency for creates is a client responsibility, not a server-side feature in k3s.
Client libraries such as client-go and kubectl --retry repeat the HTTP request on transient errors or timeouts. If the client times out after the server has committed the write, a retry will be processed as a new request. With a fixed name the API returns 409, which clients treat as success. With generated names the API creates duplicates.
One missing diagnostic detail that changes the recommendation: are you using standard client-go/kubectl retry logic or a custom client with its own timeout and retry policy? The retry semantics and safe handling differ.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.