From f979b0abed585c1cd7ac0bc32284e5a2bd4c9039 Mon Sep 17 00:00:00 2001 From: Martin Norbury Date: Wed, 27 Nov 2024 15:36:11 +0000 Subject: [PATCH] Add support for `CQAPI_LOCAL_ACTIVATION_KEY` --- charts/platform/README.md | 2 ++ charts/platform/README.md.gotmpl | 1 + charts/platform/templates/deployments.yaml | 7 +++++++ charts/platform/templates/secrets.yaml | 3 +++ charts/platform/values.yaml | 3 +++ 5 files changed, 16 insertions(+) diff --git a/charts/platform/README.md b/charts/platform/README.md index 23fda920..9f8525c8 100644 --- a/charts/platform/README.md +++ b/charts/platform/README.md @@ -11,6 +11,7 @@ First create a `secrets.yaml` file with the following content: ```console cat < secrets.yml ∙ platform: + activationKey: "" externalDependencies: postgresql_dsn: "" clickhouse_dsn: "" @@ -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 | diff --git a/charts/platform/README.md.gotmpl b/charts/platform/README.md.gotmpl index b18dc985..60673640 100644 --- a/charts/platform/README.md.gotmpl +++ b/charts/platform/README.md.gotmpl @@ -10,6 +10,7 @@ First create a `secrets.yaml` file with the following content: ```console cat < secrets.yml ∙ platform: + activationKey: "" externalDependencies: postgresql_dsn: "" clickhouse_dsn: "" diff --git a/charts/platform/templates/deployments.yaml b/charts/platform/templates/deployments.yaml index 29978103..11026f34 100644 --- a/charts/platform/templates/deployments.yaml +++ b/charts/platform/templates/deployments.yaml @@ -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: diff --git a/charts/platform/templates/secrets.yaml b/charts/platform/templates/secrets.yaml index 5ded9cba..e10ddcb3 100644 --- a/charts/platform/templates/secrets.yaml +++ b/charts/platform/templates/secrets.yaml @@ -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: | diff --git a/charts/platform/values.yaml b/charts/platform/values.yaml index 3cc94cd7..be0cd9a1 100644 --- a/charts/platform/values.yaml +++ b/charts/platform/values.yaml @@ -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: ""