@dmgnr/kuber 1.2.2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -66,6 +66,8 @@ bun run index.ts exec app sh
66
66
  bun run index.ts start
67
67
  bun run index.ts stop
68
68
  bun run index.ts restart
69
+ bun run index.ts rollback
70
+ bun run index.ts fuck app
69
71
  bun run index.ts db ls
70
72
  bun run index.ts s3 ls
71
73
  bun run index.ts s3 creds app
@@ -93,13 +95,15 @@ For a permanent setup, write the generated script to a file and source it from y
93
95
 
94
96
  ## Commands
95
97
 
96
- - `up`: build images if needed, render manifests, apply them, restart deployments whose image content changed, and wait for rollout
97
- - `start`: same as `up` but skips image builds
98
+ - `up`: build images if needed, pin matching registry digests, render manifests, apply them, and wait for rollout
99
+ - `start`: same as `up` but resolves the currently published image digests instead of building
98
100
  - `stop`: scale managed deployments to zero
99
101
  - `restart`: roll out a restart across managed deployments
102
+ - `rollback` (alias `fuck`): roll one deployment back to its previous release, or all managed deployments when no name is given
100
103
  - `down`: delete managed resources while keeping ingress, PVCs, managed databases, and managed S3 storage
101
104
  - `down -f`: also delete ingress, PVCs, managed database and S3 resources, and the namespace
102
- - `ps`: list deployments in the current project namespace
105
+ - `ps`: print an ANSI tree of the current project namespace, hiding stopped deployments by default
106
+ - `ps -a`: include stopped deployments and stale ReplicaSets in the tree
103
107
  - `logs [deployment]`: print logs for one deployment or all managed deployments
104
108
  - `logs -f [deployment]`: follow logs continuously
105
109
  - `exec <deployment> <command...>`: execute a command inside a running deployment pod
@@ -366,7 +370,32 @@ Precedence:
366
370
 
367
371
  ## Building
368
372
 
369
- Image builds and image-digest checks run through the selected SSH builder. If a pushed image has the same content fingerprint as the existing registry image, `up` does not restart that deployment.
373
+ Image builds run through the selected SSH builder. After a push, the registry's
374
+ manifest digest is captured and embedded into the rendered Deployment as an
375
+ immutable `:latest@sha256:...` reference, so a changed image naturally triggers
376
+ a rollout (there is no separate "restart changed deployments" step). `start` and
377
+ `export` look up the currently published digest without rebuilding, and fail if
378
+ a buildable service has no published image yet.
379
+
380
+ ## Rollback
381
+
382
+ `kuber rollback [deployment]` (alias `fuck`) rewinds managed Deployments to the
383
+ previous release. ReplicaSets carry a `deployment.kubernetes.io/revision`
384
+ annotation, and rollback restores the complete pod template from the next-older
385
+ ReplicaSet via a JSON Patch, then waits for the rollout to complete. With no
386
+ argument every managed Deployment is rolled back; pass a deployment name to
387
+ target a single one.
388
+
389
+ Notes and limitations:
390
+
391
+ - Kubernetes only keeps its most recent ReplicaSets, so an older release may no
392
+ longer be reachable after enough successful rollouts/rollbacks.
393
+ - Rollback restores the pod template (including image and environment), not live
394
+ Secret, ConfigMap, PVC, database, or S3 state.
395
+ - A later `kuber up` or `kuber start` re-resolves `:latest` and returns the
396
+ Deployment to the current desired state anyway, so rollback is the right tool
397
+ for responding to a bad deploy, not for permanently pinning an old version.
398
+ - Rollback only considers Deployments managed by kuber (`app.kubernetes.io/managed-by=kuber`).
370
399
 
371
400
  To build distributable binaries:
372
401