apply_resource
Create or update Kubernetes resources from YAML manifests using server-side apply with conflict detection or strict creation. Supports multi-document YAML, dry-run validation, and field ownership control.
Instructions
Create or update a Kubernetes resource from a YAML manifest. In 'apply' mode (default), performs a server-side apply with FieldManager=radar and reports field ownership conflicts instead of taking ownership by default. Set force=true only when you intend to take field ownership from other managers (Helm, Flux, GitOps controllers, kubectl). In 'create' mode, performs a strict create that fails if the resource already exists. Supports multi-document YAML separated by '---'. Use dry_run to validate without persisting changes and preview the server-side result. Multi-document failures return per-document status because earlier documents may already be applied. By default returns compact post-mutation state, submitted-vs-live spec differences, rollout/pod status for workloads, and current related issues; set verify=false only when you need a terse write result.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| yaml | Yes | YAML manifest to apply (supports multi-document with --- separator) | |
| mode | No | 'apply' (default, create-or-update) or 'create' (fail if exists) | |
| dry_run | No | validate and preview the server-side result without persisting changes | |
| namespace | No | override namespace for the resource | |
| verify | No | return compact post-mutation state, rollout/pod status, and related issues; on dry_run return a preview diff. Default true; set false for a terse write result. | |
| force | No | apply mode only: force server-side apply field ownership conflicts and take ownership from other managers. Default false; use only when you intend to override Helm/Flux/GitOps/kubectl ownership. |