You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove migrate subcommand — migrations are out of scope
The migrate subcommand was a thin wrapper around external migration
tools. Use the exec subcommand instead for running external tools
with structured logging.
- Deleted src/cmd/migrate.rs and the unused run_command() helper
- Replaced postgres-migrate-seed example with postgres-seed
- Cleaned all references from docs, Helm chart, and CHANGELOG
Closes#11
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
18
18
-`dprint` formatter for Markdown, JSON, TOML, YAML, and Dockerfile with CI check (`dprint/check@v2.2`) and definition-of-done gate.
19
19
- Structured database connection config as an alternative to URL (`host`, `port`, `user`, `password`, `name`, `options` fields). Passwords with URL-reserved characters (`@`, `%`, `:`, etc.) work without encoding. Connections are built using driver-native APIs (PostgreSQL key-value DSN, MySQL `OptsBuilder`), bypassing URL parsing entirely. The `url`/`url_env` fields remain supported for backward compatibility. See [#39](https://github.com/KitStream/initium/issues/39).
20
20
21
+
### Removed
22
+
23
+
-`migrate` subcommand: removed the thin command-execution wrapper. Use `exec` subcommand instead if you need to run an external migration tool with structured logging.
24
+
21
25
### Changed
22
26
23
27
- Renamed `jyq.Dockerfile` to `Dockerfile.jyq` to follow the `Dockerfile.<variant>` convention.
@@ -78,8 +82,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
78
82
-`exec` subcommand: run arbitrary commands with structured logging, exit code forwarding, and optional `--workdir` for child process working directory
79
83
-`fetch` subcommand and `internal/fetch` package: fetch secrets/config from HTTP(S) endpoints with auth header via env var, retry with backoff, TLS options, redirect control (same-site by default), and path traversal prevention
80
84
-`render` subcommand and `internal/render` package: render templates into config files with `envsubst` (default) and Jinja2 template modes, path traversal prevention, and automatic intermediate directory creation
81
-
-`seed` subcommand: run database seed commands with structured logging and exit code forwarding (no idempotency — distinct from `migrate`)
82
-
-`migrate` subcommand: run database migration commands with structured logging, exit code forwarding, and optional idempotency via `--lock-file`
85
+
-`seed` subcommand: run database seed commands with structured logging and exit code forwarding
83
86
- Structured database seeding via `seed` subcommand with YAML/JSON spec files
84
87
- Seed tracking table (`initium_seed` by default) for idempotent seed application
85
88
- Support for PostgreSQL, MySQL, and SQLite database drivers
@@ -117,7 +120,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
117
120
- Documentation for building custom images using Initium as a base
118
121
- SECURITY.md with vulnerability reporting instructions
119
122
- Apache 2.0 LICENSE
120
-
- Examples for nginx-waitfor, postgres-migrate-seed, config-render, template-functions, and phased-seed use cases
123
+
- Examples for nginx-waitfor, postgres-seed, config-render, template-functions, and phased-seed use cases
121
124
- Unit tests for retry logic, logging, safety path validation, wait-for, sha256, base64, template integration, seed schema parsing, database operations, executor logic, references, idempotency, reset, edge cases, duration parsing, and env var support
122
125
- Integration tests with docker-compose for end-to-end testing against real Postgres 16, MySQL 8.0, and nginx services
123
126
- Helm chart unit tests using helm-unittest plugin covering deployment rendering, securityContext, and configuration
Copy file name to clipboardExpand all lines: FAQ.md
+7-26Lines changed: 7 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
Initium is a single binary that replaces ad-hoc bash scripts in Kubernetes `initContainers`. Use it when your pod needs to do any of these before the main container starts:
8
8
9
9
- Wait for a database or API to become reachable
10
-
-Run database migrations or seed data
10
+
-Seed data into a database
11
11
- Render config files from templates
12
12
- Fetch secrets or config from an HTTP endpoint
13
13
- Run a setup script with structured logging
@@ -82,20 +82,6 @@ initContainers:
82
82
83
83
Everything after `--` is the command Initium will execute. Initium does not interpret those arguments — it passes them directly via `execve`.
84
84
85
-
### How do I run database migrations?
86
-
87
-
Use the `migrate` subcommand. It works the same way as `seed` but is a separate subcommand so you can distinguish migration steps from seed steps in logs:
88
-
89
-
```yaml
90
-
initContainers:
91
-
- name: migrate
92
-
image: ghcr.io/kitstream/initium:latest
93
-
args: ["migrate", "--", "flyway", "migrate"]
94
-
env:
95
-
- name: FLYWAY_URL
96
-
value: "jdbc:postgresql://postgres:5432/mydb"
97
-
```
98
-
99
85
### How do I render a config file from a template before my app starts?
100
86
101
87
Use the `render` subcommand. Mount a ConfigMap containing your template and let Initium expand environment variables into the output:
The `--` tells Initium where its own flags end and the wrapped command begins. Without it, Initium might try to interpret your tool's flags as its own:
210
196
211
197
```yaml
212
-
# Correct — Initium sees "migrate" subcommand, then passes "flyway migrate" to execve
213
-
args: ["migrate", "--", "flyway", "migrate"]
198
+
# Correct — Initium sees "exec" subcommand, then passes "setup.sh" to execve
199
+
args: ["exec", "--", "/bin/setup.sh"]
214
200
215
-
# Wrong — Initium tries to parse "flyway" as a flag to the migrate subcommand
216
-
args: ["migrate", "flyway", "migrate"]
201
+
# Wrong — Initium tries to parse "/bin/setup.sh" as a flag to the exec subcommand
202
+
args: ["exec", "/bin/setup.sh"]
217
203
```
218
204
219
205
This is the same convention used by `kubectl`, `docker`, and many other CLI tools.
@@ -392,7 +378,7 @@ spec:
392
378
393
379
The initContainer writes to `/work`, and the main container reads from it.
394
380
395
-
### How do I chain multiple init steps (wait → migrate → seed)?
381
+
### How do I chain multiple init steps (wait → seed)?
396
382
397
383
Define multiple initContainers in order. Kubernetes runs them sequentially:
Copy file name to clipboardExpand all lines: README.md
+3-18Lines changed: 3 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
**Swiss-army toolbox for Kubernetes initContainers.**
4
4
5
-
Initium replaces fragile bash scripts in your initContainers with a single, security-hardened, multi-tool binary. Wait for dependencies, run migrations, render config files, fetch secrets, and more — all with structured logging, retries, and safe defaults.
5
+
Initium replaces fragile bash scripts in your initContainers with a single, security-hardened, multi-tool binary. Wait for dependencies, seed databases, render config files, fetch secrets, and more — all with structured logging, retries, and safe defaults.
- [**postgres-seed**](examples/postgres-seed/): Wait → Seed workflow with PostgreSQL
305
290
- [**config-render**](examples/config-render/): Render config from templates before app starts
306
291
307
292
## How to Run Locally
@@ -351,7 +336,7 @@ Initium was built to address limitations in existing init container tools:
351
336
| [k8s-wait-for](https://github.com/groundnuty/k8s-wait-for) | Bash | Needs shell | No | No | Requires shell + kubectl |
352
337
| [wait4x](https://github.com/atkrad/wait4x) | Go | ~12 MB | No | No | Minimal OS |
353
338
354
-
If you only need TCP/HTTP readiness checks, any of these tools work. Initium is designed for teams that also need migrations, seeding, config rendering, and secret fetching in a single security-hardened binary.
339
+
If you only need TCP/HTTP readiness checks, any of these tools work. Initium is designed for teams that also need seeding, config rendering, and secret fetching in a single security-hardened binary.
0 commit comments