Skip to content

feat: add a Helm chart and document deployment - #92

Merged
AnonymousXC merged 6 commits into
devfrom
feat/52-helm-chart
Nov 16, 2026
Merged

AnonymousXC merged 6 commits into
devfrom
feat/52-helm-chart

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds a generic Helm chart for Krini in deployment/ and documents how to deploy with it.

  • Chart (modelled on cloud-registry's chart and FOCA's foca-common, without depending on it): Deployment, Service, and an Ingress, a Gateway API HTTPRoute or an OpenShift Route, plus an optional NetworkPolicy and a PodDisruptionBudget (with more than one replica), and a helm test pod.
  • No deployment defaults: rendering fails without hostName (or config.appOrigin), config.cloudRegistryUrl and loginProviders.existingSecret.
  • Secrets: LOGIN_PROVIDERS, which contains the providers' client secrets, comes only from an existing Secret (loginProviders.existingSecret / secretKey). The non-secret settings are camelCase values (config.*) passed as env vars, and empty values are left out. extraEnv can't override the variables the chart sets.
  • Security: the pod runs non-root as UID 1000, under the restricted Pod Security Standard, with a read-only root file system, /tmp as an emptyDir and no service account token.
    • On OpenShift (when security.openshift.io/v1 is served), runAsUser, runAsGroup, fsGroup and seccompProfile are omitted, so the SCC assigns them. Some OpenShift clusters reject RuntimeDefault.
    • The NOTES warn when OpenShift would serve the default Ingress without TLS.
  • Schema: values.schema.json uses additionalProperties: false, URL and host name patterns, and allows global for use as a subchart.
  • Probes call /privacy, which needs no login and no other services.
  • CI: two new jobs in ci.yml. Both are in the passed gate's needs and in publish's needs.
    • chart / "Chart": helm lint --strict plus deployment/tests/test-chart.sh, 99 render tests with helm, yq and jq, covering objects and failing values.
    • chart-install / "Chart install": builds the image, installs the chart on kind, runs helm test, checks for a non-root UID, and upgrades to 2 replicas with a PodDisruptionBudget (deployment/tests/install-chart.sh).
  • Docs:
    • New operator guide page "Helm chart": installation, the login providers' Secret and its fields, the values reference, exposing Krini (Ingress, Gateway API, OpenShift), security, network policy, upgrades, uninstallation and testing the chart.
    • Links from the README quick start, Deployment, Upgrading and the operator guide index; deployment/README.md.
    • .dockerignore now excludes deployment/.

Closes #52

Required checks

No ruleset change is needed. The only required check stays CI passed, which now also needs chart and chart-install.

Not in this PR

  • configuration.md still describes the settings from before the provider-agnostic login (LS_LOGIN_URL, OIDC_CLIENT_*). Its rewrite is docs: deploy a released version #77. The chart page documents LOGIN_PROVIDERS and its fields for now.
  • No OpenShift-specific files or personal images remain in the repo; that was already true before this PR.

Verification

  • helm lint deployment --strict -f deployment/ci/test-values.yaml: passed with Helm 3.22.1; the only message is INFO "icon is recommended".
  • deployment/tests/test-chart.sh: 99 tests, 0 failures.
  • deployment/tests/install-chart.sh krini:chart-ci on a local kind cluster (kind 0.33.0) with an image built from the branch:
    • The install was ready, and helm test passed (/privacy: 200, /: 307 /dashboard).
    • The UID was 1000.
    • The upgrade reached 2 ready replicas with a PDB of maxUnavailable: 1.
    • This was run before the last review fixes, which changed labels, the NetworkPolicy and the notes. CI runs it again.
  • Other checks:
    • bun run lint (Biome): clean.
    • npx vitest run: 237 passed.
    • mkdocs build --strict: clean.
    • actionlint and shellcheck: clean.
  • The NOTES branches (OpenShift with Ingress, HTTPRoute, not exposed) were rendered via tpl in a scratch copy of the chart.
  • Review: two rounds of adversarial and quality review. All high and medium findings are fixed: helm test is now admitted by the NetworkPolicy, global is allowed in the schema, the docs warn about the Ingress on OpenShift, and port literals are replaced by a helper.
  • Sourcery raised 14 threads. All are answered and resolved:
    • Fixed: NetworkPolicy peers without selectors are rejected, and the label-based helm test exception is dropped. APP_ORIGIN must be an https origin and the privacy URLs must be https. A zero /tmp limit is rejected. The service prerequisites are documented, along with the README provider example, the test pod left after uninstall, and the namespace wait in the install script.
    • Answered: see Declined review findings.
  • CI on a4b096b: all 24 checks passed, including CI passed, Chart, Chart install and Sourcery review; 2 were skipped as intended (Push image and Publish image on PRs). On the first push, the external "Vercel – krini" check of the elixir-cloud-aai Vercel project failed, as it also did on build: use Cloud Components 2.0.0-alpha.51 #90; it is not required and passed on the later push.

