JAEN

Kubernetes

kubectl patch

CautionPatch resources

kubectl patch <kind>/<name> -p '<json>'

Applies partial updates from the CLI — scriptable fixes and annotation tweaks.

Examples

  • kubectl patch deploy web -p '{"spec":{"replicas":3}}'Patch just replicas

Syntax

kubectl patch <res> -p 'patch' [--type merge|json]

Before you run it

Prefer fixing manifests and re-applying.

Related commands

The same reference, with no signal at all

Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).

Get it free on the App Store