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: .claude/skills/configure-k8s-deployment.md
+21-11Lines changed: 21 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,13 +20,9 @@ Run `configure-app-settings` first. This skill assumes `settings.json`, the Dock
20
20
21
21
Push your changes to `main` or create a tag. The workflow `.github/workflows/build-and-test.yml` builds both the full and lightweight (`-simple`) variants and publishes them to `ghcr.io/<your-org>/<your-repo>:<tag>-full` and `:<tag>-simple` respectively. The unsuffixed `latest` tag tracks the full variant on the `main` branch.
22
22
23
-
2.**Copy the template overlay.**
23
+
2.**Edit `k8s/overlays/prod/kustomization.yaml` in place.**
Each fork ships a single production overlay at `k8s/overlays/prod/`. Edit the existing file rather than copying — the repo itself identifies the app, so there is no per-app overlay subdirectory.
30
26
31
27
- Change `namePrefix` from `template-app-` to `<your-app-name>-`
32
28
- Change `commonLabels.app` from `template-app` to `<your-app-name>`
@@ -38,18 +34,31 @@ Run `configure-app-settings` first. This skill assumes `settings.json`, the Dock
38
34
39
35
The overlay leaves the nginx `Ingress` unpatched because production deployments use Traefik. If you are deploying to an nginx-only cluster, add an overlay patch for both `rules[].host` entries in the base `Ingress` (same `.de` / `.org` pattern) instead of the IngressRoute.
40
36
37
+
3.**Select a memory tier.**
38
+
39
+
The overlay pulls in one of two Kustomize components under `components:`. The default `memory-tier-low` pins the app to the low-mem node (~64 GB) with modest resource requests/limits — correct for most template-based apps. Switch to `memory-tier-high` only if the workload genuinely needs the large-memory node (DIA spectral-library construction, OpenSwath peak picking, DIA-LFQ):
The cluster node labels `openms.de/memory-tier=low` and `openms.de/memory-tier=high` must already exist; the tier component adds the matching `nodeSelector`.
49
+
41
50
4. **Validate the overlay builds.**
42
51
43
52
```bash
44
-
kubectl kustomize k8s/overlays/<your-app-name>/
53
+
kubectl kustomize k8s/overlays/prod/
45
54
```
46
55
47
56
Should print the rendered manifests with no errors.
48
57
49
58
5. **Deploy.**
50
59
51
60
```bash
52
-
kubectl apply -k k8s/overlays/<your-app-name>/
61
+
kubectl apply -k k8s/overlays/prod/
53
62
```
54
63
55
64
6. **Verify.**
@@ -63,18 +72,19 @@ Run `configure-app-settings` first. This skill assumes `settings.json`, the Dock
Copy file name to clipboardExpand all lines: docs/kubernetes-deployment.md
+21-10Lines changed: 21 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,15 +162,13 @@ Update `settings.json`, choose a Dockerfile, and update `README.md`. If you are
162
162
163
163
Push your changes to `main` or create a tag. The workflow `.github/workflows/build-and-test.yml` builds both the full (`Dockerfile`) and lightweight (`Dockerfile_simple`) variants and pushes each to `ghcr.io/<your-org>/<your-repo>` with variant-suffixed tags: `<branch>-full` / `<branch>-simple`, `v<version>-full` / `v<version>-simple`, and `<sha>-full` / `<sha>-simple`. The unsuffixed `latest` tag tracks the full variant on `main`.
Each fork ships a single production overlay at `k8s/overlays/prod/`. Edit this file in place — the forked repository itself identifies the app, so no per-app overlay subdirectory is created.
170
168
171
169
### Step 4 — Edit `kustomization.yaml`
172
170
173
-
Open `k8s/overlays/<your-app-name>/kustomization.yaml` and change the following fields:
171
+
Open `k8s/overlays/prod/kustomization.yaml` and change the following fields:
174
172
175
173
| Field | Set to |
176
174
|-------|--------|
@@ -184,6 +182,19 @@ Open `k8s/overlays/<your-app-name>/kustomization.yaml` and change the following
184
182
185
183
The overlay leaves the nginx `Ingress` unpatched because Traefik is the production ingress. If you are deploying to an nginx-only cluster, add an overlay patch for both `rules[].host` entries in the base `Ingress` (same `.de` / `.org` pattern) instead of the IngressRoute patch.
186
184
185
+
### Step 4b — Select a memory tier
186
+
187
+
The overlay pulls in one of two Kustomize components under `components:`:
188
+
189
+
```yaml
190
+
components:
191
+
- ../../components/memory-tier-low # default: light app on low-mem node
192
+
# OR
193
+
- ../../components/memory-tier-high # memory-intensive app on high-mem node
194
+
```
195
+
196
+
`memory-tier-low` is the right choice for most apps. Switch to `memory-tier-high` only if the workload genuinely needs tens of GB of RAM (DIA spectral-library + OpenSwath peak picking, DIA-LFQ). The tier component adds the matching `nodeSelector: openms.de/memory-tier=<tier>` plus `requests`/`limits` sized for that node, so cluster nodes must already be labelled `openms.de/memory-tier=low` / `...=high`.
197
+
187
198
### Step 5 — Configure the admin password (optional)
188
199
189
200
Skip this step if you don't need the "Save as Demo" feature. The Streamlit Deployment mounts the `streamlit-secrets` Secret with `optional: true`, so the pod starts either way — the admin UI simply reports "Admin not configured" when the Secret is absent.
@@ -213,18 +224,18 @@ Because the Secret is created outside Kustomize, the overlay's `namePrefix` does
Add `- streamlit-secrets.yaml` to the `resources:` list in `k8s/overlays/<your-app-name>/kustomization.yaml`. The filename `streamlit-secrets.yaml` is gitignored (`.gitignore`: `k8s/**/streamlit-secrets.yaml`); always confirm with `git status` before committing — never commit a filled-in copy.
231
+
Add `- streamlit-secrets.yaml` to the `resources:` list in `k8s/overlays/prod/kustomization.yaml`. The filename `streamlit-secrets.yaml` is gitignored (`.gitignore`: `k8s/**/streamlit-secrets.yaml`); always confirm with `git status` before committing — never commit a filled-in copy.
221
232
222
233
When the Secret is managed through Kustomize, the overlay's `namePrefix` rewrites both the Secret name and the Deployment reference, so no manual renaming is needed.
223
234
224
235
### Step 6 — Deploy
225
236
226
237
```bash
227
-
kubectl apply -k k8s/overlays/<your-app-name>/
238
+
kubectl apply -k k8s/overlays/prod/
228
239
```
229
240
230
241
### Step 7 — Verify
@@ -252,13 +263,13 @@ One unified workflow owns manifest lint, Docker build, push, and kind integratio
252
263
- **Trigger:** pull request to `main`, push to `main`, push of a `v*` tag, or manual workflow dispatch.
253
264
- **Job 1 — `lint-manifests`:**
254
265
- `kubeconform`runs against `k8s/base/*.yaml` with strict mode and Kubernetes 1.28 schemas (excluding `kustomization.yaml` and the Traefik CRD `traefik-ingressroute.yaml`).
255
-
-`kubectl kustomize k8s/overlays/template-app/` must succeed; the kustomized output is re-validated through `kubeconform` (with `IngressRoute` skipped).
266
+
- `kubectl kustomize k8s/overlays/prod/`must succeed; the kustomized output is re-validated through `kubeconform` (with `IngressRoute` skipped).
256
267
- Takes ~30s. Fails fast so manifest typos never trigger the hours-long full Docker build.
- Builds `Dockerfile` (full, includes TOPP tools) or `Dockerfile_simple` (pyOpenMS only) depending on the matrix leg.
259
270
- **Buildx registry cache** (`type=registry,…,mode=max`) stored at `ghcr.io/<repo>/cache:full` and `:simple`. A `cache-from` read is attempted on every event; `cache-to` write only on push/tag/workflow_dispatch (fork PRs can't write). Repeat builds with an unchanged Dockerfile finish in minutes.
260
271
- **Push** on push/tag/workflow_dispatch events (not on PRs). Tags: `<branch>-full` / `<branch>-simple`, `v<version>-full` / `v<version>-simple`, `<sha>-full` / `<sha>-simple`. `latest` is emitted only for the full variant on push to `main`.
261
-
-**Kind integration** runs per variant: creates a kind cluster, loads the just-built image, installs the nginx ingress controller, applies the kustomized `template-app` overlay (filtering Traefik `IngressRoute`, forcing `imagePullPolicy: Never` and `storageClassName: standard`), asserts Redis + deployments become ready, and curls both `.de` and `.org` hostnames through the nginx ingress to verify dual-host routing.
272
+
- **Kind integration** runs per variant: creates a kind cluster, loads the just-built image, installs the nginx ingress controller, applies the kustomized `prod` overlay (filtering Traefik `IngressRoute`, forcing `imagePullPolicy: Never` and `storageClassName: standard`), asserts Redis + deployments become ready, and curls both `.de` and `.org` hostnames through the nginx ingress to verify dual-host routing.
262
273
- **Job 3 — `traefik-integration`** (`needs: lint-manifests`, runs once on `Dockerfile_simple`): builds the simple image, brings up a second kind cluster, installs Traefik via Helm (`service.type=ClusterIP`), applies the full kustomized overlay without filtering the `IngressRoute` (still patching `imagePullPolicy: Never` and `storageClassName: standard` for kind compatibility), and curls both hostnames through Traefik. Catches IngressRoute-syntax regressions that the nginx-side test cannot.
263
274
- **Auth:** uses the workflow's `GITHUB_TOKEN` for GHCR login and as a build argument for in-image private-resource access. Fork PRs skip login (their `GITHUB_TOKEN` is read-only) but can still read the public cache.
264
275
- **PR behavior:** all three jobs run on pull requests. No tags are pushed and no cache is written. The kind integration still runs, exercising manifests end-to-end. If branch protection requires these checks, a failure blocks merge.
0 commit comments