Declined review findings

  • Prefer the Route automatically on OpenShift. The chart keeps cloud-registry's behaviour: the Ingress is the default, and the Route is created only when the Ingress and HTTPRoute are disabled. Instead, the README, the docs and the NOTES tell OpenShift users to set krini.ingress.enabled=false. Changing the default would diverge from the org's other charts.
  • Docker build cache in chart-install. It's a plain docker build for now, which is fine at the current job time.
  • Chart icon. It's optional; lint reports it only as INFO.
  • Several replicas log users out (Sourcery, high). The cause is the in-memory refresh guard per pod in src/app/auth/api/refresh/route.ts, which is app code and out of scope here. The chart defaults to 1 replica, and the docs recommend sticky sessions for more. A follow-up issue is suggested.
  • Moving tags aren't rolled out on upgrade (Sourcery). This is standard Kubernetes behaviour; the docs recommend release tags or digests, and kubectl rollout restart for moving tags.
  • Concurrent helm test runs (Sourcery). This is the standard hook pattern.
  • Registry write access in the docs (Sourcery). Krini only reads the registry today.
  • configuration.md rewrite (Sourcery). That is docs: deploy a released version #77.

Open questions

  • None that block this PR. As a follow-up, decide whether release.yml should package the chart and attach it to the GitHub release, as cloud-registry does. That would set version and appVersion from the tag, so krini.tag would no longer be needed. Until then, operators install from a checkout of the release tag, and Chart.yaml keeps the placeholders 0.0.0 / dev.

🤖 Generated with Claude Code

Summary by Sourcery

Provide a secure, configurable Helm-based deployment path for Krini and integrate its validation, installation checks, and operator documentation into CI.

New Features:

  • Add a generic Helm chart for deploying Krini on Kubernetes and OpenShift with configurable exposure through Ingress, Gateway API HTTPRoute, or OpenShift Route.
  • Support optional NetworkPolicy and PodDisruptionBudget resources, Helm release testing, configurable application settings, and existing-Secret login provider credentials.

Enhancements:

  • Apply secure-by-default pod settings, including non-root execution, restricted capabilities, a read-only root filesystem, temporary storage, and no service account token.
  • Validate required deployment values and incompatible configuration, while supporting OpenShift-specific security contexts and flexible image, probe, scheduling, and environment settings.

CI:

  • Add chart linting, rendering, and kind-based installation jobs to CI and include them in the required CI gate and publishing dependencies.

Documentation:

  • Document Helm installation, configuration, login provider Secrets, exposure options, security, networking, upgrades, uninstallation, and chart testing, with links from the README and operator guide.

Tests:

  • Add comprehensive Helm rendering and invalid-value tests, plus cluster installation, Helm test, non-root, and upgrade verification scripts.

Chores:

  • Exclude deployment files from the Docker build context.

uniqueg and others added 4 commits November 15, 2026 18:25
Add a chart in deployment/ for Kubernetes and OpenShift: Deployment,
Service, and an Ingress, Gateway API HTTPRoute or OpenShift Route, with
an optional NetworkPolicy and PodDisruptionBudget. Settings come from
camelCase values, the login providers only from an existing Secret;
rendering fails without host, registry or Secret. The pod runs
non-root with a read-only root file system; on OpenShift, user IDs and
the seccomp profile are left to the cluster.

