In Server-Side Apply, what is a field manager, and what does the `application/apply-patch+yaml` content type signify?
Quick Answer
A field manager is the identity (a name) under which changes are recorded and owned — for example kubectl, helm, or a controller name. apply-patch+yaml is the special content type kubectl sends with --server-side that tells the API server this is a fully specified intent to be merged server-side with ownership tracking, not a plain patch or update.
Detailed Answer
Every writer that uses SSA identifies itself with a fieldManager string; the server attributes ownership of the fields in the request to that manager and records it in managedFields. Choosing distinct, stable manager names (kubectl, helm, argocd) is what makes conflict messages meaningful. The request body is sent as Content-Type: application/apply-patch+yaml (or the JSON variant), which is how the server distinguishes an apply — declarative, fully specified, ownership-aware — from an imperative PATCH/UPDATE. The apply request carries your complete desired state for the fields you manage; the server computes the resulting object from that intent plus every other manager ownership.
Code Example
# kubectl → API server (apply request) # PATCH /apis/apps/v1/namespaces/default/deployments/my-app # Content-Type: application/apply-patch+yaml # fieldManager=kubectl kubectl apply --server-side --field-manager=kubectl -f deploy.yaml
Interview Tip
Mention that stable, distinct field-manager names are what make conflict errors readable — it shows you have operated SSA, not just defined it.