Compare commits

..
4 Commits
Author SHA1 Message Date
Cédric Verstraeten ca70077b59 Merge pull request #260 from kerberos-io/feat/hub-api-onboarding
feat(hub): organisations.mode legacy guard and organisations.onboarding (0.203.0)
2026-11-22 13:55:56 +01:00
cedricveandClaude Opus 5.5 999c7e8288 feat(hub): legacy guard also checks organisation variables in extraEnv
organisations.mode: legacy only caught ONBOARDING_ENABLED in
kerberoshub.extraEnv. It now catches every hub-api and frontend variable
behind the guarded features when kerberoshub.extraEnv turns it on:
PLANS_FILE (any value), PLANS_NEW_ORGANISATIONS, ONBOARDING_ENABLED,
RBAC_ORGANISATIONS_ENABLED, FEATURE_ORGANISATION_DELETION_ENABLED and the
frontend's FEATURE_ORGANISATION*, FEATURE_PROJECT* and
FEATURE_MEMBERS_ACCESS_PREVIEW_ENABLED. Booleans count as on for true, 1
or t (as hub-api parses them); a valueFrom cannot be read when rendering,
so it counts as on.

kerberoshub.extraEnv is the only extra-env list reaching hub-api and the
frontend; kerberoshub.audit.extraEnv only reaches hub-audit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:42:26 +00:00
cedricveandClaude Opus 5.5 fe1c4abdc5 feat(hub): organisations.mode legacy guard; move onboarding under organisations
Most installs still run the legacy setup (owner account > sub accounts >
roles, subscription and agent keys on the owner). Add a top-level
organisations block that keeps it that way by default:

- organisations.mode: legacy (default) fails the render, naming the flags,
  while any organisation feature is on: subscriptions.plans.*,
  organisations.onboarding.enabled, kerberoshub.api.rbacOrganisations and
  organisationDeletion, the kerberoshub.frontend.features.organisations.* /
  projects.* flags, and ONBOARDING_ENABLED=true in kerberoshub.extraEnv.
  custom lets every flag apply on its own, as before. It fails instead of
  overriding so an upgrade cannot silently switch features off, and
  installs with organisations already in plans or rbac mode must use custom.
- onboarding moves from kerberoshub.api.onboarding (unreleased) to
  organisations.onboarding.
- hub-api leaves ONBOARDING_* to kerberoshub.extraEnv when it sets them, so
  staging and production, which set ONBOARDING_ENABLED there, do not get
  the variable twice.

Staging and production values need organisations.mode: custom before they
move to this chart version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:28:05 +00:00
cedricveandClaude Opus 5.5 25af112d26 feat(hub): add kerberoshub.api.onboarding for ONBOARDING_ENABLED (0.203.0)
hub-api v1.11.66 reads ONBOARDING_ENABLED and ONBOARDING_ORGANISATION_CREATE,
but the chart did not set them. Add kerberoshub.api.onboarding:

- enabled (default false) sets ONBOARDING_ENABLED: /register stores only the
  account and its organisation comes at first sign-in (invitation, existing
  organisation, or a new one in rbac mode). Needs a hub-frontend with the
  onboarding page, which main does not have yet.
- organisationCreation (default true) sets ONBOARDING_ORGANISATION_CREATE;
  false makes onboarding invite-only.

