Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions packaging/helm/openwork-ee/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,24 @@ externalSecrets:
name: external-secrets
kind: ClusterSecretStore
refreshInterval: 5m
# Every secret.keys.* value must exist as a JSON property under this trunk,
# e.g. eks/openwork/prod/den/DATABASE_URL.
# The three boot-critical keys must exist under this trunk, e.g.
# eks/openwork/prod/den/DATABASE_URL. All other keys are optional.
pathPrefix: "eks/openwork/prod/den"
```

Every property the workloads consume must exist in your provider under
`pathPrefix`, named like `secret.keys.*` values (`DATABASE_URL`,
`BETTER_AUTH_SECRET`, ...) — the chart pulls each key by name and cannot
invent missing ones. `target.deletionPolicy` defaults to `Retain`, so
uninstalling the release keeps the materialized Secret. ESO must be installed
on the destination cluster with a `SecretStore`/`ClusterSecretStore`; the
chart selects `external-secrets.io/v1` or `v1beta1` from cluster capabilities
and fails loudly at sync time if the CRDs are missing.
Only three keys must exist in your provider under `pathPrefix`:
`DATABASE_URL`, `BETTER_AUTH_SECRET`, and `DEN_DB_ENCRYPTION_KEY` — without
them the workloads cannot start, so their `remoteRef`s are required and a
missing one fails the ExternalSecret loudly. Every other `secret.keys.*` entry
is rendered `optional: true` (requires ESO ≥ 0.5.3), so a missing optional key
(`DAYTONA_API_KEY`, `SMTP_PASS`, ...) does not block the Secret — ESO skips it
and the app reads it as unset. Key names must match `secret.keys.*` values;
the chart pulls each by name and cannot rename. `target.deletionPolicy`
defaults to `Retain`, so uninstalling the release keeps the materialized
Secret. ESO must be installed on the destination cluster with a
`SecretStore`/`ClusterSecretStore`; the chart selects `external-secrets.io/v1`
or `v1beta1` from cluster capabilities and fails loudly at sync time if the
CRDs are missing.

Set optional `DATABASE_REDIS_URL` to enable Den API Redis-backed session and query caching. Set `DAYTONA_API_KEY` when `config.provisioner.mode` is `daytona`. Set `POLAR_ACCESS_TOKEN` when Polar feature gating is enabled. Set `OPENROUTER_MANAGEMENT_API_KEY` when enabling OpenWork Models management.

Expand Down
13 changes: 12 additions & 1 deletion packaging/helm/openwork-ee/templates/externalsecret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,26 @@ spec:
name: {{ include "openwork-ee.secretName" . }}
creationPolicy: {{ .Values.externalSecrets.target.creationPolicy | default "Owner" }}
deletionPolicy: {{ .Values.externalSecrets.target.deletionPolicy | default "Retain" }}
{{- /*
Only the three boot-critical keys are required in the provider; every other
entry is optional so a missing optional key (e.g. DAYTONA_API_KEY when the
provisioner is stub) does not block the whole Secret — ESO skips absent
optional keys and still materializes the Secret. Requires ESO >= 0.5.3
(remoteRef.optional), served by both v1beta1 and v1.
*/}}
{{- $requiredKeys := list "databaseUrl" "betterAuthSecret" "denDbEncryptionKey" }}
data:
{{- $prefix := .Values.externalSecrets.pathPrefix | toString | trim | trimSuffix "/" }}
{{- range $name := keys .Values.secret.keys | sortAlpha }}
{{- range $name := keys $.Values.secret.keys | sortAlpha }}
{{- $envKey := index $.Values.secret.keys $name }}
- secretKey: {{ $envKey | quote }}
remoteRef:
key: {{ printf "%s/%s" $prefix $envKey | quote }}
conversionStrategy: {{ $.Values.externalSecrets.conversionStrategy }}
decodingStrategy: {{ $.Values.externalSecrets.decodingStrategy }}
metadataPolicy: {{ $.Values.externalSecrets.metadataPolicy }}
{{- if not (has $name $requiredKeys) }}
optional: true
Comment on lines +50 to +51
{{- end }}
{{- end }}
{{- end }}
7 changes: 5 additions & 2 deletions packaging/helm/openwork-ee/tests/external-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ assert_contains "$enabled_rendered" 'key: "eks/openwork/prod/den/DEN_INITIAL_ADM
assert_count "$enabled_rendered" 'conversionStrategy: Default' 20
assert_count "$enabled_rendered" 'decodingStrategy: None' 20
assert_count "$enabled_rendered" 'metadataPolicy: None' 20
# Only the three boot-critical keys are required in the provider; the other 17
# are optional so a missing optional key does not block the whole Secret.
assert_count "$enabled_rendered" 'optional: true' 17
Comment on lines +94 to +96
# Target Secret keeps the chart secret name so envFrom/secretKeyRef wiring holds.
# 7 name: occurrences: ExternalSecret metadata.name + target.name, envFrom in
assert_count "$enabled_rendered" 'name: "openwork-ee-secret"' 7
Expand Down Expand Up @@ -133,7 +136,7 @@ secret:
YAML
padded_existing_rendered="$tmp_dir/padded-existing.yaml"
helm template openwork-ee "$chart_dir" -f "$padded_existing_values" > "$padded_existing_rendered"
assert_count "$padded_existing_rendered" 'name: padded-secret' 5
assert_count "$padded_existing_rendered" 'name: "padded-secret"' 5
assert_not_contains "$padded_existing_rendered" ' padded-secret'
assert_count "$enabled_rendered" 'helm.sh/hook-weight": "-10"' 1
assert_count "$enabled_rendered" 'helm.sh/hook-weight": "-6"' 3
Expand Down Expand Up @@ -392,6 +395,6 @@ YAML
helm template openwork-ee "$chart_dir" -f "$tmp_dir/existing-values.yaml" > "$existing_rendered"
assert_count "$existing_rendered" 'kind: Secret' 0
assert_count "$existing_rendered" 'kind: ExternalSecret' 0
assert_count "$existing_rendered" 'name: manually-managed' 5
assert_count "$existing_rendered" 'name: "manually-managed"' 5

printf 'external-secrets chart checks passed\n'