CI lints and tests the chart (job chart) and installs it on kind with
helm test (job chart-install); both are in the gate's needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add "Helm chart" to the operator guide: installation from a release's
checkout, the login providers' Secret and its fields, all values,
exposing Krini, security on Kubernetes and OpenShift, upgrades and the
chart tests. Link it from the README's quick start, the deployment and
upgrade pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Admit the helm test pod through the NetworkPolicy.
- No default ClusterIssuer: it's specific to a cluster.
- Standard labels on pods; the version label follows krini.tag.
- One helper for the port; value checks in their own template.
- Run the ERR trap of the install script inside functions too.
- Document that OpenShift needs the Ingress disabled for the Route,
  and the annotations and security contexts; more chart tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Allow `global` again, so that the chart works as a subchart.
- Take the version label from krini.tag or the tag in krini.image,
  leave it out for digests, and keep it a valid label value.
- Warn in the notes when OpenShift would serve the Ingress without TLS.
- Check all labels of the test pod against the NetworkPolicy; rewrap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
krini Ready Ready Preview Nov 16, 2026 3:54am UTC

@sourcery-ai

sourcery-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Define the chart’s public values and validation rules, including required deployment settings and the supported configuration options.

  • deployment/values.schema.json L1-316
  • deployment/values.yaml L1-185

Configuration

Implement the Helm chart resources and helper logic that render the deployment, networking, exposure, and test-hook manifests from the chart values.

  • deployment/templates/NOTES.txt L1-41
  • deployment/templates/_helpers.tpl L1-230
  • deployment/templates/deployment.yaml L1-113
  • deployment/templates/httproute.yaml L1-36
  • deployment/templates/ingress.yaml L1-53
  • deployment/templates/networkpolicy.yaml L1-39
  • deployment/templates/poddisruptionbudget.yaml L1-31
  • deployment/templates/route.yaml L1-30
  • deployment/templates/service.yaml L1-15
  • deployment/templates/tests/test-connection.yaml L1-47
  • deployment/templates/validate.yaml L1-2

Set chart metadata and package contents, and update repository build-context exclusions for the new deployment directory.

  • .dockerignore L22-23
  • deployment/.helmignore L1-25
  • deployment/Chart.yaml L1-15

Add CI jobs for chart lint/render tests and kind installation, and require them in the image-publish and overall-result gates.

  • .github/workflows/ci.yml L333-386 (+3 small edits)

Register the new Helm chart page in the documentation site navigation.

  • mkdocs.yml L76

Documentation

Document the chart’s installation, values, secret handling, exposure options, security, operations, and testing, and add chart-specific repository guidance.

  • deployment/README.md L1-16
  • docs/operator-guide/helm-chart.md L1-373

Link the Helm deployment path from the project quick start and existing operator guidance.

  • README.md L57-84, L125
  • docs/operator-guide/deployment.md L4-5, L248
  • docs/operator-guide/index.md L4-6, L11-12
  • docs/operator-guide/upgrading.md L13-16

Tests

Add render-level chart checks for expected resources and validation failures, plus a cluster-install script that tests the release and upgrade behavior.

  • deployment/tests/install-chart.sh L1-66
  • deployment/tests/test-chart.sh L1-282

Other changes

Files not grouped.

  • deployment/ci/test-values.yaml L1-8

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

read-the-docs-community Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b610d7e) to head (3a57694).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #92   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          545       545           
  Branches       157       157           
=========================================
  Hits           545       545           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@uniqueg
uniqueg marked this pull request as ready for review November 15, 2026 18:00
@uniqueg
uniqueg requested a review from AnonymousXC as a code owner November 15, 2026 18:00
@sourcery-ai

sourcery-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 3a57694

#52 feat: add a Helm chart and document deployment · 7 of 8 met

