Error: Server-Side Apply field conflict detected on Pulumi Kubernetes resource
Fixes Pulumi Kubernetes failing to adopt resources after switching to an explicit provider. For engineers who added an explicit provider and now hit server-side apply conflicts, with the delete-and-recreate vs import choice.
Error: resource ... was not successfully created by the Kubernetes API server: Server-Side Apply field conflict detected
TL;DR
You switched providers and Kubernetes will not hand field ownership to the new one silently. Either adopt the resource with pulumi state delete + pulumi import under the new provider, or delete and recreate it.
The error
error: resource "urn:pulumi:preview-pr-107::aphiria-com-infrastructure::kubernetes:batch/v1:Job::db-init-job" was not successfully created by the Kubernetes API server: Server-Side Apply field conflict detected.
The resource managed by field manager "pulumi-kubernetes-9b013652" had an apply conflict: Apply failed with 1 conflict: conflict with "pulumi-kubernetes-4afb3fc3": .spec.template.spec.containers[name="db-init"].argsFix it
- Decide: adopt (no downtime) or recreate (downtime). For stateless workloads, recreate is simpler; for stateful ones, adopt.
- Success check: you have picked one path deliberately.
- To adopt:
pulumi state delete "[full URN]" --stack [stack](removes from state, keeps the live object), thenpulumi import [type] [name] [namespace]/[name] --stack [stack]with the new provider configured.
- Success check:
pulumi previewshows no changes for the resource.
- To recreate:
kubectl delete [type]/[name] -n [namespace], thenpulumi up.
- Success check: the resource is recreated under the new field manager.
- Re-run
pulumi up.
- Success check: no more apply conflicts.
When to use this
You hit this right after adding an explicit Provider resource (or changing provider configuration) on existing Kubernetes resources.
When NOT to use this
Do not use this for RBAC Forbidden errors or webhook failures. Those are permissions and ordering, not field-manager ownership.
Compatibility
Pulumi CLI 3.x, Pulumi Kubernetes provider v4.x, server-side apply enabled.
Variants
- The same conflict naming Deployments, StatefulSets, or Services instead of Jobs
Apply failed with [n] conflictslisting multiple field paths
Root cause
Each provider instance is a distinct server-side-apply field manager. Kubernetes refuses silent ownership transfer between managers to prevent accidental stomps, so the new manager's apply conflicts with the old one's claimed fields.
Edge cases
pulumi refreshdoes not fix ownership; it only syncs observed state.- Force-applying with
--forceserver-side can stomp the old manager's fields. Prefer the import path for anything stateful.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.