kubectl patch

The kubectl command that changes selected fields of a live Kubernetes object.

In more detail

A merge patch sends only the fields to change, as JSON or YAML. It is useful for small, urgent edits such as switching a Service selector during a rollback.

Example

kubectl patch service checkout --type merge -p '{"spec":{"selector":{"color":"blue"}}}'

Related terms

Taught in

References