The defaults match hub-api's behaviour when the variables are unset, so the
legacy sign-up (account with its own organisation, subscription and keys on
the owner) is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 09:19:00 +00:00
7 changed files with 152 additions and 1 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.202.1
version: 0.203.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
+3
View File
@@ -811,6 +811,9 @@ kerberospipeline:
| `mode` | Deployment mode: `all`, `pipeline`, or `ui`. `all` renders everything, `pipeline` only pipeline services, `ui` only hub services. | `"all"` |
| `subscriptions.plans.enabled` | Creates the `hub-plans` ConfigMap from `files/plans.yaml` (the `trial`, `community` and `enterprise` plans: gated permissions, limits and Stripe price lookup keys) and mounts it read-only at `/etc/kerberos/plans/plans.yaml` in hub-api, pipe-monitor, pipe-analysis and hub-cleanup, with `PLANS_FILE` set to that path. Plans are changed in the chart, not in values: a change adds a new version of a plan. | `false` |
| `subscriptions.plans.newOrganisations` | With `subscriptions.plans.enabled`, new organisations start in plans mode (`PLANS_NEW_ORGANISATIONS=true` on hub-api). When off, new organisations start in legacy mode and an owner or application admin switches an organisation to plans mode. | `false` |
| `organisations.mode` | `legacy` (default) keeps the deployment on owner account > sub accounts > roles, with the subscription and agent keys on the owner: the chart refuses to render while any organisation feature is on (`subscriptions.plans.*`, `organisations.onboarding.enabled`, `kerberoshub.api.rbacOrganisations.enabled`, `kerberoshub.api.organisationDeletion.enabled`, the `kerberoshub.frontend.features.organisations.*` / `projects.*` flags, and the same features set directly in `kerberoshub.extraEnv`: `PLANS_FILE`, `PLANS_NEW_ORGANISATIONS`, `ONBOARDING_ENABLED`, `RBAC_ORGANISATIONS_ENABLED`, `FEATURE_ORGANISATION_DELETION_ENABLED` and the frontend's `FEATURE_ORGANISATION*`, `FEATURE_PROJECT*` and `FEATURE_MEMBERS_ACCESS_PREVIEW_ENABLED`; a `valueFrom` for one of them counts as on) and names them. `custom` lets every organisation feature follow its own setting. Keep `custom` once an organisation has been switched to plans or rbac mode. | `legacy` |
| `organisations.onboarding.enabled` | Accounts are created without an organisation (sets `ONBOARDING_ENABLED` on hub-api): `/register` stores only the account, an invitation link can create the account it invites, and at first sign-in the account accepts an invitation, selects an organisation it belongs to or creates its own, which starts in rbac mode. Requires a hub-frontend with the onboarding page; without it, new accounts have no organisation to work in and hub-api answers `409 organisation_required`. Off keeps the legacy sign-up: `/register` creates the account with its own organisation, subscription and keys on the owner. Needs `organisations.mode: custom`. An `ONBOARDING_ENABLED` or `ONBOARDING_ORGANISATION_CREATE` already in `kerberoshub.extraEnv` takes precedence and is not set twice. | `false` |
| `organisations.onboarding.organisationCreation` | With onboarding on, an account without an organisation may create one in the onboarding step (sets `ONBOARDING_ORGANISATION_CREATE` on hub-api). `false` for invite-only deployments: such accounts can only join through an invitation. | `true` |
| `global.imageRegistry` | Global container registry override used for all images. | `""` |
| `ingress` | The ingress being used for `kerberoshub.api.url` and `kerberoshub.frontend.url`. | `"nginx"` |
| `mongodb.host` | MongoDB hostname (`'mongodb:27017'`) or mongodb replicas (`'mongodb-0:27017,mongodb-1:27017'`). | `"mongodb.mongodb"` |
+81
View File
@@ -0,0 +1,81 @@
{{/*
organisations.mode: legacy keeps the deployment on owner account > sub
accounts > roles. Fail when an organisation feature is switched on, so a
values file never half-enables organisations; custom lets every flag apply.
*/}}
{{- define "hub.organisations.validate" -}}
{{- $organisations := .Values.organisations | default dict -}}
{{- $mode := $organisations.mode | default "legacy" -}}
{{- if not (has $mode (list "legacy" "custom")) -}}
{{- fail (printf "organisations.mode must be legacy or custom, got %q" $mode) -}}
{{- end -}}
{{- if eq $mode "legacy" -}}
{{- $plans := (.Values.subscriptions | default dict).plans | default dict -}}
{{- $api := (.Values.kerberoshub | default dict).api | default dict -}}
{{- $features := ((.Values.kerberoshub | default dict).frontend | default dict).features | default dict -}}
{{- $orgUI := $features.organisations | default dict -}}
{{- $projectUI := $features.projects | default dict -}}
{{- $flags := list
(list "subscriptions.plans.enabled" $plans.enabled)
(list "subscriptions.plans.newOrganisations" $plans.newOrganisations)
(list "organisations.onboarding.enabled" ($organisations.onboarding | default dict).enabled)
(list "kerberoshub.api.rbacOrganisations.enabled" ($api.rbacOrganisations | default dict).enabled)
(list "kerberoshub.api.organisationDeletion.enabled" ($api.organisationDeletion | default dict).enabled)
(list "kerberoshub.frontend.features.organisations.enabled" $orgUI.enabled)
(list "kerberoshub.frontend.features.organisations.switcherEnabled" $orgUI.switcherEnabled)
(list "kerberoshub.frontend.features.organisations.creationEnabled" $orgUI.creationEnabled)
(list "kerberoshub.frontend.features.organisations.settingsEnabled" $orgUI.settingsEnabled)
(list "kerberoshub.frontend.features.organisations.membersAccessPreviewEnabled" $orgUI.membersAccessPreviewEnabled)
(list "kerberoshub.frontend.features.projects.enabled" $projectUI.enabled)
(list "kerberoshub.frontend.features.projects.switcherEnabled" $projectUI.switcherEnabled)
(list "kerberoshub.frontend.features.projects.creationEnabled" $projectUI.creationEnabled)
(list "kerberoshub.frontend.features.projects.settingsEnabled" $projectUI.settingsEnabled)
-}}
{{- $on := list -}}
{{- range $flags -}}
{{- if eq (index . 1 | toString | lower) "true" -}}
{{- $on = append $on (index . 0) -}}
{{- end -}}
{{- end -}}
{{- /*
The same features set directly in kerberoshub.extraEnv (hub-api and the
frontend). Booleans count when true as hub-api parses them; PLANS_FILE
counts when set. A valueFrom cannot be read here, so it counts as on.
*/ -}}
{{- $booleanEnv := list
"PLANS_NEW_ORGANISATIONS" "ONBOARDING_ENABLED" "RBAC_ORGANISATIONS_ENABLED"
"FEATURE_ORGANISATION_DELETION_ENABLED"
"FEATURE_ORGANISATIONS_ENABLED" "FEATURE_ORGANISATION_SWITCHER_ENABLED"
"FEATURE_ORGANISATION_CREATION_ENABLED" "FEATURE_ORGANISATION_SETTINGS_ENABLED"
"FEATURE_MEMBERS_ACCESS_PREVIEW_ENABLED"
"FEATURE_PROJECTS_ENABLED" "FEATURE_PROJECT_SWITCHER_ENABLED"
"FEATURE_PROJECT_CREATION_ENABLED" "FEATURE_PROJECT_SETTINGS_ENABLED"
-}}
{{- range ((.Values.kerberoshub | default dict).extraEnv | default list) -}}
{{- $name := .name | default "" | toString -}}
{{- $value := .value | default "" | toString | trim | lower -}}
{{- $label := printf "kerberoshub.extraEnv %s" $name -}}
{{- if or (eq $name "PLANS_FILE") (has $name $booleanEnv) -}}
{{- if .valueFrom -}}
{{- $on = append $on (printf "%s (valueFrom)" $label) -}}
{{- else if and (eq $name "PLANS_FILE") $value -}}
{{- $on = append $on $label -}}
{{- else if and (has $name $booleanEnv) (has $value (list "true" "1" "t")) -}}
{{- $on = append $on $label -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if $on -}}
{{- fail (printf "organisations.mode is legacy, but these organisation features are on: %s. Switch them off, or set organisations.mode: custom." (join ", " $on)) -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/* Comma-separated names in kerberoshub.extraEnv: chart-set variables they name are left out, so extraEnv keeps winning without duplicates. */}}
{{- define "hub.extraEnv.names" -}}
{{- $names := list -}}
{{- range ((.Values.kerberoshub | default dict).extraEnv | default list) -}}
{{- $names = append $names (.name | toString) -}}
{{- end -}}
{{- join "," $names -}}
{{- end -}}
@@ -442,6 +442,19 @@ spec:
- name: FEATURE_ORGANISATION_DELETION_ENABLED
value: {{ (.Values.kerberoshub.api.organisationDeletion | default dict).enabled | default false | quote }}
# Onboarding: /register creates only the account; the organisation comes at first sign-in.
# A variable already set in kerberoshub.extraEnv is left to it.
{{- $onboarding := (.Values.organisations | default dict).onboarding | default dict }}
{{- $extraEnvNames := splitList "," (include "hub.extraEnv.names" .) }}
{{- if not (has "ONBOARDING_ENABLED" $extraEnvNames) }}
- name: ONBOARDING_ENABLED
value: {{ $onboarding.enabled | default false | quote }}
{{- end }}
{{- if not (has "ONBOARDING_ORGANISATION_CREATE" $extraEnvNames) }}
- name: ONBOARDING_ORGANISATION_CREATE
value: {{ if hasKey $onboarding "organisationCreation" }}{{ $onboarding.organisationCreation | quote }}{{ else }}"true"{{ end }}
{{- end }}
# Media proxy: hide Vault/storage endpoints behind hub-api URLs.
{{- $mediaProxy := .Values.kerberoshub.api.mediaProxy | default dict }}
- name: MEDIA_PROXY_ENABLED
@@ -0,0 +1,2 @@
{{- /* Renders nothing; fails the release on an inconsistent organisations.mode. */ -}}
{{- include "hub.organisations.validate" . -}}
+25
View File
@@ -114,6 +114,31 @@
}
}
},
"organisations": {
"type": "object",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string",
"enum": ["legacy", "custom"],
"description": "legacy (default): owner account > sub accounts > roles; the chart fails while any organisation feature is on. custom: every organisation feature follows its own setting."
},
"onboarding": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"description": "ONBOARDING_ENABLED on hub-api: /register creates only the account; its organisation comes at first sign-in. Requires a hub-frontend with the onboarding page."
},
"organisationCreation": {
"type": "boolean",
"description": "ONBOARDING_ORGANISATION_CREATE on hub-api; false makes onboarding invite-only."
}
}
}
}
},
"kerberoshub": {
"type": "object",
"properties": {
+27
View File
@@ -31,6 +31,33 @@ subscriptions:
plans:
enabled: false
newOrganisations: false
###################################################################
# Organisations
###################################################################
# mode: legacy | custom
# - legacy (default): owner account > sub accounts > roles, with the
# subscription and agent keys on the owner. The chart refuses to render
# while any organisation feature is switched on: subscriptions.plans,
# organisations.onboarding, kerberoshub.api.rbacOrganisations and
# organisationDeletion, and the switcher/creation/settings flags of
# kerberoshub.frontend.features.organisations and .projects, and the
# same features set directly in kerberoshub.extraEnv (PLANS_FILE,
# PLANS_NEW_ORGANISATIONS, ONBOARDING_ENABLED, RBAC_ORGANISATIONS_ENABLED,
# FEATURE_ORGANISATION*/FEATURE_PROJECT*/FEATURE_MEMBERS_ACCESS_PREVIEW_ENABLED).
# - custom: every organisation feature follows its own setting.
# Keep custom once an organisation has been switched to plans or rbac mode:
# those organisations need the plan file and their features to keep working.
organisations:
mode: legacy
# Onboarding: /register creates only the account; its organisation comes at
# first sign-in (accept an invitation, pick an organisation it belongs to, or
# create one, which starts in rbac mode). Requires a hub-frontend with the
# onboarding page. Off keeps the legacy sign-up: /register creates the
# account with its own organisation at once. A variable already set in
# kerberoshub.extraEnv takes precedence and is not set twice.
onboarding:
enabled: false # Sets ONBOARDING_ENABLED on hub-api.
organisationCreation: true # false: accounts without an organisation can only join through an invitation (ONBOARDING_ORGANISATION_CREATE).
###########################################################################
# Image signature verification (Kyverno)
###########################################################################