# Requirement Status Notes
1 Provide a generic Helm chart with required deployment settings and login-provider secrets from an existing Kubernetes Secret. ✅ Met The chart requires the host or app origin, registry URL, and Secret name, and supports configurable identity providers.
2 Use the organization image published by CI. ✅ Met The chart defaults to docker.io/elixircloud/krini.
3 Keep deployment-specific files, personal images, and deployment values out of the repository. ✅ Met The chart uses generic values and the documented examples use placeholders.
4 Use runtime configuration with generic variable names and provide a neutral .env.example. ✅ Met The chart maps generic values to runtime environment variables; the repository has a neutral .env.example.
5 Document local development, configuration, container and Helm installation, and service-side prerequisites. ✅ Met The README links to the development and operator guides; the chart guide covers installation and service prerequisites.
6 Keep worked deployment examples in central deployment instructions, not in repository defaults. ✅ Met The chart and values use generic placeholders rather than deployment-specific settings.
7 Lint and render-test the chart in CI. ✅ Met The new chart job runs strict linting and deployment/tests/test-chart.sh.
8 Let a new operator deploy Krini with the chart and README alone. 🟡 Partly met The README quick-start commands use a placeholder namespace but do not create it, so they fail on a fresh cluster unless that namespace already exists.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 13 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="deployment/templates/networkpolicy.yaml" line_range="12-13" />
<code_context>
+*/ -}}
+{{- $policy := .Values.krini.networkPolicy -}}
+{{- if $policy.enabled -}}
+{{- if not $policy.ingressFrom -}}
+{{- fail "krini.networkPolicy.ingressFrom must list at least one NetworkPolicy peer (no peers would allow all sources), e.g., the pods of the ingress controller or Gateway; set krini.networkPolicy.enabled to false to allow all sources" -}}
+{{- end -}}
+apiVersion: networking.k8s.io/v1
</code_context>
<issue_to_address>
**Empty peer admits all traffic**

When `krini.networkPolicy.enabled` is true and `krini.networkPolicy.ingressFrom` contains `{}`, the check only rejects an empty `ingressFrom` list; a peer with no selectors renders as an unrestricted source, so the NetworkPolicy allows connections from any source on Krini's port despite appearing enabled.

Reject peers without a `podSelector`, `namespaceSelector` or `ipBlock` before rendering the policy.
</issue_to_address>

### Comment 2
<location path="deployment/templates/networkpolicy.yaml" line_range="31-35" />
<code_context>
+  labels:
+    {{- include "krini.labels" . | nindent 4 }}
+spec:
+  podSelector:
+    matchLabels:
+      {{- include "krini.selectorLabels" . | nindent 6 }}
+  policyTypes:
+  - Ingress
+  ingress:
+  - from:
+      {{- toYaml $policy.ingressFrom | nindent 4 }}
+    # The test pod of `helm test`
+    - podSelector:
+        matchLabels:
+          app.kubernetes.io/name: {{ include "krini.name" . | quote }}
+          app.kubernetes.io/instance: {{ .Release.Name | quote }}
+          app.kubernetes.io/component: test
+    ports:
+    - port: {{ include "krini.port" . }}
</code_context>
<issue_to_address>
**Same-namespace pods bypass ingress allowlist**

When a tenant who can create pods in the release namespace creates one with the matching test labels, the NetworkPolicy admits any pod carrying the `app.kubernetes.io/name`, `app.kubernetes.io/instance` and `app.kubernetes.io/component: test` labels, so that pod can reach Krini on port 3000 even when it is not in `ingressFrom`; the caller sees the allowlist bypassed.

Do not use forgeable pod labels as an authorization exception; remove the test-pod peer and arrange test connectivity through an explicitly trusted path.

Also at `deployment/templates/tests/test-connection.yaml:12-13`.
</issue_to_address>

### Comment 3
<location path="deployment/templates/deployment.yaml" line_range="10" />
<code_context>
+  labels:
+    {{- include "krini.labels" . | nindent 4 }}
+spec:
+  replicas: {{ $values.replicas }}
+  revisionHistoryLimit: 10
+  selector:
</code_context>
<issue_to_address>
**Concurrent refreshes log users out**

When the chart is configured with multiple replicas and two browser tabs concurrently refresh the same rotating refresh token, with the requests handled by different pods, the successful pod records the old refresh token only in its process-local `recentRefreshSuccess` map; the other pod's replay-401 handler finds no record and deletes the authentication cookies, so the browser loses its session.

Coordinate refresh outcomes across replicas or change the replay-401 handling so one pod cannot invalidate cookies after another pod succeeds.
</issue_to_address>

