Skip to content

Commit

Permalink
Add support for CQAPI_LOCAL_ACTIVATION_KEY
Browse files Browse the repository at this point in the history
  • Loading branch information
mnorbury committed Nov 27, 2024
1 parent f3d48ac commit 8f2506d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 2 deletions.
4 changes: 3 additions & 1 deletion charts/platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ First create a `secrets.yaml` file with the following content:

```console
cat <<EOF > secrets.yml
∙ platform:
platform:
activationKey: "<activation_key>"
externalDependencies:
postgresql_dsn: "<postgres_dsn>"
clickhouse_dsn: "<clickhouse_dsn>"
Expand All @@ -35,6 +36,7 @@ $ helm install platform -n cloudquery --create-namespace cloudquery/platform --v
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| debug.enabled | bool | `false` | Optional. Enable debug mode. |
| platform.activationKey | string | `""` | Activation key for the self-hosted platform |
| platform.containerSecurityContext | object | `{}` | Specify the container-level security context |
| platform.externalDependencies.clickhouse_dsn | string | `""` | Required: The DSN for the ClickHouse database |
| platform.externalDependencies.postgresql_dsn | string | `""` | Required: The DSN for the Postgres database |
Expand Down
3 changes: 2 additions & 1 deletion charts/platform/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ First create a `secrets.yaml` file with the following content:

```console
cat <<EOF > secrets.yml
∙ platform:
platform:
activationKey: "<activation_key>"
externalDependencies:
postgresql_dsn: "<postgres_dsn>"
clickhouse_dsn: "<clickhouse_dsn>"
Expand Down
7 changes: 7 additions & 0 deletions charts/platform/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ spec:
env:
- name: HOSTNAME
value: 0.0.0.0
{{- if .Values.platform.activationKey }}
- name: CQAPI_LOCAL_ACTIVATION_KEY
valueFrom:
secretKeyRef:
name: {{ include "platform.fullName" . }}-secrets
key: activationKey
{{- end }}
- name: CQAPI_DB_DSN
valueFrom:
secretKeyRef:
Expand Down
3 changes: 3 additions & 0 deletions charts/platform/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ metadata:
namespace: {{ .Release.Namespace }}
type: Opaque
data:
{{- if .Values.platform.activationKey }}
activationKey: {{ .Values.platform.activationKey | b64enc }}
{{- end }}
postgresqlDSN: {{ required "A valid postgres DSN is required" .Values.platform.externalDependencies.postgresql_dsn | b64enc }}
clickhouseDSN: {{ required "A valid clickhouse DSN is required" .Values.platform.externalDependencies.clickhouse_dsn | b64enc }}
jwtPrivateKey: |
Expand Down
3 changes: 3 additions & 0 deletions charts/platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ platform:
# -- Additional volumeMounts on the output Deployment definition.
volumeMounts: []

# -- Activation key for the self-hosted platform
activationKey: ""

externalDependencies:
# -- Required: The DSN for the Postgres database
postgresql_dsn: ""
Expand Down

0 comments on commit 8f2506d

Please sign in to comment.