kx set
Changes a field of an indexed workload in place, the way kubectl set does. Only image is wrapped: ‘kubectl set env’ and the rest can take an index through kx ref.
kx set image <index> <image>... changes a Pod, Deployment, StatefulSet, DaemonSet, ReplicaSet or CronJob’s container images and prints each one before and after, so the line says what to type to put it back. A bare image sets the workload’s only container; with more than one, init containers included, name each — api=api:v2 — or use * for every one. kubectl’s own flags pass through.
Usage
kx set [OPTIONS]Subcommands
| Command | Description |
|---|---|
kx set image | Change the container images of an indexed Pod, Deployment, StatefulSet, DaemonSet, ReplicaSet or CronJob. |
Global options
| Option | Description |
|---|---|
--no-color | Disable styled output |
-h, --help | Show this message and exit |
Examples
kx set image 1 nginx:1.27.3
kx set image 1 api=api:v2 envoy=envoyproxy/envoy:v1.31
kx set image @api api:v2 --dry-run=server