### Comment 4
<location path="deployment/templates/_helpers.tpl" line_range="112-116" />
<code_context>
+Route or a proxy in front of the cluster.
+*/}}
+{{- define "krini.appOrigin" -}}
+{{- $origin := .Values.config.appOrigin -}}
+{{- if not $origin -}}
+{{- $hostName := required "hostName or config.appOrigin must be set: Krini sends users back to its origin after the login (APP_ORIGIN)" .Values.hostName -}}
+{{- $origin = printf "https://%s" $hostName -}}
+{{- end -}}
+{{- $origin -}}
+{{- end -}}
</code_context>
<issue_to_address>
**HTTP URLs break login and privacy links**

When config.appOrigin or either privacy URL is set to an http:// URL, the chart passes `config.appOrigin` through as `APP_ORIGIN`, so Krini redirects to HTTP while production cookies are secure and users cannot complete login. It also passes HTTP privacy URLs through, but `privacySettings` returns `null` for them, so the configured links are absent.

Reject HTTP values for `config.appOrigin` and both privacy URL settings.

Also at `deployment/templates/_helpers.tpl:134-135`.
</issue_to_address>

### Comment 5
<location path="deployment/templates/_helpers.tpl" line_range="112-117" />
<code_context>
+Route or a proxy in front of the cluster.
+*/}}
+{{- define "krini.appOrigin" -}}
+{{- $origin := .Values.config.appOrigin -}}
+{{- if not $origin -}}
+{{- $hostName := required "hostName or config.appOrigin must be set: Krini sends users back to its origin after the login (APP_ORIGIN)" .Values.hostName -}}
+{{- $origin = printf "https://%s" $hostName -}}
+{{- end -}}
+{{- $origin -}}
+{{- end -}}
+
</code_context>
<issue_to_address>
**App origin paths break API requests**

When config.appOrigin includes a path or trailing slash, krini uses the raw value when constructing an internal API URL, while its OIDC helper strips the path to the URL origin; the service-info page also appends its API path to the raw value. The resulting URLs do not match the app's API route, so API requests fail.

Normalize `config.appOrigin` to the URL origin before passing it to the app.
</issue_to_address>

### Comment 6
<location path="deployment/templates/_helpers.tpl" line_range="201" />
<code_context>
+emptyDir: {}
+{{- else -}}
+emptyDir:
+  sizeLimit: {{ ternary . (int64 . | toString) (kindIs "string" .) | quote }}
+{{- end -}}
+{{- end -}}
</code_context>
<issue_to_address>
**Zero cache limit passes validation**

When `krini.tmpSizeLimit` is supplied as the string `"0"` (or another zero quantity such as `"0Mi"`), the template emits `tmpSizeLimit: "0"` as the emptyDir limit; Kubernetes then has no usable space for Next.js cache writes, breaking cache-dependent requests and potentially evicting the pod.

Reject zero-valued string quantities in the schema or validate that `tmpSizeLimit` is strictly positive before rendering.
</issue_to_address>

### Comment 7
<location path="deployment/templates/deployment.yaml" line_range="36" />
<code_context>
+      containers:
+      - name: krini
+        image: {{ include "krini.image" . | quote }}
+        imagePullPolicy: {{ $values.imagePullPolicy | default "Always" }}
+        env:
+        {{- include "krini.env" . | trim | nindent 8 }}
</code_context>
<issue_to_address>
**Moving tags leave old pods running**

When the image behind a mutable tag changes but the Helm upgrade renders an unchanged pod template, kubernetes does not restart a Deployment just because a mutable tag now points to a new image. With the default `dev` tag, an upgrade that leaves the rendered pod template unchanged keeps serving the old image; `imagePullPolicy: Always` only pulls the latest image when a container starts.

Provide an explicit rollout mechanism for mutable tags, or document that operators must restart the Deployment after the image is updated.
</issue_to_address>

### Comment 8
<location path="deployment/templates/tests/test-connection.yaml" line_range="10-16" />
<code_context>
+apiVersion: v1
+kind: Pod
+metadata:
+  name: {{ printf "%s-test" (include "krini.fullname" . | trunc 58 | trimSuffix "-") | quote }}
+  labels:
+    {{- include "krini.baseLabels" . | nindent 4 }}
+    app.kubernetes.io/component: test
+  annotations:
+    helm.sh/hook: test
+    helm.sh/hook-delete-policy: before-hook-creation
+spec:
+  automountServiceAccountToken: false
</code_context>
<issue_to_address>
**Concurrent tests delete each other's Pod**

