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
Copy file name to clipboardExpand all lines: README.md
+72-2Lines changed: 72 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,77 @@ export DRY_RUN=true
55
55
./evict_to_rollout.sh
56
56
```
57
57
58
-
### 3. Deploy as CronJob
58
+
##Deployment Options
59
59
60
-
See `cronjob.yaml` for the full manifest including RBAC permissions.
60
+
### Helm (recommended)
61
+
62
+
This repository ships a Helm chart (`chart/evict-to-rollout`) so you can tweak the schedule, annotation selector, and naming without forking the manifest.
|`schedule`| Cron expression for how often to scan nodes |`*/1 * * * *`|
79
+
|`annotationSelector.key`/`.value`| Annotation pair that marks pods for rollout |`evict-with-rollout` / `true`|
80
+
|`image.repository` / `.tag`| Container image that provides `kubectl` + `jq`|`ghcr.io/hivemindtechnologies/evict-to-rollout/kubectl-jq` / *(empty = use chart `appVersion`)*|
81
+
|`serviceAccount.create`| Whether to create a dedicated SA |`true`|
82
+
|`rbac.create`| Whether to install ClusterRole + binding |`true`|
83
+
84
+
See `chart/evict-to-rollout/values.yaml` for the full list.
85
+
86
+
## Development & Testing
87
+
88
+
This repo ships a `devbox.json` so everyone (including CI) uses the same versions of `helm`, `kubectl`, `kind`, and `jq`.
89
+
90
+
```bash
91
+
# Start a dev shell with all tools:
92
+
devbox shell
93
+
94
+
# Lint the chart:
95
+
devbox run lint
96
+
97
+
# Run the end-to-end test (requires Docker since it spins up kind):
98
+
devbox run test
99
+
```
100
+
101
+
The test script (`scripts/test-kind.sh`) creates a 3-node kind cluster, installs the Helm chart, deploys a sample annotated app, cordons a node, runs the controller job manually, and asserts that the deployment was restarted and rescheduled onto a different node.
102
+
103
+
GitHub Actions mirrors the same flow via `.github/workflows/ci.yaml`:
104
+
105
+
- on every PR, it runs `helm lint` and the kind-based integration test.
106
+
- on pushes to `main`, it additionally publishes:
107
+
- the multi-arch `kubectl-jq` image tagged as `latest` and `${LAST_TAG}-sha.${GITHUB_SHA::7}`
108
+
- a Helm chart tagged as `${LAST_TAG}-sha.${GITHUB_SHA::7}` to `oci://ghcr.io/hivemindtechnologies/evict-to-rollout`
109
+
- on git tag pushes (e.g. `v0.2.0`), the same workflow publishes **stable** artifacts tagged with the release version
110
+
111
+
### Building the controller image
112
+
113
+
The CronJob runs a tiny Alpine image containing `kubectl`, `jq`, `bash`, and CA certificates. Build it (multi-arch) and push to GHCR with:
The CI pipeline keeps versions in sync automatically:
125
+
126
+
- For pushes to `main`, it reads the most recent git tag (or `0.0.0` if none exists) and publishes snapshot artifacts tagged as `<last-tag>-sha.<short-sha>`.
127
+
- For pushes to annotated tags (e.g. `v0.3.0`), it strips the `v` prefix and publishes both the Docker image and the Helm chart with the exact release version.
128
+
- The pipeline patches `chart/evict-to-rollout/Chart.yaml` on the fly so that `version` and `appVersion` match the artifact tag, and the default image tag in the chart inherits from `appVersion`.
129
+
130
+
For local testing the kind script (`devbox run test`) builds the image and loads it directly into the cluster, so no registry push is required.
0 commit comments