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 0193b0b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/platform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ First create a `secrets.yaml` file with the following content:
```console
cat <<EOF > secrets.yml
∙ platform:
activationKey: "<activation>"
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
1 change: 1 addition & 0 deletions charts/platform/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ First create a `secrets.yaml` file with the following content:
```console
cat <<EOF > secrets.yml
∙ platform:
activationKey: "<activation>"
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: cq_activation_key
{{- 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 }}
cq_activation_key: {{ .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 0193b0b

Please sign in to comment.