When two `helm test` commands run concurrently for the same release, the shared Pod name and `before-hook-creation` policy make the second test delete the first test's running Pod before creating its own. The first test loses its hook resource and can fail even when Krini is healthy.

Give each test run a unique Pod name or avoid deleting a still-running test Pod before creating another.
</issue_to_address>

### Comment 9
<location path="deployment/templates/tests/test-connection.yaml" line_range="16" />
<code_context>
+    app.kubernetes.io/component: test
+  annotations:
+    helm.sh/hook: test
+    helm.sh/hook-delete-policy: before-hook-creation
+spec:
+  automountServiceAccountToken: false
</code_context>
<issue_to_address>
**Uninstall leaves the test Pod**

When a release has run `helm test` and is later uninstalled, the hook policy deletes the Pod only before a later test run, and Helm does not remove hook resources as ordinary release resources. The completed Pod remains in the namespace after uninstall and can consume quota or block workloads.

Add a hook deletion policy that removes the Pod after the test completes.
</issue_to_address>

### Comment 10
<location path="deployment/tests/install-chart.sh" line_range="37" />
<code_context>
+    --wait --timeout 300s "$@"
+}
+
+kubectl create namespace "${namespace}"
+# A placeholder provider: the login isn't tested here (see `e2e/`)
+providers="$(jq -cn --arg secret "$(openssl rand -hex 16)" '[{
</code_context>
<issue_to_address>
**Quick reruns collide with namespace deletion**

When the script is rerun quickly against the same cluster and namespace after a successful run, the next script run tries to create the same namespace while the previous run's asynchronous deletion is still in progress; `kubectl create namespace` fails because that namespace still exists in terminating state, so the rerun stops before installing the chart.

Wait for namespace deletion to complete before returning, or make the script safely reuse or uniquely name its namespace.

Also at `deployment/tests/install-chart.sh:66`.
</issue_to_address>

### Comment 11
<location path="docs/operator-guide/helm-chart.md" line_range="105-117" />
<code_context>
+All values with their defaults and comments are in
+[`deployment/values.yaml`](https://github.com/elixir-cloud-aai/krini/blob/dev/deployment/values.yaml).
+
+### Configuration
+
+The chart passes Krini's settings (see [Configuration](configuration.md))
+to its container as environment variables. Empty values aren't passed, so
+that Krini's defaults apply. Changing a value restarts the pods on `helm
+upgrade`.
+
+| Value | Variable | Default |
+| --- | --- | --- |
+| `hostName` | — | none; the public host name of the Ingress, HTTPRoute or Route, e.g. `krini.example.org` |
+| `config.cloudRegistryUrl` | `CLOUD_REGISTRY_URL` | none; required |
+| `config.appOrigin` | `APP_ORIGIN` | `https://<hostName>` |
+| `config.oidcRedirectUri` | `OIDC_REDIRECT_URI` | not set: Krini uses `<APP_ORIGIN>/auth/api/callback` |
+| `config.computeAccessRequestUrl` | `COMPUTE_ACCESS_REQUEST_URL` | not set |
+| `config.privacy.controller` | `PRIVACY_CONTROLLER` | not set |
</code_context>
<issue_to_address>
**Update configuration documentation**

The chart page documents the chart's settings, but configuration.md still documents the prior LS Login and OIDC_CLIENT_* variables rather than the provider-agnostic runtime configuration. The PR defers that rewrite to #77.
</issue_to_address>

### Comment 12
<location path="docs/operator-guide/helm-chart.md" line_range="20-23" />
<code_context>
+- One way to reach Krini from outside the cluster: an ingress controller, a
+  Gateway of the [Gateway API](https://gateway-api.sigs.k8s.io/), or
+  OpenShift's router.
+- An OpenID Connect client at each login provider, with the redirect URI
+  `https://<host name>/auth/api/callback`, and a Cloud Registry with the TES
+  and WES services; see [Service configuration](deployment.md#service-configuration)
+  for what the services need.
+
+## Installation
</code_context>
<issue_to_address>
**Complete service prerequisites**

The prerequisites link to service configuration, which documents WES/TES allowlisting and CORS, but not registry and gateway client acceptance or verified registry entries. The docs also don't specify the provider scope that releases groups.
</issue_to_address>

### Comment 13
<location path="README.md" line_range="55-69" />
<code_context>
     --env-file ~/krini/settings.env docker.io/elixircloud/krini:<version>
 ```

+On Kubernetes or OpenShift, install the Helm chart in
+[`deployment/`](deployment/) instead, with the login providers in a Secret
+of your own and the settings in a values file (see [Helm
+chart][docs-helm-chart] for all steps and values), e.g. from a checkout of
+the release's tag:
+
+```bash
+kubectl create secret generic krini-login-providers -n <namespace> \
+    --from-file=login-providers=login-providers.json
+helm install krini deployment -n <namespace> \
+    --set hostName=krini.example.org \
+    --set config.cloudRegistryUrl=https://registry.example.org \
+    --set loginProviders.existingSecret=krini-login-providers \
+    --set krini.tag=<version>
+```
+
+On OpenShift, add `--set krini.ingress.enabled=false`, so that the chart
</code_context>
<issue_to_address>
**Make README setup self-contained**

The quick start gives a Secret creation command and Helm invocation, but depends on the linked operator guide for the login-provider JSON format and the full setup steps, so the README alone is insufficient.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 13 findings to address first, and a mistaken chart template or default could expose Krini through an Ingress or OpenShift Route, or weaken the pod's isolation; an unintended exposure could reveal data or access that uninstalling or reverting the chart cannot take back. The chart resources themselves can be removed, but any exposure that occurred before removal outlives the revert.

Blocking findings: deployment/templates/networkpolicy.yaml:13, deployment/templates/networkpolicy.yaml:35, deployment/templates/deployment.yaml:10, deployment/templates/_helpers.tpl:116, deployment/templates/_helpers.tpl:117, and 8 more


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread deployment/templates/networkpolicy.yaml Resolved
Comment thread deployment/templates/networkpolicy.yaml Resolved
Comment thread deployment/templates/deployment.yaml Resolved
Comment thread deployment/templates/_helpers.tpl Resolved
Comment thread deployment/templates/_helpers.tpl Resolved
Comment thread deployment/tests/install-chart.sh Resolved
Comment thread docs/operator-guide/helm-chart.md Resolved
Comment thread docs/operator-guide/helm-chart.md Resolved
Comment thread README.md Resolved
- Reject NetworkPolicy peers without selectors, and drop the label-based
  exception for the helm test pod (labels can be forged).
- APP_ORIGIN must be an https origin, the privacy URLs https URLs, and
  /tmp's limit positive.
- Document that several replicas need sticky sessions (refresh guard is
  per pod), the service prerequisites, the test pod after uninstall, and
  a provider example in the README.
- Wait for the namespace deletion in the install script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview – krini November 15, 2026 18:10 Inactive

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New gaps against the linked issues

Comment thread docs/operator-guide/helm-chart.md Resolved
@vercel
vercel Bot temporarily deployed to Preview – krini November 16, 2026 03:54 Inactive

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New gaps against the linked issues

Comment thread README.md Resolved
@AnonymousXC
AnonymousXC merged commit c782d18 into dev Nov 16, 2026
42 checks passed
@AnonymousXC
AnonymousXC deleted the feat/52-helm-chart branch November 16, 2026 04:30
uniqueg added a commit to uniqueg/krini that referenced this pull request Nov 16, 2026
elixir-cloud-aai#92 is squash-merged into dev. Conflicts in its files are resolved to
dev's version, with this branch's own changes re-applied on top, so the
diff against dev holds only the changes of elixir-cloud-aai#94.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg added a commit that referenced this pull request Nov 19, 2026
Set date-released to 2026-11-19 and reorder the CITATION.cff authors
by lines added on dev (without lock files, public/ and
src/components/ui/, as in #74). Add everything merged since the first
draft to the release notes: TES tasks with the user's token (#90),
the WES run details (#100), the minimal dashboard (#108), the Helm
chart (#92, #95), the image end-to-end tests (#99), the deployment
docs (#101), the Next.js update (#102) and the fixes #109 and #110.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
Preview – krini — 3a576949 Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add a Helm chart and document deployment

2 participants