diff --git a/.changeset/clickstack-values-key.md b/.changeset/clickstack-values-key.md new file mode 100644 index 00000000..96916b70 --- /dev/null +++ b/.changeset/clickstack-values-key.md @@ -0,0 +1,5 @@ +--- +"helm-charts": minor +--- + +feat: rename the top-level `hyperdx` values key to `clickstack`. Values files that still use `hyperdx` keep working and get a deprecation warning in the install notes; where both keys set the same value, `hyperdx` wins. diff --git a/.changeset/dashboards-include-release-namespace.md b/.changeset/dashboards-include-release-namespace.md index 27879daa..6cc2b342 100644 --- a/.changeset/dashboards-include-release-namespace.md +++ b/.changeset/dashboards-include-release-namespace.md @@ -2,4 +2,4 @@ "helm-charts": minor --- -feat: add `hyperdx.dashboards.includeReleaseNamespace` (default `true`, unchanged behaviour). Set it to `false` with `hyperdx.dashboards.namespaces: []` to confine the dashboard watcher, and its ConfigMap read access, to the listed namespaces: the chart then renders a namespaced Role and RoleBinding in each listed namespace, no ClusterRole, and nothing in the release namespace. Those objects are named `--dashboard-provisioner-scoped`, distinct from the RoleBindings the cross-namespace mode renders, so the flag can be flipped either way on an existing install: no upgrade has to change an existing RoleBinding's `roleRef`. The render fails if it is `false` with no namespaces listed, or with inline `configMaps` while the release namespace is not watched. +feat: add `clickstack.dashboards.includeReleaseNamespace` (default `true`, unchanged behaviour). Set it to `false` with `clickstack.dashboards.namespaces: []` to confine the dashboard watcher, and its ConfigMap read access, to the listed namespaces: the chart then renders a namespaced Role and RoleBinding in each listed namespace, no ClusterRole, and nothing in the release namespace. Those objects are named `--dashboard-provisioner-scoped`, distinct from the RoleBindings the cross-namespace mode renders, so the flag can be flipped either way on an existing install: no upgrade has to change an existing RoleBinding's `roleRef`. The render fails if it is `false` with no namespaces listed, or with inline `configMaps` while the release namespace is not watched. diff --git a/AGENTS.md b/AGENTS.md index e20926a7..4bf289ce 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -164,18 +164,19 @@ for Playwright. ### Template Files - Organized by component: `templates/hyperdx/`, `templates/clickhouse/`, `templates/mongodb/`, `templates/otel-collector/` +- Start every template with `{{- include "clickstack.normalizeValues" . -}}` so the deprecated `hyperdx` key is merged into `clickstack` before anything reads it - Use `nindent` for indentation in template pipelines: `{{- include "clickstack.labels" . | nindent 4 }}` - Quote string values with `| quote`; use `toYaml` for complex values - Guard optional sections with `{{- if .Values.x.y }}` blocks - Use `tpl` for values that may contain template expressions (see `clickstack.hyperdx.configmap` in `_helpers.tpl`) ### Values Structure (`values.yaml`) -- Top-level keys: `global`, `hyperdx`, `mongodb`, `clickhouse`, `additionalManifests`, `otel-collector` +- Top-level keys: `global`, `clickstack` (formerly `hyperdx`, still accepted with a deprecation warning), `mongodb`, `clickhouse`, `additionalManifests`, `otel-collector` - Document user-facing values with `# --` comments directly above each key (helm-docs format) - `make docs` omits undocumented keys (`--ignore-non-descriptions`); prefer commenting parent keys for operator/subchart passthrough specs -- `hyperdx.config` — non-sensitive env vars (ConfigMap), supports `tpl` expressions -- `hyperdx.secrets` — sensitive env vars (Secret); set to `null` to skip creation -- `hyperdx.deployment` — Deployment spec (image, replicas, resources, probes, etc.) +- `clickstack.config` — non-sensitive env vars (ConfigMap), supports `tpl` expressions +- `clickstack.secrets` — sensitive env vars (Secret); set to `null` to skip creation +- `clickstack.deployment` — Deployment spec (image, replicas, resources, probes, etc.) ### Labels - Always include common labels via `{{- include "clickstack.labels" . | nindent 4 }}` diff --git a/charts/clickstack-operators/Chart.yaml b/charts/clickstack-operators/Chart.yaml index 7aa0ed7a..cad232e0 100644 --- a/charts/clickstack-operators/Chart.yaml +++ b/charts/clickstack-operators/Chart.yaml @@ -4,7 +4,7 @@ description: >- Operator dependencies for ClickStack. Install this chart before installing clickstack/clickstack to ensure CRDs are registered. home: https://clickhouse.com/docs/use-cases/observability/clickstack -icon: https://raw.githubusercontent.com/hyperdxio/hyperdx/main/packages/app/public/favicons/clickstack/favicon.svg +icon: https://raw.githubusercontent.com/ClickHouse/ClickStack/main/packages/app/public/favicons/clickstack/favicon.svg sources: - https://github.com/ClickHouse/ClickStack-helm-charts keywords: diff --git a/charts/clickstack/Chart.yaml b/charts/clickstack/Chart.yaml index 1561f5f4..55bc172c 100644 --- a/charts/clickstack/Chart.yaml +++ b/charts/clickstack/Chart.yaml @@ -4,10 +4,10 @@ description: >- A Helm chart for ClickStack - Full-stack observability with ClickHouse, OpenTelemetry, and HyperDX home: https://clickhouse.com/docs/use-cases/observability/clickstack -icon: https://raw.githubusercontent.com/hyperdxio/hyperdx/main/packages/app/public/favicons/clickstack/favicon.svg +icon: https://raw.githubusercontent.com/ClickHouse/ClickStack/main/packages/app/public/favicons/clickstack/favicon.svg sources: - https://github.com/ClickHouse/ClickStack-helm-charts - - https://github.com/hyperdxio/hyperdx + - https://github.com/ClickHouse/ClickStack keywords: - observability - opentelemetry @@ -22,7 +22,7 @@ annotations: - name: Chart Source url: https://github.com/ClickHouse/ClickStack-helm-charts - name: Upstream Project - url: https://github.com/hyperdxio/hyperdx + url: https://github.com/ClickHouse/ClickStack - name: Upgrade Guide url: https://github.com/ClickHouse/ClickStack-helm-charts/blob/main/docs/UPGRADE.md type: application diff --git a/charts/clickstack/README.md b/charts/clickstack/README.md index 9ba97578..59f35d81 100644 --- a/charts/clickstack/README.md +++ b/charts/clickstack/README.md @@ -11,7 +11,7 @@ A Helm chart for ClickStack - Full-stack observability with ClickHouse, OpenTele ## Source Code * -* +* ## Prerequisites @@ -46,39 +46,39 @@ Documented values below. Undocumented keys (operator CRD passthrough fields, sub | Key | Type | Default | Description | |-----|------|---------|-------------| | additionalManifests | list | `[]` | Additional Kubernetes manifests deployed alongside the chart (supports tpl). See docs/ADDITIONAL-MANIFESTS.md for examples. | -| clickhouse | object | `{"cluster":{"spec":{"containerTemplate":{"image":{"repository":"clickhouse/clickhouse-server","tag":"26.8.37.168-alpine"},"resources":{"limits":{"memory":"2Gi"},"requests":{"cpu":"500m","memory":"2Gi"}}},"dataVolumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"10Gi"}}},"keeperClusterRef":{"name":"{{ include \"clickstack.clickhouse.keeper\" . }}"},"replicas":1,"settings":{"extraConfig":{"asynchronous_metric_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"keep_alive_timeout":64,"max_concurrent_queries":100,"max_connections":4096,"metric_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"part_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"query_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"text_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"}},"extraUsersConfig":{"users":{"app":{"grants":[{"query":"GRANT SHOW ON *.*, SELECT ON system.*, SELECT ON default.*, CREATE TEMPORARY TABLE ON *.*"}],"password":"{{ .Values.hyperdx.secrets.CLICKHOUSE_APP_PASSWORD }}","profile":"default"},"otelcollector":{"grants":[{"query":"GRANT SELECT,INSERT,CREATE,SHOW ON default.*"}],"password":"{{ .Values.hyperdx.secrets.CLICKHOUSE_PASSWORD }}","profile":"default"}}},"logger":{"count":10,"level":"information","size":"100M"}},"shards":1}},"enabled":true,"keeper":{"spec":{"containerTemplate":{"image":{"repository":"clickhouse/clickhouse-keeper","tag":"26.8.37.168-alpine"}},"dataVolumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"5Gi"}}},"replicas":1}},"nativePort":9000,"port":8123,"prometheus":{"enabled":true,"port":9363}}` | In-cluster ClickHouse via ClickHouseCluster CR. Set enabled: false for external ClickHouse. | -| clickhouse.cluster | object | `{"spec":{"containerTemplate":{"image":{"repository":"clickhouse/clickhouse-server","tag":"26.8.37.168-alpine"},"resources":{"limits":{"memory":"2Gi"},"requests":{"cpu":"500m","memory":"2Gi"}}},"dataVolumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"10Gi"}}},"keeperClusterRef":{"name":"{{ include \"clickstack.clickhouse.keeper\" . }}"},"replicas":1,"settings":{"extraConfig":{"asynchronous_metric_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"keep_alive_timeout":64,"max_concurrent_queries":100,"max_connections":4096,"metric_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"part_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"query_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"text_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"}},"extraUsersConfig":{"users":{"app":{"grants":[{"query":"GRANT SHOW ON *.*, SELECT ON system.*, SELECT ON default.*, CREATE TEMPORARY TABLE ON *.*"}],"password":"{{ .Values.hyperdx.secrets.CLICKHOUSE_APP_PASSWORD }}","profile":"default"},"otelcollector":{"grants":[{"query":"GRANT SELECT,INSERT,CREATE,SHOW ON default.*"}],"password":"{{ .Values.hyperdx.secrets.CLICKHOUSE_PASSWORD }}","profile":"default"}}},"logger":{"count":10,"level":"information","size":"100M"}},"shards":1}}` | ClickHouseCluster CRD spec (rendered verbatim). See ClickHouse Operator docs. | +| clickhouse | object | `{"cluster":{"spec":{"containerTemplate":{"image":{"repository":"clickhouse/clickhouse-server","tag":"26.8.37.168-alpine"},"resources":{"limits":{"memory":"2Gi"},"requests":{"cpu":"500m","memory":"2Gi"}}},"dataVolumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"10Gi"}}},"keeperClusterRef":{"name":"{{ include \"clickstack.clickhouse.keeper\" . }}"},"replicas":1,"settings":{"extraConfig":{"asynchronous_metric_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"keep_alive_timeout":64,"max_concurrent_queries":100,"max_connections":4096,"metric_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"part_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"query_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"text_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"}},"extraUsersConfig":{"users":{"app":{"grants":[{"query":"GRANT SHOW ON *.*, SELECT ON system.*, SELECT ON default.*, CREATE TEMPORARY TABLE ON *.*"}],"password":"{{ .Values.clickstack.secrets.CLICKHOUSE_APP_PASSWORD }}","profile":"default"},"otelcollector":{"grants":[{"query":"GRANT SELECT,INSERT,CREATE,SHOW ON default.*"}],"password":"{{ .Values.clickstack.secrets.CLICKHOUSE_PASSWORD }}","profile":"default"}}},"logger":{"count":10,"level":"information","size":"100M"}},"shards":1}},"enabled":true,"keeper":{"spec":{"containerTemplate":{"image":{"repository":"clickhouse/clickhouse-keeper","tag":"26.8.37.168-alpine"}},"dataVolumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"5Gi"}}},"replicas":1}},"nativePort":9000,"port":8123,"prometheus":{"enabled":true,"port":9363}}` | In-cluster ClickHouse via ClickHouseCluster CR. Set enabled: false for external ClickHouse. | +| clickhouse.cluster | object | `{"spec":{"containerTemplate":{"image":{"repository":"clickhouse/clickhouse-server","tag":"26.8.37.168-alpine"},"resources":{"limits":{"memory":"2Gi"},"requests":{"cpu":"500m","memory":"2Gi"}}},"dataVolumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"10Gi"}}},"keeperClusterRef":{"name":"{{ include \"clickstack.clickhouse.keeper\" . }}"},"replicas":1,"settings":{"extraConfig":{"asynchronous_metric_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"keep_alive_timeout":64,"max_concurrent_queries":100,"max_connections":4096,"metric_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"part_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"query_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"},"text_log":{"ttl":"event_date + INTERVAL 30 DAY DELETE"}},"extraUsersConfig":{"users":{"app":{"grants":[{"query":"GRANT SHOW ON *.*, SELECT ON system.*, SELECT ON default.*, CREATE TEMPORARY TABLE ON *.*"}],"password":"{{ .Values.clickstack.secrets.CLICKHOUSE_APP_PASSWORD }}","profile":"default"},"otelcollector":{"grants":[{"query":"GRANT SELECT,INSERT,CREATE,SHOW ON default.*"}],"password":"{{ .Values.clickstack.secrets.CLICKHOUSE_PASSWORD }}","profile":"default"}}},"logger":{"count":10,"level":"information","size":"100M"}},"shards":1}}` | ClickHouseCluster CRD spec (rendered verbatim). See ClickHouse Operator docs. | | clickhouse.keeper | object | `{"spec":{"containerTemplate":{"image":{"repository":"clickhouse/clickhouse-keeper","tag":"26.8.37.168-alpine"}},"dataVolumeClaimSpec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"5Gi"}}},"replicas":1}}` | KeeperCluster CRD spec (rendered verbatim). See ClickHouse Operator docs. | | clickhouse.nativePort | int | `9000` | Native TCP port used in connection strings. | | clickhouse.port | int | `8123` | HTTP interface port for in-cluster connections. | | clickhouse.prometheus.enabled | bool | `true` | Expose ClickHouse Prometheus metrics endpoint. | +| clickstack.autoscaling | object | `{"enabled":false,"spec":{}}` | HorizontalPodAutoscaler for HyperDX. spec is passed through verbatim (autoscaling/v2). Do not include scaleTargetRef — the chart auto-wires it. When enabled, omit deployment.replicas; disabling autoscaling reverts to deployment.replicas (default 1). | +| clickstack.config | object | `{"API_PORT":"8000","APP_PORT":"3000","CLICKHOUSE_ENDPOINT":"tcp://{{ include \"clickstack.clickhouse.svc\" . }}:{{ .Values.clickhouse.nativePort }}?dial_timeout=10s","CLICKHOUSE_PROMETHEUS_METRICS_ENDPOINT":"{{ include \"clickstack.clickhouse.svc\" . }}:{{ .Values.clickhouse.prometheus.port }}","CLICKHOUSE_SERVER_ENDPOINT":"{{ include \"clickstack.clickhouse.svc\" . }}:{{ .Values.clickhouse.nativePort }}","CLICKHOUSE_USER":"otelcollector","ENABLE_PROMQL":"{{ if .Values.clickstack.promql.enabled }}true{{ else }}false{{ end }}","FRONTEND_URL":"http://localhost:3000","HDX_EXPORTER_ENABLED":"{{ if .Values.clickstack.config.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT }}true{{ else }}false{{ end }}","HYPERDX_API_PORT":"8000","HYPERDX_APP_PORT":"3000","HYPERDX_LOG_LEVEL":"info","HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE":"default","HYPERDX_OTEL_EXPORTER_TABLES_TTL":"720h","MONGO_URI":"mongodb://hyperdx:{{ .Values.clickstack.secrets.MONGODB_PASSWORD }}@{{ include \"clickstack.mongodb.svc\" . }}:27017/hyperdx?authSource=hyperdx","NEXT_PUBLIC_ENABLE_PROMQL":"{{ if .Values.clickstack.promql.enabled }}true{{ else }}false{{ end }}","OPAMP_PORT":"4320","OPAMP_SERVER_URL":"http://{{ include \"clickstack.hyperdx.fullname\" . }}:{{ .Values.clickstack.ports.opamp }}","OTEL_EXPORTER_OTLP_ENDPOINT":"http://{{ include \"clickstack.otel.fullname\" . }}:4318","OTEL_SERVICE_NAME":"hdx-oss-api","RUN_SCHEDULED_TASKS_EXTERNALLY":"false","USAGE_STATS_ENABLED":"true"}` | Shared non-sensitive environment variables (clickstack-config ConfigMap). Used by HyperDX and OTEL collector via envFrom. Values support tpl expressions. Override entries with plain strings to point at external services. Changes to the rendered ConfigMap roll the HyperDX Deployment; the otel-collector rolls on every helm upgrade. | +| clickstack.dashboards | object | `{"configMaps":{},"enabled":false,"includeReleaseNamespace":true,"namespaces":[],"rbac":{"create":true},"resources":{"limits":{"cpu":"50m","memory":"128Mi"},"requests":{"cpu":"10m","memory":"64Mi"}},"sidecarImage":"kiwigrid/k8s-sidecar:2.10.1","sidecarPullPolicy":"IfNotPresent"}` | Dashboard provisioning: upserts dashboard JSON into MongoDB (matched by name, never deletes). Provide dashboards inline via configMaps, or label ConfigMaps hyperdx.io/dashboard: "true" for a k8s-sidecar watcher to discover. | +| clickstack.deployment | object | `{"annotations":{},"containerSecurityContext":{},"defaultConnections":"[\n {\n \"name\": \"Local ClickHouse\",\n \"host\": \"http://{{ include \"clickstack.clickhouse.svc\" . }}:8123\",\n \"port\": 8123,\n \"username\": \"app\",\n \"password\": \"{{ .Values.clickstack.secrets.CLICKHOUSE_APP_PASSWORD }}\"\n }\n]\n","defaultSources":"[\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"otel_logs\"\n },\n \"kind\": \"log\",\n \"timestampValueExpression\": \"Timestamp\",\n \"name\": \"Logs\",\n \"displayedTimestampValueExpression\": \"Timestamp\",\n \"implicitColumnExpression\": \"Body\",\n \"serviceNameExpression\": \"ServiceName\",\n \"bodyExpression\": \"Body\",\n \"eventAttributesExpression\": \"LogAttributes\",\n \"resourceAttributesExpression\": \"ResourceAttributes\",\n \"defaultTableSelectExpression\": \"Timestamp,ServiceName,SeverityText,Body\",\n \"severityTextExpression\": \"SeverityText\",\n \"traceIdExpression\": \"TraceId\",\n \"spanIdExpression\": \"SpanId\",\n \"connection\": \"Local ClickHouse\",\n \"traceSourceId\": \"Traces\",\n \"metricSourceId\": \"Metrics\"\n },\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"otel_traces\"\n },\n \"kind\": \"trace\",\n \"timestampValueExpression\": \"Timestamp\",\n \"name\": \"Traces\",\n \"displayedTimestampValueExpression\": \"Timestamp\",\n \"implicitColumnExpression\": \"SpanName\",\n \"serviceNameExpression\": \"ServiceName\",\n \"eventAttributesExpression\": \"SpanAttributes\",\n \"resourceAttributesExpression\": \"ResourceAttributes\",\n \"defaultTableSelectExpression\": \"Timestamp,ServiceName,StatusCode,round(Duration/1e6),SpanName\",\n \"traceIdExpression\": \"TraceId\",\n \"spanIdExpression\": \"SpanId\",\n \"durationExpression\": \"Duration\",\n \"durationPrecision\": 9,\n \"parentSpanIdExpression\": \"ParentSpanId\",\n \"spanNameExpression\": \"SpanName\",\n \"spanKindExpression\": \"SpanKind\",\n \"statusCodeExpression\": \"StatusCode\",\n \"statusMessageExpression\": \"StatusMessage\",\n \"spanEventsValueExpression\": \"Events\",\n \"spanLinksValueExpression\": \"Links\",\n \"connection\": \"Local ClickHouse\",\n \"logSourceId\": \"Logs\",\n \"sessionSourceId\": \"Sessions\",\n \"metricSourceId\": \"Metrics\"\n },\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"\"\n },\n \"kind\": \"metric\",\n \"timestampValueExpression\": \"TimeUnix\",\n \"name\": \"Metrics\",\n \"resourceAttributesExpression\": \"ResourceAttributes\",\n \"metricTables\": {\n \"gauge\": \"otel_metrics_gauge\",\n \"histogram\": \"otel_metrics_histogram\",\n \"sum\": \"otel_metrics_sum\",\n \"summary\": \"otel_metrics_summary\",\n \"exponential histogram\": \"otel_metrics_exponential_histogram\"\n },\n \"connection\": \"Local ClickHouse\",\n \"logSourceId\": \"Logs\"\n },\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"hyperdx_sessions\"\n },\n \"kind\": \"session\",\n \"timestampValueExpression\": \"TimestampTime\",\n \"name\": \"Sessions\",\n \"resourceAttributesExpression\": \"ResourceAttributes\",\n \"connection\": \"Local ClickHouse\",\n \"traceSourceId\": \"Traces\"\n },\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"metrics_ts\"\n },\n \"kind\": \"promql\",\n \"timestampValueExpression\": \"timestamp\",\n \"name\": \"PromQL\",\n \"connection\": \"Local ClickHouse\"\n }\n]\n","deploymentAnnotations":{},"env":[],"existingConfigConnectionsKey":"connections.json","existingConfigSecret":"","existingConfigSourcesKey":"sources.json","image":{"pullPolicy":"IfNotPresent","repository":"docker.hyperdx.io/hyperdx/hyperdx","tag":null},"initContainers":[],"labels":{},"livenessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":10,"path":"/health","periodSeconds":30,"timeoutSeconds":5},"nodeSelector":{},"podAnnotations":{},"podLabels":{},"podSecurityContext":{},"priorityClassName":"","readinessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":1,"path":"/ready","periodSeconds":10,"timeoutSeconds":5},"replicas":1,"resources":{},"tolerations":[],"topologySpreadConstraints":[],"useExistingConfigSecret":false,"volumeMounts":[],"volumes":[],"waitForMongodb":{"image":"busybox@sha256:1fcf5df59121b92d61e066df1788e8df0cc35623f5d62d9679a41e163b6a0cdb","pullPolicy":"IfNotPresent"}}` | HyperDX Deployment spec (image, probes, scheduling, init containers, volumes). defaultConnections/defaultSources JSON: set to "" to disable; use useExistingConfigSecret for external secrets. | +| clickstack.deployment.env | list | `[]` | Extra environment variables for the HyperDX container, rendered verbatim (supports `valueFrom`, e.g. `secretKeyRef`). | +| clickstack.deployment.existingConfigSecret | string | `""` | Secret containing connections and sources JSON when useExistingConfigSecret is true. | +| clickstack.deployment.image.repository | string | `"docker.hyperdx.io/hyperdx/hyperdx"` | HyperDX container image repository. | +| clickstack.deployment.image.tag | string | `nil` | Image tag. Defaults to Chart appVersion when empty. | +| clickstack.deployment.initContainers | list | `[]` | Additional init containers to run before the HyperDX container starts. | +| clickstack.deployment.replicas | int | `1` | Pod replica count. Ignored when clickstack.autoscaling.enabled is true. | +| clickstack.deployment.useExistingConfigSecret | bool | `false` | Load HyperDX connections JSON from an existing Secret instead of defaultConnections. | +| clickstack.deployment.volumeMounts | list | `[]` | Additional volume mounts for the HyperDX container. | +| clickstack.deployment.volumes | list | `[]` | Additional volumes to attach to the pod. | +| clickstack.ingress | object | `{"additionalIngresses":[],"annotations":{},"enabled":false,"spec":{}}` | Ingress for HyperDX. annotations and spec are rendered verbatim (nginx, ALB, Traefik, etc.). Use additionalIngresses for multi-ingress setups (e.g. separate OTEL collector ingress). | +| clickstack.networkPolicy | object | `{"enabled":false,"spec":{}}` | NetworkPolicy for HyperDX. spec is passed through verbatim. | +| clickstack.podDisruptionBudget | object | `{"enabled":false}` | PodDisruptionBudget for the HyperDX Deployment. Defaults to maxUnavailable: 1, which never blocks a node drain; set minAvailable or maxUnavailable to override. | +| clickstack.ports | object | `{"api":8000,"app":3000,"opamp":4320}` | Ports shared across Deployment, Service, ConfigMap, and Ingress. | +| clickstack.promql | object | `{"enabled":true}` | PromQL support. Turns on the HyperDX PromQL UI and API, adds the PromQL default source, and configures ClickHouse with Prometheus remote write/read handlers, the `prometheus_api_v1` HTTP handler and `allow_experimental_time_series_table` (an experimental ClickHouse setting). The ClickHouse part needs ClickHouse 26.6 or newer and is skipped when `clickhouse.cluster.spec.containerTemplate.image.tag` is an older version. | +| clickstack.secrets | object | `{"CLICKHOUSE_APP_PASSWORD":"hyperdx","CLICKHOUSE_PASSWORD":"otelcollectorpass","HYPERDX_API_KEY":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","MONGODB_PASSWORD":"hyperdx"}` | Shared sensitive environment variables (clickstack-secret). Set to null to skip Secret creation (requires mongodb, clickhouse, and otel-collector disabled). Changes to this Secret roll the HyperDX Deployment; the otel-collector rolls on every helm upgrade. External Secrets need a manual rollout. | +| clickstack.service | object | `{"annotations":{},"apiPort":{"enabled":false},"type":"ClusterIP"}` | HyperDX Service (ClusterIP by default). | +| clickstack.service.apiPort | object | `{"enabled":false}` | Expose the API port (8000) on the Service for API-only or direct API access. | +| clickstack.serviceAccount | object | `{"annotations":{},"create":false,"name":""}` | ServiceAccount for HyperDX. Set create: true to provision one; use annotations for IRSA/GCP bindings. | +| clickstack.serviceAccount.name | string | `""` | ServiceAccount name. Defaults to chart fullname when create is true and name is empty. | +| clickstack.tasks | object | `{"checkAlerts":{"additionalArgs":{},"resources":{"limits":{"cpu":"200m","memory":"256Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"schedule":"*/1 * * * *"},"enabled":false}` | Scheduled HyperDX background tasks (CronJobs). | | global | object | `{"imagePullSecrets":[],"imageRegistry":"","otelCollector":{"customConfig":""}}` | Global defaults applied across chart workloads. | | global.imagePullSecrets | list | `[]` | Image pull secrets for private registries. Helps avoid Docker Hub rate limits. | | global.imageRegistry | string | `""` | Optional prefix for container images (e.g. registry.example.com/). | -| hyperdx.autoscaling | object | `{"enabled":false,"spec":{}}` | HorizontalPodAutoscaler for HyperDX. spec is passed through verbatim (autoscaling/v2). Do not include scaleTargetRef — the chart auto-wires it. When enabled, omit deployment.replicas; disabling autoscaling reverts to deployment.replicas (default 1). | -| hyperdx.config | object | `{"API_PORT":"8000","APP_PORT":"3000","CLICKHOUSE_ENDPOINT":"tcp://{{ include \"clickstack.clickhouse.svc\" . }}:{{ .Values.clickhouse.nativePort }}?dial_timeout=10s","CLICKHOUSE_PROMETHEUS_METRICS_ENDPOINT":"{{ include \"clickstack.clickhouse.svc\" . }}:{{ .Values.clickhouse.prometheus.port }}","CLICKHOUSE_SERVER_ENDPOINT":"{{ include \"clickstack.clickhouse.svc\" . }}:{{ .Values.clickhouse.nativePort }}","CLICKHOUSE_USER":"otelcollector","ENABLE_PROMQL":"{{ if .Values.hyperdx.promql.enabled }}true{{ else }}false{{ end }}","FRONTEND_URL":"http://localhost:3000","HDX_EXPORTER_ENABLED":"{{ if .Values.hyperdx.config.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT }}true{{ else }}false{{ end }}","HYPERDX_API_PORT":"8000","HYPERDX_APP_PORT":"3000","HYPERDX_LOG_LEVEL":"info","HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE":"default","HYPERDX_OTEL_EXPORTER_TABLES_TTL":"720h","MONGO_URI":"mongodb://hyperdx:{{ .Values.hyperdx.secrets.MONGODB_PASSWORD }}@{{ include \"clickstack.mongodb.svc\" . }}:27017/hyperdx?authSource=hyperdx","NEXT_PUBLIC_ENABLE_PROMQL":"{{ if .Values.hyperdx.promql.enabled }}true{{ else }}false{{ end }}","OPAMP_PORT":"4320","OPAMP_SERVER_URL":"http://{{ include \"clickstack.hyperdx.fullname\" . }}:{{ .Values.hyperdx.ports.opamp }}","OTEL_EXPORTER_OTLP_ENDPOINT":"http://{{ include \"clickstack.otel.fullname\" . }}:4318","OTEL_SERVICE_NAME":"hdx-oss-api","RUN_SCHEDULED_TASKS_EXTERNALLY":"false","USAGE_STATS_ENABLED":"true"}` | Shared non-sensitive environment variables (clickstack-config ConfigMap). Used by HyperDX and OTEL collector via envFrom. Values support tpl expressions. Override entries with plain strings to point at external services. Changes to the rendered ConfigMap roll the HyperDX Deployment; the otel-collector rolls on every helm upgrade. | -| hyperdx.dashboards | object | `{"configMaps":{},"enabled":false,"includeReleaseNamespace":true,"namespaces":[],"rbac":{"create":true},"resources":{"limits":{"cpu":"50m","memory":"128Mi"},"requests":{"cpu":"10m","memory":"64Mi"}},"sidecarImage":"kiwigrid/k8s-sidecar:2.10.1","sidecarPullPolicy":"IfNotPresent"}` | Dashboard provisioning: upserts dashboard JSON into MongoDB (matched by name, never deletes). Provide dashboards inline via configMaps, or label ConfigMaps hyperdx.io/dashboard: "true" for a k8s-sidecar watcher to discover. | -| hyperdx.deployment | object | `{"annotations":{},"containerSecurityContext":{},"defaultConnections":"[\n {\n \"name\": \"Local ClickHouse\",\n \"host\": \"http://{{ include \"clickstack.clickhouse.svc\" . }}:8123\",\n \"port\": 8123,\n \"username\": \"app\",\n \"password\": \"{{ .Values.hyperdx.secrets.CLICKHOUSE_APP_PASSWORD }}\"\n }\n]\n","defaultSources":"[\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"otel_logs\"\n },\n \"kind\": \"log\",\n \"timestampValueExpression\": \"Timestamp\",\n \"name\": \"Logs\",\n \"displayedTimestampValueExpression\": \"Timestamp\",\n \"implicitColumnExpression\": \"Body\",\n \"serviceNameExpression\": \"ServiceName\",\n \"bodyExpression\": \"Body\",\n \"eventAttributesExpression\": \"LogAttributes\",\n \"resourceAttributesExpression\": \"ResourceAttributes\",\n \"defaultTableSelectExpression\": \"Timestamp,ServiceName,SeverityText,Body\",\n \"severityTextExpression\": \"SeverityText\",\n \"traceIdExpression\": \"TraceId\",\n \"spanIdExpression\": \"SpanId\",\n \"connection\": \"Local ClickHouse\",\n \"traceSourceId\": \"Traces\",\n \"metricSourceId\": \"Metrics\"\n },\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"otel_traces\"\n },\n \"kind\": \"trace\",\n \"timestampValueExpression\": \"Timestamp\",\n \"name\": \"Traces\",\n \"displayedTimestampValueExpression\": \"Timestamp\",\n \"implicitColumnExpression\": \"SpanName\",\n \"serviceNameExpression\": \"ServiceName\",\n \"eventAttributesExpression\": \"SpanAttributes\",\n \"resourceAttributesExpression\": \"ResourceAttributes\",\n \"defaultTableSelectExpression\": \"Timestamp,ServiceName,StatusCode,round(Duration/1e6),SpanName\",\n \"traceIdExpression\": \"TraceId\",\n \"spanIdExpression\": \"SpanId\",\n \"durationExpression\": \"Duration\",\n \"durationPrecision\": 9,\n \"parentSpanIdExpression\": \"ParentSpanId\",\n \"spanNameExpression\": \"SpanName\",\n \"spanKindExpression\": \"SpanKind\",\n \"statusCodeExpression\": \"StatusCode\",\n \"statusMessageExpression\": \"StatusMessage\",\n \"spanEventsValueExpression\": \"Events\",\n \"spanLinksValueExpression\": \"Links\",\n \"connection\": \"Local ClickHouse\",\n \"logSourceId\": \"Logs\",\n \"sessionSourceId\": \"Sessions\",\n \"metricSourceId\": \"Metrics\"\n },\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"\"\n },\n \"kind\": \"metric\",\n \"timestampValueExpression\": \"TimeUnix\",\n \"name\": \"Metrics\",\n \"resourceAttributesExpression\": \"ResourceAttributes\",\n \"metricTables\": {\n \"gauge\": \"otel_metrics_gauge\",\n \"histogram\": \"otel_metrics_histogram\",\n \"sum\": \"otel_metrics_sum\",\n \"summary\": \"otel_metrics_summary\",\n \"exponential histogram\": \"otel_metrics_exponential_histogram\"\n },\n \"connection\": \"Local ClickHouse\",\n \"logSourceId\": \"Logs\"\n },\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"hyperdx_sessions\"\n },\n \"kind\": \"session\",\n \"timestampValueExpression\": \"TimestampTime\",\n \"name\": \"Sessions\",\n \"resourceAttributesExpression\": \"ResourceAttributes\",\n \"connection\": \"Local ClickHouse\",\n \"traceSourceId\": \"Traces\"\n },\n {\n \"from\": {\n \"databaseName\": \"default\",\n \"tableName\": \"metrics_ts\"\n },\n \"kind\": \"promql\",\n \"timestampValueExpression\": \"timestamp\",\n \"name\": \"PromQL\",\n \"connection\": \"Local ClickHouse\"\n }\n]\n","deploymentAnnotations":{},"env":[],"existingConfigConnectionsKey":"connections.json","existingConfigSecret":"","existingConfigSourcesKey":"sources.json","image":{"pullPolicy":"IfNotPresent","repository":"docker.hyperdx.io/hyperdx/hyperdx","tag":null},"initContainers":[],"labels":{},"livenessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":10,"path":"/health","periodSeconds":30,"timeoutSeconds":5},"nodeSelector":{},"podAnnotations":{},"podLabels":{},"podSecurityContext":{},"priorityClassName":"","readinessProbe":{"enabled":true,"failureThreshold":3,"initialDelaySeconds":1,"path":"/ready","periodSeconds":10,"timeoutSeconds":5},"replicas":1,"resources":{},"tolerations":[],"topologySpreadConstraints":[],"useExistingConfigSecret":false,"volumeMounts":[],"volumes":[],"waitForMongodb":{"image":"busybox@sha256:1fcf5df59121b92d61e066df1788e8df0cc35623f5d62d9679a41e163b6a0cdb","pullPolicy":"IfNotPresent"}}` | HyperDX Deployment spec (image, probes, scheduling, init containers, volumes). defaultConnections/defaultSources JSON: set to "" to disable; use useExistingConfigSecret for external secrets. | -| hyperdx.deployment.env | list | `[]` | Extra environment variables for the HyperDX container, rendered verbatim (supports `valueFrom`, e.g. `secretKeyRef`). | -| hyperdx.deployment.existingConfigSecret | string | `""` | Secret containing connections and sources JSON when useExistingConfigSecret is true. | -| hyperdx.deployment.image.repository | string | `"docker.hyperdx.io/hyperdx/hyperdx"` | HyperDX container image repository. | -| hyperdx.deployment.image.tag | string | `nil` | Image tag. Defaults to Chart appVersion when empty. | -| hyperdx.deployment.initContainers | list | `[]` | Additional init containers to run before the HyperDX container starts. | -| hyperdx.deployment.replicas | int | `1` | Pod replica count. Ignored when hyperdx.autoscaling.enabled is true. | -| hyperdx.deployment.useExistingConfigSecret | bool | `false` | Load HyperDX connections JSON from an existing Secret instead of defaultConnections. | -| hyperdx.deployment.volumeMounts | list | `[]` | Additional volume mounts for the HyperDX container. | -| hyperdx.deployment.volumes | list | `[]` | Additional volumes to attach to the pod. | -| hyperdx.ingress | object | `{"additionalIngresses":[],"annotations":{},"enabled":false,"spec":{}}` | Ingress for HyperDX. annotations and spec are rendered verbatim (nginx, ALB, Traefik, etc.). Use additionalIngresses for multi-ingress setups (e.g. separate OTEL collector ingress). | -| hyperdx.networkPolicy | object | `{"enabled":false,"spec":{}}` | NetworkPolicy for HyperDX. spec is passed through verbatim. | -| hyperdx.podDisruptionBudget | object | `{"enabled":false}` | PodDisruptionBudget for the HyperDX Deployment. Defaults to maxUnavailable: 1, which never blocks a node drain; set minAvailable or maxUnavailable to override. | -| hyperdx.ports | object | `{"api":8000,"app":3000,"opamp":4320}` | Ports shared across Deployment, Service, ConfigMap, and Ingress. | -| hyperdx.promql | object | `{"enabled":true}` | PromQL support. Turns on the HyperDX PromQL UI and API, adds the PromQL default source, and configures ClickHouse with Prometheus remote write/read handlers, the `prometheus_api_v1` HTTP handler and `allow_experimental_time_series_table` (an experimental ClickHouse setting). The ClickHouse part needs ClickHouse 26.6 or newer and is skipped when `clickhouse.cluster.spec.containerTemplate.image.tag` is an older version. | -| hyperdx.secrets | object | `{"CLICKHOUSE_APP_PASSWORD":"hyperdx","CLICKHOUSE_PASSWORD":"otelcollectorpass","HYPERDX_API_KEY":"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx","MONGODB_PASSWORD":"hyperdx"}` | Shared sensitive environment variables (clickstack-secret). Set to null to skip Secret creation (requires mongodb, clickhouse, and otel-collector disabled). Changes to this Secret roll the HyperDX Deployment; the otel-collector rolls on every helm upgrade. External Secrets need a manual rollout. | -| hyperdx.service | object | `{"annotations":{},"apiPort":{"enabled":false},"type":"ClusterIP"}` | HyperDX Service (ClusterIP by default). | -| hyperdx.service.apiPort | object | `{"enabled":false}` | Expose the API port (8000) on the Service for API-only or direct API access. | -| hyperdx.serviceAccount | object | `{"annotations":{},"create":false,"name":""}` | ServiceAccount for HyperDX. Set create: true to provision one; use annotations for IRSA/GCP bindings. | -| hyperdx.serviceAccount.name | string | `""` | ServiceAccount name. Defaults to chart fullname when create is true and name is empty. | -| hyperdx.tasks | object | `{"checkAlerts":{"additionalArgs":{},"resources":{"limits":{"cpu":"200m","memory":"256Mi"},"requests":{"cpu":"100m","memory":"128Mi"}},"schedule":"*/1 * * * *"},"enabled":false}` | Scheduled HyperDX background tasks (CronJobs). | | mongodb | object | `{"enabled":true,"spec":{"additionalMongodConfig":{"storage.wiredTiger.engineConfig.journalCompressor":"zlib"},"members":1,"security":{"authentication":{"modes":["SCRAM"]}},"type":"ReplicaSet","users":[{"db":"hyperdx","name":"hyperdx","passwordSecretRef":{"name":"{{ include \"clickstack.mongodb.fullname\" . }}-password"},"roles":[{"db":"hyperdx","name":"dbOwner"},{"db":"admin","name":"clusterMonitor"}],"scramCredentialsSecretName":"{{ include \"clickstack.mongodb.fullname\" . }}-scram"}],"version":"5.0.32"}}` | In-cluster MongoDB via MongoDBCommunity CR. Set enabled: false for external MongoDB. | | mongodb.spec | object | `{"additionalMongodConfig":{"storage.wiredTiger.engineConfig.journalCompressor":"zlib"},"members":1,"security":{"authentication":{"modes":["SCRAM"]}},"type":"ReplicaSet","users":[{"db":"hyperdx","name":"hyperdx","passwordSecretRef":{"name":"{{ include \"clickstack.mongodb.fullname\" . }}-password"},"roles":[{"db":"hyperdx","name":"dbOwner"},{"db":"admin","name":"clusterMonitor"}],"scramCredentialsSecretName":"{{ include \"clickstack.mongodb.fullname\" . }}-scram"}],"version":"5.0.32"}` | MongoDBCommunity CRD spec (rendered verbatim). See MongoDB Kubernetes Operator docs. | | otel-collector | object | `{"enabled":true,"extraEnvsFrom":[{"configMapRef":{"name":"clickstack-config"}},{"secretRef":{"name":"clickstack-secret"}}],"extraVolumeMounts":[{"mountPath":"/etc/otelcol-contrib/custom","name":"custom-config","readOnly":true}],"extraVolumes":[{"configMap":{"name":"clickstack-otel-custom-config","optional":true},"name":"custom-config"}],"image":{"repository":"docker.clickhouse.com/clickhouse/clickstack-otel-collector","tag":"2.46.0"},"mode":"deployment","podAnnotations":{"checksum/custom-config":"{{ .Values.global.otelCollector.customConfig | default \"\" | sha256sum }}","rollout/release-revision":"{{ .Release.Revision }}"},"ports":{"fluentd":{"containerPort":24225,"enabled":true,"protocol":"TCP","servicePort":24225},"health-check":{"containerPort":13133,"enabled":true,"protocol":"TCP","servicePort":13133},"jaeger-compact":{"enabled":false},"jaeger-grpc":{"enabled":false},"jaeger-thrift":{"enabled":false},"metrics":{"containerPort":8888,"enabled":true,"protocol":"TCP","servicePort":8888},"otlp":{"appProtocol":"grpc","containerPort":4317,"enabled":true,"protocol":"TCP","servicePort":4317},"otlp-http":{"containerPort":4318,"enabled":true,"protocol":"TCP","servicePort":4318},"zipkin":{"enabled":false}}}` | OpenTelemetry Collector subchart. Set enabled: false to use an external collector. | diff --git a/charts/clickstack/templates/NOTES.txt b/charts/clickstack/templates/NOTES.txt index 988d717f..85ff5755 100644 --- a/charts/clickstack/templates/NOTES.txt +++ b/charts/clickstack/templates/NOTES.txt @@ -1,3 +1,4 @@ +{{- include "clickstack.normalizeValues" . -}} ClickStack has been installed. By default, this chart deploys the full ClickStack platform: HyperDX, ClickHouse @@ -11,10 +12,10 @@ To disable a built-in component, set its enabled flag to false: --set mongodb.enabled=false \ --set otel-collector.enabled=false -When disabling a component, override the corresponding endpoints in hyperdx.config +When disabling a component, override the corresponding endpoints in clickstack.config to point at your external service (e.g. CLICKHOUSE_ENDPOINT, MONGO_URI). -{{- if .Values.hyperdx.ingress.enabled }} +{{- if .Values.clickstack.ingress.enabled }} Ingress is enabled. Check your ingress resource for the configured host: kubectl get ingress -l "app.kubernetes.io/name={{ include "clickstack.name" . }}" {{- else }} @@ -23,20 +24,20 @@ Application Access: Choose one of the following access methods: 1. Enable Ingress (Recommended for Production): - Configure hyperdx.ingress with your annotations and spec. + Configure clickstack.ingress with your annotations and spec. See the chart documentation for nginx and ALB examples. 2. Port Forward (Development/Testing): - kubectl port-forward svc/{{ include "clickstack.hyperdx.fullname" . }} {{ .Values.hyperdx.ports.app }}:{{ .Values.hyperdx.ports.app }} - Then access: http://localhost:{{ .Values.hyperdx.ports.app }} + kubectl port-forward svc/{{ include "clickstack.hyperdx.fullname" . }} {{ .Values.clickstack.ports.app }}:{{ .Values.clickstack.ports.app }} + Then access: http://localhost:{{ .Values.clickstack.ports.app }} Note: This application handles sensitive telemetry data and should not be exposed directly to the internet without proper authentication and encryption. {{- end }} -{{- if and (default (dict) .Values.hyperdx.dashboards).enabled (ne (include "clickstack.hyperdx.dashboardsRbacCreate" .) "true") }} +{{- if and (default (dict) .Values.clickstack.dashboards).enabled (ne (include "clickstack.hyperdx.dashboardsRbacCreate" .) "true") }} -WARNING: hyperdx.dashboards.rbac.create is false. The dashboard watcher needs +WARNING: clickstack.dashboards.rbac.create is false. The dashboard watcher needs read access (list/get/watch) to ConfigMaps in its discovery scope. Grant it out-of-band (e.g. a Role/RoleBinding bound to the HyperDX ServiceAccount) before installing: without it the watcher fails its startup sync and @@ -50,3 +51,10 @@ To verify the deployment status, run: Production hardening (Ingress controller pinning, NetworkPolicy, resource limits): https://github.com/ClickHouse/ClickStack-helm-charts/blob/main/docs/SECURITY-HARDENING.md +{{- if .Values.hyperdxKeyUsed }} + +WARNING: the top-level hyperdx values key is deprecated and will be removed in a +future chart version. Move those settings under clickstack. While both are set, +hyperdx wins wherever they set the same value. --reuse-values keeps the stored +hyperdx values, so upgrade with -f when you move them. +{{- end }} diff --git a/charts/clickstack/templates/_helpers.tpl b/charts/clickstack/templates/_helpers.tpl index 8204f827..df8b67a3 100644 --- a/charts/clickstack/templates/_helpers.tpl +++ b/charts/clickstack/templates/_helpers.tpl @@ -21,6 +21,39 @@ Create a default fully qualified app name. {{- end }} {{- end }} +{{/* +Accept the deprecated top-level `hyperdx` values key: overlay it onto `clickstack` (hyperdx wins, and a +null deletes the key as a Helm override would), then alias `hyperdx` to the result so tpl strings that +still read .Values.hyperdx keep working. Every template includes this first; only the first call acts. +*/}} +{{- define "clickstack.normalizeValues" -}} +{{- if not (hasKey .Values "hyperdxKeyUsed") -}} +{{- $legacy := .Values.hyperdx -}} +{{- $_ := set .Values "hyperdxKeyUsed" (kindIs "map" $legacy) -}} +{{- /* --reuse-values from a release made before the rename has hyperdx values but no clickstack defaults. */ -}} +{{- if not (kindIs "map" .Values.clickstack) -}} +{{- $_ = set .Values "clickstack" dict -}} +{{- end -}} +{{- if kindIs "map" $legacy -}} +{{- include "clickstack.overlayValues" (dict "dst" .Values.clickstack "src" $legacy) -}} +{{- end -}} +{{- $_ = set .Values "hyperdx" .Values.clickstack -}} +{{- end -}} +{{- end -}} + +{{- define "clickstack.overlayValues" -}} +{{- $dst := .dst -}} +{{- range $key, $value := .src -}} +{{- if kindIs "invalid" $value -}} +{{- $_ := unset $dst $key -}} +{{- else if and (kindIs "map" $value) (kindIs "map" (index $dst $key)) -}} +{{- include "clickstack.overlayValues" (dict "dst" (index $dst $key) "src" $value) -}} +{{- else -}} +{{- $_ := set $dst $key $value -}} +{{- end -}} +{{- end -}} +{{- end -}} + {{/* HyperDX app resource name. When fullnameOverride is set the user expects full control over naming, so the -app suffix is omitted. Without the override the @@ -39,7 +72,7 @@ HyperDX ServiceAccount name. Shared by the Deployment, ServiceAccount, and dashboard-provisioner RBAC subject so the three can never drift out of sync. */}} {{- define "clickstack.hyperdx.serviceAccountName" -}} -{{- .Values.hyperdx.serviceAccount.name | default (include "clickstack.hyperdx.fullname" .) -}} +{{- .Values.clickstack.serviceAccount.name | default (include "clickstack.hyperdx.fullname" .) -}} {{- end -}} {{/* @@ -67,44 +100,44 @@ user's setting (passwords, replicas, opt-outs) would fall back to the default. {{- $removed := dict "global.storageClassName" "set storageClassName in the volume claim specs under mongodb.spec, clickhouse.keeper.spec and clickhouse.cluster.spec" "global.keepPVC" "remove it; operator-managed PVCs are always kept on uninstall" - "tasks" "use hyperdx.tasks" - "otel" "configure the otel-collector subchart, and set collector env vars in hyperdx.config and hyperdx.secrets" - "hyperdx.apiKey" "use hyperdx.secrets.HYPERDX_API_KEY" - "hyperdx.apiPort" "use hyperdx.ports.api" - "hyperdx.appPort" "use hyperdx.ports.app" - "hyperdx.opampPort" "use hyperdx.ports.opamp" - "hyperdx.appUrl" "use hyperdx.config.FRONTEND_URL" - "hyperdx.frontendUrl" "use hyperdx.config.FRONTEND_URL" - "hyperdx.logLevel" "use hyperdx.config.HYPERDX_LOG_LEVEL" - "hyperdx.usageStatsEnabled" "use hyperdx.config.USAGE_STATS_ENABLED (a string, e.g. \"false\")" - "hyperdx.otelExporterEndpoint" "use hyperdx.config.OTEL_EXPORTER_OTLP_ENDPOINT" - "hyperdx.mongoUri" "use hyperdx.config.MONGO_URI" - "hyperdx.ingress.ingressClassName" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.ingress.host" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.ingress.path" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.ingress.pathType" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.ingress.tls" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.ingress.proxyBodySize" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.ingress.proxyConnectTimeout" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.ingress.proxySendTimeout" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.ingress.proxyReadTimeout" "move into hyperdx.ingress.spec, and nginx proxy settings into hyperdx.ingress.annotations" - "hyperdx.image" "use hyperdx.deployment.image" - "hyperdx.replicas" "use hyperdx.deployment.replicas" - "hyperdx.livenessProbe" "use hyperdx.deployment.livenessProbe" - "hyperdx.readinessProbe" "use hyperdx.deployment.readinessProbe" - "hyperdx.nodeSelector" "use hyperdx.deployment.nodeSelector" - "hyperdx.tolerations" "use hyperdx.deployment.tolerations" - "hyperdx.annotations" "use hyperdx.deployment.annotations" - "hyperdx.labels" "use hyperdx.deployment.labels" - "hyperdx.env" "use hyperdx.deployment.env" - "hyperdx.waitForMongodb" "use hyperdx.deployment.waitForMongodb" - "hyperdx.useExistingConfigSecret" "use hyperdx.deployment.useExistingConfigSecret" - "hyperdx.existingConfigSecret" "use hyperdx.deployment.existingConfigSecret" - "hyperdx.existingConfigConnectionsKey" "use hyperdx.deployment.existingConfigConnectionsKey" - "hyperdx.existingConfigSourcesKey" "use hyperdx.deployment.existingConfigSourcesKey" - "hyperdx.defaultConnections" "use hyperdx.deployment.defaultConnections" - "hyperdx.defaultSources" "use hyperdx.deployment.defaultSources" - "mongodb.password" "use hyperdx.secrets.MONGODB_PASSWORD" + "tasks" "use clickstack.tasks" + "otel" "configure the otel-collector subchart, and set collector env vars in clickstack.config and clickstack.secrets" + "hyperdx.apiKey" "use clickstack.secrets.HYPERDX_API_KEY" + "hyperdx.apiPort" "use clickstack.ports.api" + "hyperdx.appPort" "use clickstack.ports.app" + "hyperdx.opampPort" "use clickstack.ports.opamp" + "hyperdx.appUrl" "use clickstack.config.FRONTEND_URL" + "hyperdx.frontendUrl" "use clickstack.config.FRONTEND_URL" + "hyperdx.logLevel" "use clickstack.config.HYPERDX_LOG_LEVEL" + "hyperdx.usageStatsEnabled" "use clickstack.config.USAGE_STATS_ENABLED (a string, e.g. \"false\")" + "hyperdx.otelExporterEndpoint" "use clickstack.config.OTEL_EXPORTER_OTLP_ENDPOINT" + "hyperdx.mongoUri" "use clickstack.config.MONGO_URI" + "hyperdx.ingress.ingressClassName" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.ingress.host" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.ingress.path" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.ingress.pathType" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.ingress.tls" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.ingress.proxyBodySize" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.ingress.proxyConnectTimeout" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.ingress.proxySendTimeout" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.ingress.proxyReadTimeout" "move into clickstack.ingress.spec, and nginx proxy settings into clickstack.ingress.annotations" + "hyperdx.image" "use clickstack.deployment.image" + "hyperdx.replicas" "use clickstack.deployment.replicas" + "hyperdx.livenessProbe" "use clickstack.deployment.livenessProbe" + "hyperdx.readinessProbe" "use clickstack.deployment.readinessProbe" + "hyperdx.nodeSelector" "use clickstack.deployment.nodeSelector" + "hyperdx.tolerations" "use clickstack.deployment.tolerations" + "hyperdx.annotations" "use clickstack.deployment.annotations" + "hyperdx.labels" "use clickstack.deployment.labels" + "hyperdx.env" "use clickstack.deployment.env" + "hyperdx.waitForMongodb" "use clickstack.deployment.waitForMongodb" + "hyperdx.useExistingConfigSecret" "use clickstack.deployment.useExistingConfigSecret" + "hyperdx.existingConfigSecret" "use clickstack.deployment.existingConfigSecret" + "hyperdx.existingConfigConnectionsKey" "use clickstack.deployment.existingConfigConnectionsKey" + "hyperdx.existingConfigSourcesKey" "use clickstack.deployment.existingConfigSourcesKey" + "hyperdx.defaultConnections" "use clickstack.deployment.defaultConnections" + "hyperdx.defaultSources" "use clickstack.deployment.defaultSources" + "mongodb.password" "use clickstack.secrets.MONGODB_PASSWORD" "mongodb.image" "configure the MongoDBCommunity resource under mongodb.spec" "mongodb.port" "configure the MongoDBCommunity resource under mongodb.spec" "mongodb.strategy" "configure the MongoDBCommunity resource under mongodb.spec" @@ -114,7 +147,7 @@ user's setting (passwords, replicas, opt-outs) would fall back to the default. "mongodb.livenessProbe" "configure the MongoDBCommunity resource under mongodb.spec" "mongodb.readinessProbe" "configure the MongoDBCommunity resource under mongodb.spec" "clickhouse.prometheus.endpoint" "remove it; only clickhouse.prometheus.port is read" - "clickhouse.config" "set ClickHouse credentials in hyperdx.secrets (CLICKHOUSE_PASSWORD, CLICKHOUSE_APP_PASSWORD)" + "clickhouse.config" "set ClickHouse credentials in clickstack.secrets (CLICKHOUSE_PASSWORD, CLICKHOUSE_APP_PASSWORD)" "clickhouse.image" "configure the ClickHouseCluster resource under clickhouse.cluster.spec" "clickhouse.terminationGracePeriodSeconds" "configure the ClickHouseCluster resource under clickhouse.cluster.spec" "clickhouse.resources" "configure the ClickHouseCluster resource under clickhouse.cluster.spec" @@ -150,56 +183,56 @@ or unwatched inline dashboards when the release namespace is excluded, malformed configMaps entries, and volume/mount names that collide with the provisioner's. */}} {{- define "clickstack.hyperdx.validateDashboards" -}} -{{- $dashboards := default (dict) .Values.hyperdx.dashboards -}} +{{- $dashboards := default (dict) .Values.clickstack.dashboards -}} {{- if $dashboards.enabled -}} -{{- if and (not .Values.hyperdx.serviceAccount.create) (not .Values.hyperdx.serviceAccount.name) -}} -{{- fail "hyperdx.dashboards: the dashboard watcher needs a ServiceAccount to bind RBAC to; set hyperdx.serviceAccount.create=true or provide hyperdx.serviceAccount.name" -}} +{{- if and (not .Values.clickstack.serviceAccount.create) (not .Values.clickstack.serviceAccount.name) -}} +{{- fail "clickstack.dashboards: the dashboard watcher needs a ServiceAccount to bind RBAC to; set clickstack.serviceAccount.create=true or provide clickstack.serviceAccount.name" -}} {{- end -}} {{- $namespaces := default (list) $dashboards.namespaces -}} {{- if not (kindIs "slice" $namespaces) -}} -{{- fail "hyperdx.dashboards.namespaces: must be a list of namespace names" -}} +{{- fail "clickstack.dashboards.namespaces: must be a list of namespace names" -}} {{- end -}} {{- range $namespaces -}} {{- if not (kindIs "string" .) -}} -{{- fail "hyperdx.dashboards.namespaces: entries must be quoted strings" -}} +{{- fail "clickstack.dashboards.namespaces: entries must be quoted strings" -}} {{- end -}} {{- end -}} {{- if and (ne (include "clickstack.hyperdx.dashboardsIncludeReleaseNamespace" .) "true") (not $namespaces) -}} -{{- fail "hyperdx.dashboards.includeReleaseNamespace: false requires at least one entry in hyperdx.dashboards.namespaces (otherwise the watcher has nothing to watch)" -}} +{{- fail "clickstack.dashboards.includeReleaseNamespace: false requires at least one entry in clickstack.dashboards.namespaces (otherwise the watcher has nothing to watch)" -}} {{- end -}} {{- if and $dashboards.configMaps (ne (include "clickstack.hyperdx.dashboardsClusterWide" .) "true") (not (has .Release.Namespace (include "clickstack.hyperdx.effectiveNamespaces" . | splitList ","))) -}} -{{- fail "hyperdx.dashboards.configMaps: inline dashboards are created in the release namespace, which includeReleaseNamespace: false excludes from discovery; list the release namespace in hyperdx.dashboards.namespaces or ship the dashboards as labeled ConfigMaps in a watched namespace" -}} +{{- fail "clickstack.dashboards.configMaps: inline dashboards are created in the release namespace, which includeReleaseNamespace: false excludes from discovery; list the release namespace in clickstack.dashboards.namespaces or ship the dashboards as labeled ConfigMaps in a watched namespace" -}} {{- end -}} {{- if and (eq (include "clickstack.hyperdx.dashboardsClusterWide" .) "true") (gt (len $namespaces) 1) -}} -{{- fail "hyperdx.dashboards.namespaces: \"ALL\" cannot be combined with specific namespaces (it already grants cluster-wide discovery)" -}} +{{- fail "clickstack.dashboards.namespaces: \"ALL\" cannot be combined with specific namespaces (it already grants cluster-wide discovery)" -}} {{- end -}} {{- range $namespaces -}} {{- if not (trim .) -}} -{{- fail "hyperdx.dashboards.namespaces: entries must be non-empty namespace names" -}} +{{- fail "clickstack.dashboards.namespaces: entries must be non-empty namespace names" -}} {{- end -}} {{- if and (ne . "ALL") (eq (upper (trim .)) "ALL") -}} -{{- fail "hyperdx.dashboards.namespaces: use exactly \"ALL\" (uppercase, no surrounding spaces) for cluster-wide discovery" -}} +{{- fail "clickstack.dashboards.namespaces: use exactly \"ALL\" (uppercase, no surrounding spaces) for cluster-wide discovery" -}} {{- end -}} {{- if and (ne . "ALL") (not (regexMatch "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$" (trim .))) -}} -{{- fail "hyperdx.dashboards.namespaces: entries must be valid DNS-1123 labels (lowercase alphanumeric and '-')" -}} +{{- fail "clickstack.dashboards.namespaces: entries must be valid DNS-1123 labels (lowercase alphanumeric and '-')" -}} {{- end -}} {{- end -}} {{- range $key, $value := (default (dict) $dashboards.configMaps) -}} {{- if not (kindIs "string" $value) -}} -{{- fail (printf "hyperdx.dashboards.configMaps[%s]: value must be a JSON string — use a YAML block scalar (|)" $key) -}} +{{- fail (printf "clickstack.dashboards.configMaps[%s]: value must be a JSON string — use a YAML block scalar (|)" $key) -}} {{- end -}} {{- if not (regexMatch "^[A-Za-z0-9][A-Za-z0-9._-]*\\.json$" $key) -}} -{{- fail (printf "hyperdx.dashboards.configMaps: key %q must be a valid ConfigMap key ending in .json (the provisioner only reads *.json files)" $key) -}} +{{- fail (printf "clickstack.dashboards.configMaps: key %q must be a valid ConfigMap key ending in .json (the provisioner only reads *.json files)" $key) -}} {{- end -}} {{- end -}} -{{- range (default (list) .Values.hyperdx.deployment.volumes) -}} +{{- range (default (list) .Values.clickstack.deployment.volumes) -}} {{- if eq (get . "name") "dashboards" -}} -{{- fail "hyperdx.deployment.volumes: the name \"dashboards\" is reserved by the dashboard provisioner" -}} +{{- fail "clickstack.deployment.volumes: the name \"dashboards\" is reserved by the dashboard provisioner" -}} {{- end -}} {{- end -}} -{{- range (default (list) .Values.hyperdx.deployment.volumeMounts) -}} +{{- range (default (list) .Values.clickstack.deployment.volumeMounts) -}} {{- if or (eq (get . "name") "dashboards") (eq (get . "mountPath") "/dashboards") -}} -{{- fail "hyperdx.deployment.volumeMounts: the name \"dashboards\" and mountPath \"/dashboards\" are reserved by the dashboard provisioner" -}} +{{- fail "clickstack.deployment.volumeMounts: the name \"dashboards\" and mountPath \"/dashboards\" are reserved by the dashboard provisioner" -}} {{- end -}} {{- end -}} {{- end -}} @@ -212,7 +245,7 @@ comma-joined. Single source for both the watcher NAMESPACE env and the per-names RBAC objects so watch scope and granted scope can't drift. */}} {{- define "clickstack.hyperdx.effectiveNamespaces" -}} -{{- $raw := default (list) (default (dict) .Values.hyperdx.dashboards).namespaces -}} +{{- $raw := default (list) (default (dict) .Values.clickstack.dashboards).namespaces -}} {{- $namespaces := ternary $raw (list) (kindIs "slice" $raw) -}} {{- $base := ternary (list .Release.Namespace) (list) (eq (include "clickstack.hyperdx.dashboardsIncludeReleaseNamespace" .) "true") -}} {{- $trimmed := list -}} @@ -228,7 +261,7 @@ Role-vs-ClusterRole choice in the RBAC template and the watcher NAMESPACE env in Deployment, so the granted scope and the watched scope can't diverge. Renders "true" or "". */}} {{- define "clickstack.hyperdx.dashboardsClusterWide" -}} -{{- $namespaces := default (list) (default (dict) .Values.hyperdx.dashboards).namespaces -}} +{{- $namespaces := default (list) (default (dict) .Values.clickstack.dashboards).namespaces -}} {{- if and (kindIs "slice" $namespaces) (has "ALL" $namespaces) }}true{{- end -}} {{- end -}} @@ -251,7 +284,7 @@ key (e.g. an upgrade with --reuse-values from a chart version without it) keeps chart default of true. Renders "true" or "". */}} {{- define "clickstack.hyperdx.dashboardsIncludeReleaseNamespace" -}} -{{- $dashboards := default (dict) .Values.hyperdx.dashboards -}} +{{- $dashboards := default (dict) .Values.clickstack.dashboards -}} {{- if or (not (hasKey $dashboards "includeReleaseNamespace")) $dashboards.includeReleaseNamespace }}true{{- end -}} {{- end -}} @@ -261,7 +294,7 @@ with --reuse-values that only sets dashboards.enabled) keeps the chart default o true rather than silently deploying a watcher with no read access. Renders "true" or "". */}} {{- define "clickstack.hyperdx.dashboardsRbacCreate" -}} -{{- $rbac := default (dict) (default (dict) .Values.hyperdx.dashboards).rbac -}} +{{- $rbac := default (dict) (default (dict) .Values.clickstack.dashboards).rbac -}} {{- if or (not (hasKey $rbac "create")) $rbac.create }}true{{- end -}} {{- end -}} @@ -336,14 +369,14 @@ ClickHouse headless service name. The operator creates a headless service named {{/* Whether the ClickHouse PromQL config is injected into the ClickHouseCluster CR. -Needs hyperdx.promql.enabled and a ClickHouse server image of 26.6 or newer, the +Needs clickstack.promql.enabled and a ClickHouse server image of 26.6 or newer, the first release with the prometheus_api_v1 handler. The tag is read from clickhouse.cluster.spec.containerTemplate.image.tag; a four-part ClickHouse version and an image-variant suffix such as "-alpine" are reduced to semver first. A tag that carries no version (e.g. "latest") is assumed new enough. Renders "true" or "". */}} {{- define "clickstack.clickhouse.promqlEnabled" -}} -{{- if .Values.hyperdx.promql.enabled -}} +{{- if .Values.clickstack.promql.enabled -}} {{- $tag := toString (dig "containerTemplate" "image" "tag" "" .Values.clickhouse.cluster.spec) -}} {{- $version := regexFind "^[0-9]+\\.[0-9]+(\\.[0-9]+)?" $tag -}} {{- if or (not $version) (semverCompare ">= 26.6" $version) }}true{{- end -}} @@ -360,7 +393,7 @@ repeated because ClickHouse ignores its legacy prometheus.endpoint settings once handlers block exists. */}} {{- define "clickstack.clickhouse.promqlSettings" -}} -{{- $database := .Values.hyperdx.config.HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE | default "default" }} +{{- $database := .Values.clickstack.config.HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE | default "default" }} extraConfig: prometheus: handlers: @@ -408,10 +441,10 @@ metadata: labels: {{- include "clickstack.labels" . | nindent 4 }} data: - {{- range $k, $v := .Values.hyperdx.config }} + {{- range $k, $v := .Values.clickstack.config }} {{ $k }}: {{ tpl (toString $v) $ | quote }} {{- end }} - {{- if and .Values.global.otelCollector.customConfig (not (hasKey .Values.hyperdx.config "CUSTOM_OTELCOL_CONFIG_FILE")) }} + {{- if and .Values.global.otelCollector.customConfig (not (hasKey .Values.clickstack.config "CUSTOM_OTELCOL_CONFIG_FILE")) }} CUSTOM_OTELCOL_CONFIG_FILE: "/etc/otelcol-contrib/custom/custom.config.yaml" {{- end }} {{- end }} @@ -429,7 +462,7 @@ metadata: {{- include "clickstack.labels" . | nindent 4 }} type: Opaque stringData: - {{- range $k, $v := .Values.hyperdx.secrets }} + {{- range $k, $v := .Values.clickstack.secrets }} {{ $k }}: {{ tpl (toString $v) $ | quote }} {{- end }} {{- end }} diff --git a/charts/clickstack/templates/additional-manifests.yaml b/charts/clickstack/templates/additional-manifests.yaml index bd52d962..41ddb942 100644 --- a/charts/clickstack/templates/additional-manifests.yaml +++ b/charts/clickstack/templates/additional-manifests.yaml @@ -1,3 +1,4 @@ +{{- include "clickstack.normalizeValues" . -}} {{- range .Values.additionalManifests }} --- {{ tpl (toYaml .) $ }} diff --git a/charts/clickstack/templates/clickhouse/cluster.yaml b/charts/clickstack/templates/clickhouse/cluster.yaml index 5cc6db72..7a501944 100644 --- a/charts/clickstack/templates/clickhouse/cluster.yaml +++ b/charts/clickstack/templates/clickhouse/cluster.yaml @@ -1,3 +1,4 @@ +{{- include "clickstack.normalizeValues" . -}} {{- if .Values.clickhouse.enabled }} {{- $spec := deepCopy .Values.clickhouse.cluster.spec }} {{- if include "clickstack.clickhouse.promqlEnabled" . }} diff --git a/charts/clickstack/templates/clickhouse/keeper.yaml b/charts/clickstack/templates/clickhouse/keeper.yaml index cd8cebf2..a86d1cc5 100644 --- a/charts/clickstack/templates/clickhouse/keeper.yaml +++ b/charts/clickstack/templates/clickhouse/keeper.yaml @@ -1,3 +1,4 @@ +{{- include "clickstack.normalizeValues" . -}} {{- if .Values.clickhouse.enabled }} apiVersion: clickhouse.com/v1alpha1 kind: KeeperCluster diff --git a/charts/clickstack/templates/hyperdx/configmap.yaml b/charts/clickstack/templates/hyperdx/configmap.yaml index 9cadf6cd..fd65c652 100644 --- a/charts/clickstack/templates/hyperdx/configmap.yaml +++ b/charts/clickstack/templates/hyperdx/configmap.yaml @@ -1,2 +1,3 @@ +{{- include "clickstack.normalizeValues" . -}} {{- include "clickstack.validateRemovedValues" . }} {{- include "clickstack.hyperdx.configmap" . }} diff --git a/charts/clickstack/templates/hyperdx/cronjob-check-alerts.yaml b/charts/clickstack/templates/hyperdx/cronjob-check-alerts.yaml index 8f98dd71..670626c1 100644 --- a/charts/clickstack/templates/hyperdx/cronjob-check-alerts.yaml +++ b/charts/clickstack/templates/hyperdx/cronjob-check-alerts.yaml @@ -1,4 +1,5 @@ -{{- if .Values.hyperdx.tasks.enabled }} +{{- include "clickstack.normalizeValues" . -}} +{{- if .Values.clickstack.tasks.enabled }} --- apiVersion: batch/v1 kind: CronJob @@ -7,7 +8,7 @@ metadata: labels: {{- include "clickstack.labels" . | nindent 4 }} spec: - schedule: {{ .Values.hyperdx.tasks.checkAlerts.schedule | quote }} + schedule: {{ .Values.clickstack.tasks.checkAlerts.schedule | quote }} concurrencyPolicy: Forbid jobTemplate: spec: @@ -21,27 +22,27 @@ spec: imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 12 }} {{- end }} - {{- with .Values.hyperdx.deployment.podSecurityContext }} + {{- with .Values.clickstack.deployment.podSecurityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} restartPolicy: OnFailure containers: - name: task - image: "{{ .Values.hyperdx.deployment.image.repository }}:{{ .Values.hyperdx.deployment.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.hyperdx.deployment.image.pullPolicy }} - {{- with .Values.hyperdx.deployment.containerSecurityContext }} + image: "{{ .Values.clickstack.deployment.image.repository }}:{{ .Values.clickstack.deployment.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.clickstack.deployment.image.pullPolicy }} + {{- with .Values.clickstack.deployment.containerSecurityContext }} securityContext: {{- toYaml . | nindent 16 }} {{- end }} - {{- $tag := .Values.hyperdx.deployment.image.tag | default .Chart.AppVersion -}} + {{- $tag := .Values.clickstack.deployment.image.tag | default .Chart.AppVersion -}} {{- $semver := regexMatch "^[0-9]+\\.[0-9]+\\.[0-9]+" $tag -}} {{- if and $semver (semverCompare "< 2.7.0" $tag) }} command: - "node" - "/app/packages/api/tasks/index" - "check-alerts" - {{- range $key, $value := .Values.hyperdx.tasks.checkAlerts.additionalArgs }} + {{- range $key, $value := .Values.clickstack.tasks.checkAlerts.additionalArgs }} - "--{{ $key }}" - "{{ $value }}" {{- end }} @@ -50,7 +51,7 @@ spec: - "node" - "/app/packages/api/build/tasks/index.js" - "check-alerts" - {{- range $key, $value := .Values.hyperdx.tasks.checkAlerts.additionalArgs }} + {{- range $key, $value := .Values.clickstack.tasks.checkAlerts.additionalArgs }} - "--{{ $key }}" - "{{ $value }}" {{- end }} @@ -60,7 +61,7 @@ spec: - "/app/packages/api/bin/hyperdx" - "task" - "check-alerts" - {{- range $key, $value := .Values.hyperdx.tasks.checkAlerts.additionalArgs }} + {{- range $key, $value := .Values.clickstack.tasks.checkAlerts.additionalArgs }} - "--{{ $key }}" - "{{ $value }}" {{- end }} @@ -78,5 +79,5 @@ spec: - name: APP_TYPE value: "scheduled-task" resources: - {{- toYaml .Values.hyperdx.tasks.checkAlerts.resources | nindent 16 }} + {{- toYaml .Values.clickstack.tasks.checkAlerts.resources | nindent 16 }} {{- end }} diff --git a/charts/clickstack/templates/hyperdx/dashboard-configmap.yaml b/charts/clickstack/templates/hyperdx/dashboard-configmap.yaml index 4c126f9c..83baadcb 100644 --- a/charts/clickstack/templates/hyperdx/dashboard-configmap.yaml +++ b/charts/clickstack/templates/hyperdx/dashboard-configmap.yaml @@ -1,4 +1,5 @@ -{{- $dashboards := default (dict) .Values.hyperdx.dashboards -}} +{{- include "clickstack.normalizeValues" . -}} +{{- $dashboards := default (dict) .Values.clickstack.dashboards -}} {{- if and $dashboards.enabled $dashboards.configMaps }} {{- /* Inline dashboard ConfigMap; labeled for discovery by the dashboard provisioner diff --git a/charts/clickstack/templates/hyperdx/dashboard-provisioner-rbac.yaml b/charts/clickstack/templates/hyperdx/dashboard-provisioner-rbac.yaml index 127131c5..6815921e 100644 --- a/charts/clickstack/templates/hyperdx/dashboard-provisioner-rbac.yaml +++ b/charts/clickstack/templates/hyperdx/dashboard-provisioner-rbac.yaml @@ -1,4 +1,5 @@ -{{- if and (default (dict) .Values.hyperdx.dashboards).enabled (eq (include "clickstack.hyperdx.dashboardsRbacCreate" .) "true") }} +{{- include "clickstack.normalizeValues" . -}} +{{- if and (default (dict) .Values.clickstack.dashboards).enabled (eq (include "clickstack.hyperdx.dashboardsRbacCreate" .) "true") }} {{- $fullname := include "clickstack.fullname" . -}} {{- $saName := include "clickstack.hyperdx.serviceAccountName" . -}} {{- /* Cluster-scoped objects are namespace-qualified so two same-named releases don't collide. RBAC names allow 253 chars (not 63), so the qualifier always survives. */}} diff --git a/charts/clickstack/templates/hyperdx/deployment.yaml b/charts/clickstack/templates/hyperdx/deployment.yaml index 65b7b524..5d56adc3 100644 --- a/charts/clickstack/templates/hyperdx/deployment.yaml +++ b/charts/clickstack/templates/hyperdx/deployment.yaml @@ -1,29 +1,30 @@ -{{- $podAnnotations := mergeOverwrite (dict) (default (dict) .Values.hyperdx.deployment.annotations) (default (dict) .Values.hyperdx.deployment.podAnnotations) -}} +{{- include "clickstack.normalizeValues" . -}} +{{- $podAnnotations := mergeOverwrite (dict) (default (dict) .Values.clickstack.deployment.annotations) (default (dict) .Values.clickstack.deployment.podAnnotations) -}} {{- $_ := set $podAnnotations "checksum/clickstack-config" (include "clickstack.hyperdx.configmap" . | sha256sum) -}} -{{- if ne .Values.hyperdx.secrets nil -}} +{{- if ne .Values.clickstack.secrets nil -}} {{- $_ := set $podAnnotations "checksum/clickstack-secret" (include "clickstack.hyperdx.secret" . | sha256sum) -}} {{- end -}} -{{- $dashboards := default (dict) .Values.hyperdx.dashboards -}} +{{- $dashboards := default (dict) .Values.clickstack.dashboards -}} {{- include "clickstack.hyperdx.validateDashboards" . -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "clickstack.hyperdx.fullname" . }} - {{- with .Values.hyperdx.deployment.deploymentAnnotations }} + {{- with .Values.clickstack.deployment.deploymentAnnotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} labels: {{- include "clickstack.labels" . | nindent 4 }} app: {{ include "clickstack.fullname" . }} - {{- if .Values.hyperdx.deployment.labels }} - {{- with .Values.hyperdx.deployment.labels }} + {{- if .Values.clickstack.deployment.labels }} + {{- with .Values.clickstack.deployment.labels }} {{- toYaml . | nindent 4 }} {{- end -}} {{- end }} spec: - {{- if not .Values.hyperdx.autoscaling.enabled }} - replicas: {{ .Values.hyperdx.deployment.replicas | default 1 }} + {{- if not .Values.clickstack.autoscaling.enabled }} + replicas: {{ .Values.clickstack.deployment.replicas | default 1 }} {{- end }} selector: matchLabels: @@ -34,7 +35,7 @@ spec: labels: {{- include "clickstack.selectorLabels" . | nindent 8 }} app: {{ include "clickstack.fullname" . }} - {{- with .Values.hyperdx.deployment.podLabels }} + {{- with .Values.clickstack.deployment.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} annotations: @@ -44,25 +45,25 @@ spec: {{- end -}} {{- end }} spec: - {{- if .Values.hyperdx.deployment.nodeSelector }} + {{- if .Values.clickstack.deployment.nodeSelector }} nodeSelector: - {{- toYaml .Values.hyperdx.deployment.nodeSelector | nindent 8 }} + {{- toYaml .Values.clickstack.deployment.nodeSelector | nindent 8 }} {{- end }} - {{- if .Values.hyperdx.deployment.tolerations }} + {{- if .Values.clickstack.deployment.tolerations }} tolerations: - {{- toYaml .Values.hyperdx.deployment.tolerations | nindent 8 }} + {{- toYaml .Values.clickstack.deployment.tolerations | nindent 8 }} {{- end }} - {{- if .Values.hyperdx.deployment.topologySpreadConstraints }} + {{- if .Values.clickstack.deployment.topologySpreadConstraints }} topologySpreadConstraints: - {{- toYaml .Values.hyperdx.deployment.topologySpreadConstraints | nindent 8 }} + {{- toYaml .Values.clickstack.deployment.topologySpreadConstraints | nindent 8 }} {{- end }} - {{- if .Values.hyperdx.deployment.priorityClassName }} - priorityClassName: {{ .Values.hyperdx.deployment.priorityClassName | quote }} + {{- if .Values.clickstack.deployment.priorityClassName }} + priorityClassName: {{ .Values.clickstack.deployment.priorityClassName | quote }} {{- end }} - {{- if or .Values.hyperdx.serviceAccount.create .Values.hyperdx.serviceAccount.name }} + {{- if or .Values.clickstack.serviceAccount.create .Values.clickstack.serviceAccount.name }} serviceAccountName: {{ include "clickstack.hyperdx.serviceAccountName" . }} {{- end }} - {{- with .Values.hyperdx.deployment.podSecurityContext }} + {{- with .Values.clickstack.deployment.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} @@ -70,25 +71,25 @@ spec: imagePullSecrets: {{- toYaml .Values.global.imagePullSecrets | nindent 8 }} {{- end }} - {{- if or .Values.mongodb.enabled .Values.hyperdx.deployment.initContainers }} + {{- if or .Values.mongodb.enabled .Values.clickstack.deployment.initContainers }} initContainers: {{- if .Values.mongodb.enabled }} - name: wait-for-mongodb - image: {{ .Values.hyperdx.deployment.waitForMongodb.image }} - imagePullPolicy: {{ .Values.hyperdx.deployment.waitForMongodb.pullPolicy }} - {{- with .Values.hyperdx.deployment.containerSecurityContext }} + image: {{ .Values.clickstack.deployment.waitForMongodb.image }} + imagePullPolicy: {{ .Values.clickstack.deployment.waitForMongodb.pullPolicy }} + {{- with .Values.clickstack.deployment.containerSecurityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} command: ['sh', '-c', 'until nc -z {{ include "clickstack.mongodb.svc" . }} 27017; do echo waiting for mongodb; sleep 2; done;'] {{- end }} - {{- with .Values.hyperdx.deployment.initContainers }} + {{- with .Values.clickstack.deployment.initContainers }} {{- toYaml . | nindent 8 }} {{- end }} {{- end }} - {{- if or .Values.hyperdx.deployment.volumes $dashboards.enabled }} + {{- if or .Values.clickstack.deployment.volumes $dashboards.enabled }} volumes: - {{- with .Values.hyperdx.deployment.volumes }} + {{- with .Values.clickstack.deployment.volumes }} {{- toYaml . | nindent 8 }} {{- end }} {{- if $dashboards.enabled }} @@ -98,51 +99,51 @@ spec: {{- end }} containers: - name: app - image: "{{ .Values.hyperdx.deployment.image.repository }}:{{ .Values.hyperdx.deployment.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.hyperdx.deployment.image.pullPolicy }} - {{- with .Values.hyperdx.deployment.containerSecurityContext }} + image: "{{ .Values.clickstack.deployment.image.repository }}:{{ .Values.clickstack.deployment.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.clickstack.deployment.image.pullPolicy }} + {{- with .Values.clickstack.deployment.containerSecurityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} ports: - name: app-port - containerPort: {{ .Values.hyperdx.ports.app }} + containerPort: {{ .Values.clickstack.ports.app }} - name: api-port - containerPort: {{ .Values.hyperdx.ports.api }} + containerPort: {{ .Values.clickstack.ports.api }} - name: opamp-port - containerPort: {{ .Values.hyperdx.ports.opamp }} - {{- if .Values.hyperdx.deployment.resources }} + containerPort: {{ .Values.clickstack.ports.opamp }} + {{- if .Values.clickstack.deployment.resources }} resources: - {{- toYaml .Values.hyperdx.deployment.resources | nindent 12 }} + {{- toYaml .Values.clickstack.deployment.resources | nindent 12 }} {{- end }} - {{- if .Values.hyperdx.deployment.livenessProbe.enabled }} + {{- if .Values.clickstack.deployment.livenessProbe.enabled }} livenessProbe: httpGet: - path: {{ .Values.hyperdx.deployment.livenessProbe.path | default "/health" }} - port: {{ .Values.hyperdx.ports.api }} - initialDelaySeconds: {{ .Values.hyperdx.deployment.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.hyperdx.deployment.livenessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.hyperdx.deployment.livenessProbe.timeoutSeconds }} - failureThreshold: {{ .Values.hyperdx.deployment.livenessProbe.failureThreshold }} + path: {{ .Values.clickstack.deployment.livenessProbe.path | default "/health" }} + port: {{ .Values.clickstack.ports.api }} + initialDelaySeconds: {{ .Values.clickstack.deployment.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.clickstack.deployment.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.clickstack.deployment.livenessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.clickstack.deployment.livenessProbe.failureThreshold }} {{- end }} - {{- if .Values.hyperdx.deployment.readinessProbe.enabled }} + {{- if .Values.clickstack.deployment.readinessProbe.enabled }} readinessProbe: httpGet: - path: {{ .Values.hyperdx.deployment.readinessProbe.path | default "/ready" }} - port: {{ .Values.hyperdx.ports.api }} - initialDelaySeconds: {{ .Values.hyperdx.deployment.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.hyperdx.deployment.readinessProbe.periodSeconds }} - timeoutSeconds: {{ .Values.hyperdx.deployment.readinessProbe.timeoutSeconds }} - failureThreshold: {{ .Values.hyperdx.deployment.readinessProbe.failureThreshold }} + path: {{ .Values.clickstack.deployment.readinessProbe.path | default "/ready" }} + port: {{ .Values.clickstack.ports.api }} + initialDelaySeconds: {{ .Values.clickstack.deployment.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.clickstack.deployment.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.clickstack.deployment.readinessProbe.timeoutSeconds }} + failureThreshold: {{ .Values.clickstack.deployment.readinessProbe.failureThreshold }} {{- end }} - {{- if or .Values.hyperdx.deployment.volumeMounts $dashboards.enabled }} + {{- if or .Values.clickstack.deployment.volumeMounts $dashboards.enabled }} volumeMounts: - {{- with .Values.hyperdx.deployment.volumeMounts }} + {{- with .Values.clickstack.deployment.volumeMounts }} {{- toYaml . | nindent 12 }} {{- end }} {{- if $dashboards.enabled }} # read-only: the HyperDX provisioner only reads .json files here, never writes - # (hyperdxio/hyperdx#1962); the watcher sidecar owns writes to the shared volume. + # (ClickHouse/ClickStack#1962); the watcher sidecar owns writes to the shared volume. - name: dashboards mountPath: /dashboards readOnly: true @@ -151,32 +152,32 @@ spec: envFrom: - configMapRef: name: clickstack-config - {{- if ne .Values.hyperdx.secrets nil }} + {{- if ne .Values.clickstack.secrets nil }} - secretRef: name: clickstack-secret {{- end }} env: - {{- if .Values.hyperdx.deployment.useExistingConfigSecret }} + {{- if .Values.clickstack.deployment.useExistingConfigSecret }} - name: DEFAULT_CONNECTIONS valueFrom: secretKeyRef: - name: {{ .Values.hyperdx.deployment.existingConfigSecret | quote }} - key: {{ .Values.hyperdx.deployment.existingConfigConnectionsKey | quote }} + name: {{ .Values.clickstack.deployment.existingConfigSecret | quote }} + key: {{ .Values.clickstack.deployment.existingConfigConnectionsKey | quote }} optional: false - name: DEFAULT_SOURCES valueFrom: secretKeyRef: - name: {{ .Values.hyperdx.deployment.existingConfigSecret | quote }} - key: {{ .Values.hyperdx.deployment.existingConfigSourcesKey | quote }} + name: {{ .Values.clickstack.deployment.existingConfigSecret | quote }} + key: {{ .Values.clickstack.deployment.existingConfigSourcesKey | quote }} optional: false {{- else }} - {{- if and .Values.hyperdx.deployment.defaultConnections (ne .Values.hyperdx.secrets nil) }} + {{- if and .Values.clickstack.deployment.defaultConnections (ne .Values.clickstack.secrets nil) }} - name: DEFAULT_CONNECTIONS - value: {{ tpl .Values.hyperdx.deployment.defaultConnections . | quote }} + value: {{ tpl .Values.clickstack.deployment.defaultConnections . | quote }} {{- end }} - {{- if .Values.hyperdx.deployment.defaultSources }} + {{- if .Values.clickstack.deployment.defaultSources }} - name: DEFAULT_SOURCES - value: {{ tpl .Values.hyperdx.deployment.defaultSources . | quote }} + value: {{ tpl .Values.clickstack.deployment.defaultSources . | quote }} {{- end }} {{- end }} {{- if $dashboards.enabled }} @@ -187,14 +188,14 @@ spec: - name: DASHBOARD_PROVISIONER_ALL_TEAMS value: "true" {{- end }} - {{- with .Values.hyperdx.deployment.env }} + {{- with .Values.clickstack.deployment.env }} {{- toYaml . | nindent 12 }} {{- end }} {{- if $dashboards.enabled }} - name: dashboard-watcher image: {{ $dashboards.sidecarImage | quote }} imagePullPolicy: {{ $dashboards.sidecarPullPolicy | default "IfNotPresent" }} - {{- with .Values.hyperdx.deployment.containerSecurityContext }} + {{- with .Values.clickstack.deployment.containerSecurityContext }} securityContext: {{- toYaml . | nindent 12 }} {{- end }} diff --git a/charts/clickstack/templates/hyperdx/hpa.yaml b/charts/clickstack/templates/hyperdx/hpa.yaml index d79e21c8..470260f9 100644 --- a/charts/clickstack/templates/hyperdx/hpa.yaml +++ b/charts/clickstack/templates/hyperdx/hpa.yaml @@ -1,6 +1,7 @@ -{{- if .Values.hyperdx.autoscaling.enabled }} -{{- if hasKey .Values.hyperdx.autoscaling.spec "scaleTargetRef" }} -{{- fail "hyperdx.autoscaling.spec must not include scaleTargetRef -- the chart auto-wires it to the HyperDX Deployment. Remove scaleTargetRef from your autoscaling.spec values." }} +{{- include "clickstack.normalizeValues" . -}} +{{- if .Values.clickstack.autoscaling.enabled }} +{{- if hasKey .Values.clickstack.autoscaling.spec "scaleTargetRef" }} +{{- fail "clickstack.autoscaling.spec must not include scaleTargetRef -- the chart auto-wires it to the HyperDX Deployment. Remove scaleTargetRef from your autoscaling.spec values." }} {{- end }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler @@ -13,7 +14,7 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "clickstack.hyperdx.fullname" . }} - {{- with .Values.hyperdx.autoscaling.spec }} + {{- with .Values.clickstack.autoscaling.spec }} {{- toYaml . | nindent 2 }} {{- end }} {{- end }} diff --git a/charts/clickstack/templates/hyperdx/ingress.yaml b/charts/clickstack/templates/hyperdx/ingress.yaml index e72b204d..17e3bf28 100644 --- a/charts/clickstack/templates/hyperdx/ingress.yaml +++ b/charts/clickstack/templates/hyperdx/ingress.yaml @@ -1,6 +1,7 @@ -{{- if .Values.hyperdx.ingress.enabled }} -{{- if not .Values.hyperdx.ingress.spec }} -{{- fail "hyperdx.ingress.spec is required when ingress is enabled" }} +{{- include "clickstack.normalizeValues" . -}} +{{- if .Values.clickstack.ingress.enabled }} +{{- if not .Values.clickstack.ingress.spec }} +{{- fail "clickstack.ingress.spec is required when ingress is enabled" }} {{- end }} apiVersion: networking.k8s.io/v1 kind: Ingress @@ -8,15 +9,15 @@ metadata: name: {{ include "clickstack.hyperdx.fullname" . }}-ingress labels: {{- include "clickstack.labels" . | nindent 4 }} - {{- with .Values.hyperdx.ingress.annotations }} + {{- with .Values.clickstack.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} -{{- with .Values.hyperdx.ingress.spec }} +{{- with .Values.clickstack.ingress.spec }} spec: {{- toYaml . | nindent 2 }} {{- end }} -{{- range .Values.hyperdx.ingress.additionalIngresses }} +{{- range .Values.clickstack.ingress.additionalIngresses }} --- apiVersion: networking.k8s.io/v1 kind: Ingress diff --git a/charts/clickstack/templates/hyperdx/networkpolicy.yaml b/charts/clickstack/templates/hyperdx/networkpolicy.yaml index 9e90da88..fa67d82c 100644 --- a/charts/clickstack/templates/hyperdx/networkpolicy.yaml +++ b/charts/clickstack/templates/hyperdx/networkpolicy.yaml @@ -1,6 +1,7 @@ -{{- if .Values.hyperdx.networkPolicy.enabled }} -{{- if not .Values.hyperdx.networkPolicy.spec }} -{{- fail "hyperdx.networkPolicy.spec is required when networkPolicy is enabled" }} +{{- include "clickstack.normalizeValues" . -}} +{{- if .Values.clickstack.networkPolicy.enabled }} +{{- if not .Values.clickstack.networkPolicy.spec }} +{{- fail "clickstack.networkPolicy.spec is required when networkPolicy is enabled" }} {{- end }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy @@ -8,7 +9,7 @@ metadata: name: {{ include "clickstack.hyperdx.fullname" . }}-network-policy labels: {{- include "clickstack.labels" . | nindent 4 }} -{{- with .Values.hyperdx.networkPolicy.spec }} +{{- with .Values.clickstack.networkPolicy.spec }} spec: {{- toYaml . | nindent 2 }} {{- end }} diff --git a/charts/clickstack/templates/hyperdx/pdb.yaml b/charts/clickstack/templates/hyperdx/pdb.yaml index 42c6cd3c..03c1e84a 100644 --- a/charts/clickstack/templates/hyperdx/pdb.yaml +++ b/charts/clickstack/templates/hyperdx/pdb.yaml @@ -1,4 +1,5 @@ -{{- if .Values.hyperdx.podDisruptionBudget.enabled }} +{{- include "clickstack.normalizeValues" . -}} +{{- if .Values.clickstack.podDisruptionBudget.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: @@ -6,17 +7,17 @@ metadata: labels: {{- include "clickstack.labels" . | nindent 4 }} app: {{ include "clickstack.fullname" . }} - {{- if .Values.hyperdx.deployment.labels }} - {{- with .Values.hyperdx.deployment.labels }} + {{- if .Values.clickstack.deployment.labels }} + {{- with .Values.clickstack.deployment.labels }} {{- toYaml . | nindent 4 }} {{- end -}} {{- end }} spec: - {{- with .Values.hyperdx.podDisruptionBudget.minAvailable }} + {{- with .Values.clickstack.podDisruptionBudget.minAvailable }} minAvailable: {{ . }} {{- else }} {{- /* Unlike minAvailable: 1, this still lets a single replica be evicted, so node drains finish. */}} - maxUnavailable: {{ .Values.hyperdx.podDisruptionBudget.maxUnavailable | default 1 }} + maxUnavailable: {{ .Values.clickstack.podDisruptionBudget.maxUnavailable | default 1 }} {{- end }} selector: matchLabels: diff --git a/charts/clickstack/templates/hyperdx/secret.yaml b/charts/clickstack/templates/hyperdx/secret.yaml index bfb87ccf..b6dac5cb 100644 --- a/charts/clickstack/templates/hyperdx/secret.yaml +++ b/charts/clickstack/templates/hyperdx/secret.yaml @@ -1,6 +1,7 @@ -{{- if and (eq .Values.hyperdx.secrets nil) (or .Values.mongodb.enabled .Values.clickhouse.enabled (index .Values "otel-collector" "enabled")) }} -{{- fail "hyperdx.secrets cannot be null when mongodb, clickhouse, or otel-collector is enabled -- these subcharts require the clickstack-secret for credentials" }} +{{- include "clickstack.normalizeValues" . -}} +{{- if and (eq .Values.clickstack.secrets nil) (or .Values.mongodb.enabled .Values.clickhouse.enabled (index .Values "otel-collector" "enabled")) }} +{{- fail "clickstack.secrets cannot be null when mongodb, clickhouse, or otel-collector is enabled -- these subcharts require the clickstack-secret for credentials" }} {{- end }} -{{- if ne .Values.hyperdx.secrets nil }} +{{- if ne .Values.clickstack.secrets nil }} {{- include "clickstack.hyperdx.secret" . }} {{- end }} diff --git a/charts/clickstack/templates/hyperdx/service.yaml b/charts/clickstack/templates/hyperdx/service.yaml index 6ca19b86..8dcac3d6 100644 --- a/charts/clickstack/templates/hyperdx/service.yaml +++ b/charts/clickstack/templates/hyperdx/service.yaml @@ -1,28 +1,29 @@ +{{- include "clickstack.normalizeValues" . -}} apiVersion: v1 kind: Service metadata: name: {{ include "clickstack.hyperdx.fullname" . }} labels: {{- include "clickstack.labels" . | nindent 4 }} - {{- if .Values.hyperdx.service.annotations }} + {{- if .Values.clickstack.service.annotations }} annotations: - {{- with .Values.hyperdx.service.annotations }} + {{- with .Values.clickstack.service.annotations }} {{- toYaml . | nindent 4 }} {{- end }} {{- end }} spec: - type: {{ .Values.hyperdx.service.type | default "ClusterIP" }} + type: {{ .Values.clickstack.service.type | default "ClusterIP" }} ports: - - port: {{ .Values.hyperdx.ports.app }} - targetPort: {{ .Values.hyperdx.ports.app }} + - port: {{ .Values.clickstack.ports.app }} + targetPort: {{ .Values.clickstack.ports.app }} name: app - {{- if .Values.hyperdx.service.apiPort.enabled }} - - port: {{ .Values.hyperdx.ports.api }} - targetPort: {{ .Values.hyperdx.ports.api }} + {{- if .Values.clickstack.service.apiPort.enabled }} + - port: {{ .Values.clickstack.ports.api }} + targetPort: {{ .Values.clickstack.ports.api }} name: api {{- end }} - - port: {{ .Values.hyperdx.ports.opamp }} - targetPort: {{ .Values.hyperdx.ports.opamp }} + - port: {{ .Values.clickstack.ports.opamp }} + targetPort: {{ .Values.clickstack.ports.opamp }} name: opamp selector: {{- include "clickstack.selectorLabels" . | nindent 4 }} diff --git a/charts/clickstack/templates/hyperdx/serviceaccount.yaml b/charts/clickstack/templates/hyperdx/serviceaccount.yaml index 631f9cd8..4681392a 100644 --- a/charts/clickstack/templates/hyperdx/serviceaccount.yaml +++ b/charts/clickstack/templates/hyperdx/serviceaccount.yaml @@ -1,11 +1,12 @@ -{{- if .Values.hyperdx.serviceAccount.create }} +{{- include "clickstack.normalizeValues" . -}} +{{- if .Values.clickstack.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "clickstack.hyperdx.serviceAccountName" . }} labels: {{- include "clickstack.labels" . | nindent 4 }} - {{- with .Values.hyperdx.serviceAccount.annotations }} + {{- with .Values.clickstack.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/clickstack/templates/mongodb/community.yaml b/charts/clickstack/templates/mongodb/community.yaml index b30347be..82c76a6b 100644 --- a/charts/clickstack/templates/mongodb/community.yaml +++ b/charts/clickstack/templates/mongodb/community.yaml @@ -1,3 +1,4 @@ +{{- include "clickstack.normalizeValues" . -}} {{- if .Values.mongodb.enabled }} apiVersion: mongodbcommunity.mongodb.com/v1 kind: MongoDBCommunity diff --git a/charts/clickstack/templates/mongodb/password-secret.yaml b/charts/clickstack/templates/mongodb/password-secret.yaml index e4a51fcc..76572e28 100644 --- a/charts/clickstack/templates/mongodb/password-secret.yaml +++ b/charts/clickstack/templates/mongodb/password-secret.yaml @@ -1,3 +1,4 @@ +{{- include "clickstack.normalizeValues" . -}} {{/* The MCK operator's MongoDBCommunity CR requires passwordSecretRef to point to a Secret with a key named "password". This template bridges the shared @@ -12,5 +13,5 @@ metadata: {{- include "clickstack.labels" . | nindent 4 }} type: Opaque stringData: - password: {{ .Values.hyperdx.secrets.MONGODB_PASSWORD | quote }} + password: {{ .Values.clickstack.secrets.MONGODB_PASSWORD | quote }} {{- end }} diff --git a/charts/clickstack/templates/otel-collector/custom-config.yaml b/charts/clickstack/templates/otel-collector/custom-config.yaml index 39dd18f0..dd57911a 100644 --- a/charts/clickstack/templates/otel-collector/custom-config.yaml +++ b/charts/clickstack/templates/otel-collector/custom-config.yaml @@ -1,3 +1,4 @@ +{{- include "clickstack.normalizeValues" . -}} {{- if and (index .Values "otel-collector" "enabled") .Values.global.otelCollector.customConfig }} apiVersion: v1 kind: ConfigMap diff --git a/charts/clickstack/tests/app-configmap_test.yaml b/charts/clickstack/tests/app-configmap_test.yaml index d5dd6347..3eaed896 100644 --- a/charts/clickstack/tests/app-configmap_test.yaml +++ b/charts/clickstack/tests/app-configmap_test.yaml @@ -36,7 +36,7 @@ tests: - it: should enable HyperDX's own telemetry when a browser endpoint is set set: - hyperdx: + clickstack: config: NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT: "https://otel.example.com" asserts: @@ -49,7 +49,7 @@ tests: - it: should let an explicit HDX_EXPORTER_ENABLED win set: - hyperdx: + clickstack: config: HDX_EXPORTER_ENABLED: "true" asserts: @@ -66,9 +66,9 @@ tests: path: data.NEXT_PUBLIC_ENABLE_PROMQL value: "true" - - it: should disable the PromQL feature flags when hyperdx.promql.enabled is false + - it: should disable the PromQL feature flags when clickstack.promql.enabled is false set: - hyperdx: + clickstack: promql: enabled: false asserts: @@ -85,11 +85,11 @@ tests: usageStatsEnabled: false asserts: - failedTemplate: - errorPattern: "hyperdx.usageStatsEnabled: use hyperdx.config.USAGE_STATS_ENABLED" + errorPattern: "hyperdx.usageStatsEnabled: use clickstack.config.USAGE_STATS_ENABLED" - it: should render USAGE_STATS_ENABLED false when opted out set: - hyperdx: + clickstack: config: USAGE_STATS_ENABLED: false asserts: @@ -99,7 +99,7 @@ tests: - it: should render user-provided config values set: - hyperdx: + clickstack: config: HYPERDX_LOG_LEVEL: "debug" CUSTOM_VAR: "custom-value" @@ -113,7 +113,7 @@ tests: - it: should render FRONTEND_URL from config override set: - hyperdx: + clickstack: config: FRONTEND_URL: "https://my-domain.com" asserts: @@ -135,7 +135,7 @@ tests: - it: should render per-signal TTL and reconcile overrides from config set: - hyperdx: + clickstack: config: HYPERDX_OTEL_EXPORTER_LOGS_TTL: "180d" HYPERDX_OTEL_EXPORTER_RECONCILE_TABLE_TTL: "true" @@ -146,3 +146,14 @@ tests: - equal: path: data.HYPERDX_OTEL_EXPORTER_RECONCILE_TABLE_TTL value: "true" + + - it: should render from hyperdx values alone, as --reuse-values from a release made before the rename does + set: + clickstack: null + hyperdx: + config: + LEGACY_ONLY: "from-hyperdx" + asserts: + - equal: + path: data.LEGACY_ONLY + value: "from-hyperdx" diff --git a/charts/clickstack/tests/app-deployment_test.yaml b/charts/clickstack/tests/app-deployment_test.yaml index f863ec22..b329d0ea 100644 --- a/charts/clickstack/tests/app-deployment_test.yaml +++ b/charts/clickstack/tests/app-deployment_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should render the app deployment correctly set: - hyperdx: + clickstack: ports: app: 3000 api: 8000 @@ -40,7 +40,7 @@ tests: - it: should scale replicas when specified set: - hyperdx: + clickstack: deployment: image: repository: hyperdx/hyperdx @@ -53,7 +53,7 @@ tests: - it: should set topology spread constraints when specified set: - hyperdx: + clickstack: deployment: topologySpreadConstraints: - maxSkew: 1 @@ -75,7 +75,7 @@ tests: - it: should set priority class name when specified set: - hyperdx: + clickstack: deployment: priorityClassName: system-node-critical asserts: @@ -85,7 +85,7 @@ tests: - it: should set container resources when specified set: - hyperdx: + clickstack: deployment: resources: limits: diff --git a/charts/clickstack/tests/app-pdb_test.yaml b/charts/clickstack/tests/app-pdb_test.yaml index f0d68129..e03e25f9 100644 --- a/charts/clickstack/tests/app-pdb_test.yaml +++ b/charts/clickstack/tests/app-pdb_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should default to maxUnavailable 1 so a single replica can still be drained set: - hyperdx: + clickstack: podDisruptionBudget: enabled: true asserts: @@ -21,7 +21,7 @@ tests: - it: should use minAvailable instead when specified set: - hyperdx: + clickstack: podDisruptionBudget: enabled: true minAvailable: 5 @@ -34,7 +34,7 @@ tests: - it: should override maxUnavailable when specified set: - hyperdx: + clickstack: podDisruptionBudget: enabled: true maxUnavailable: 2 diff --git a/charts/clickstack/tests/clickhouse-promql_test.yaml b/charts/clickstack/tests/clickhouse-promql_test.yaml index 70d32d75..520a0708 100644 --- a/charts/clickstack/tests/clickhouse-promql_test.yaml +++ b/charts/clickstack/tests/clickhouse-promql_test.yaml @@ -63,7 +63,7 @@ tests: - it: should point remote write at the configured collector database set: - hyperdx: + clickstack: config: HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE: otel asserts: @@ -76,7 +76,7 @@ tests: - it: should fall back to the default database when the collector database is empty set: - hyperdx: + clickstack: config: HYPERDX_OTEL_EXPORTER_CLICKHOUSE_DATABASE: "" asserts: @@ -152,7 +152,7 @@ tests: - it: should not inject settings when PromQL is disabled set: - hyperdx: + clickstack: promql: enabled: false asserts: diff --git a/charts/clickstack/tests/clickhouse-users_test.yaml b/charts/clickstack/tests/clickhouse-users_test.yaml index e81d2604..34a6c314 100644 --- a/charts/clickstack/tests/clickhouse-users_test.yaml +++ b/charts/clickstack/tests/clickhouse-users_test.yaml @@ -27,9 +27,9 @@ tests: path: spec.settings.extraUsersConfig.users.otelcollector.profile value: default - - it: should resolve password template expressions from hyperdx.secrets + - it: should resolve password template expressions from clickstack.secrets set: - hyperdx: + clickstack: secrets: CLICKHOUSE_APP_PASSWORD: "test-app-pass" CLICKHOUSE_PASSWORD: "test-otel-pass" diff --git a/charts/clickstack/tests/dashboard-notes_test.yaml b/charts/clickstack/tests/dashboard-notes_test.yaml index 33dae61e..35f2f328 100644 --- a/charts/clickstack/tests/dashboard-notes_test.yaml +++ b/charts/clickstack/tests/dashboard-notes_test.yaml @@ -4,25 +4,25 @@ templates: tests: - it: should warn when rbac.create is false with dashboards enabled set: - hyperdx: + clickstack: dashboards: enabled: true rbac: create: false asserts: - matchRegexRaw: - pattern: "hyperdx.dashboards.rbac.create is false" + pattern: "clickstack.dashboards.rbac.create is false" - it: should not warn when rbac.create is true and dashboards enabled set: - hyperdx: + clickstack: dashboards: enabled: true asserts: - notMatchRegexRaw: - pattern: "hyperdx.dashboards.rbac.create is false" + pattern: "clickstack.dashboards.rbac.create is false" - it: should not warn when dashboards are disabled asserts: - notMatchRegexRaw: - pattern: "hyperdx.dashboards.rbac.create is false" + pattern: "clickstack.dashboards.rbac.create is false" diff --git a/charts/clickstack/tests/dashboard-provisioner_test.yaml b/charts/clickstack/tests/dashboard-provisioner_test.yaml index 0e031302..9d8ce6e7 100644 --- a/charts/clickstack/tests/dashboard-provisioner_test.yaml +++ b/charts/clickstack/tests/dashboard-provisioner_test.yaml @@ -9,7 +9,7 @@ values: tests: - it: should not render RBAC or ConfigMap when dashboards are disabled set: - hyperdx: + clickstack: dashboards: enabled: false asserts: @@ -22,7 +22,7 @@ tests: - it: should not add sidecar when dashboards are disabled set: - hyperdx: + clickstack: dashboards: enabled: false asserts: @@ -33,7 +33,7 @@ tests: - it: should not render dashboard volumes, mounts, or env when disabled set: - hyperdx: + clickstack: dashboards: enabled: false asserts: @@ -52,7 +52,7 @@ tests: - it: should keep user volumes and mounts without a dashboards entry when disabled set: - hyperdx: + clickstack: dashboards: enabled: false deployment: @@ -99,7 +99,7 @@ tests: - it: should add dashboard-watcher sidecar when enabled set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -114,7 +114,7 @@ tests: - it: should set DASHBOARD_PROVISIONER_DIR on the app container set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -127,7 +127,7 @@ tests: - it: should use the configured sidecar image and pull policy for the watcher set: - hyperdx: + clickstack: dashboards: enabled: true sidecarImage: "example.com/mirror/k8s-sidecar:9.9.9" @@ -144,7 +144,7 @@ tests: - it: should default the watcher pull policy and apply the container security context set: - hyperdx: + clickstack: dashboards: enabled: true deployment: @@ -167,7 +167,7 @@ tests: - it: should set the discovery label on the watcher set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -186,7 +186,7 @@ tests: - it: should configure the watcher's discovery behavior env set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -219,7 +219,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -234,7 +234,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -250,7 +250,7 @@ tests: - it: should watch all namespaces when ALL is listed set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -265,7 +265,7 @@ tests: - it: should share dashboards volume between app and watcher set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -293,7 +293,7 @@ tests: - it: should merge user volumes and volumeMounts with dashboards entries without duplicate keys set: - hyperdx: + clickstack: dashboards: enabled: true deployment: @@ -340,7 +340,7 @@ tests: - it: should set DASHBOARD_PROVISIONER_ALL_TEAMS on the app container set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -353,7 +353,7 @@ tests: - it: should apply configured resources to the dashboard-watcher sidecar set: - hyperdx: + clickstack: dashboards: enabled: true resources: @@ -375,7 +375,7 @@ tests: - it: should apply the default watcher resources when not overridden set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -398,7 +398,7 @@ tests: - it: should fail when dashboards are enabled without a ServiceAccount set: - hyperdx: + clickstack: dashboards: enabled: true serviceAccount: @@ -406,12 +406,12 @@ tests: name: "" asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards: the dashboard watcher needs a ServiceAccount to bind RBAC to; set hyperdx.serviceAccount.create=true or provide hyperdx.serviceAccount.name" + errorMessage: "clickstack.dashboards: the dashboard watcher needs a ServiceAccount to bind RBAC to; set clickstack.serviceAccount.create=true or provide clickstack.serviceAccount.name" template: hyperdx/deployment.yaml - it: should create the SA and set serviceAccountName when create is true set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -425,7 +425,7 @@ tests: - it: should use existing user SA and not create a new one set: - hyperdx: + clickstack: dashboards: enabled: true serviceAccount: @@ -444,7 +444,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -487,7 +487,7 @@ tests: - it: should grant configmap list, get, and watch on the default Role set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -499,7 +499,7 @@ tests: - it: should bind the default Role to the user SA when configured set: - hyperdx: + clickstack: dashboards: enabled: true serviceAccount: @@ -513,7 +513,7 @@ tests: - it: should bind the default Role to the generated SA when no user SA configured set: - hyperdx: + clickstack: dashboards: enabled: true asserts: @@ -527,7 +527,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -614,7 +614,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -635,7 +635,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -658,7 +658,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -684,7 +684,7 @@ tests: - it: should create a ClusterRole and ClusterRoleBinding when ALL is listed set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -723,7 +723,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -754,7 +754,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -776,7 +776,7 @@ tests: - it: should bind the ClusterRoleBinding to the user SA when ALL is listed set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -792,7 +792,7 @@ tests: - it: should fail when ALL is combined with specific namespaces set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -800,12 +800,12 @@ tests: - team-a asserts: - failedTemplate: - errorMessage: 'hyperdx.dashboards.namespaces: "ALL" cannot be combined with specific namespaces (it already grants cluster-wide discovery)' + errorMessage: 'clickstack.dashboards.namespaces: "ALL" cannot be combined with specific namespaces (it already grants cluster-wide discovery)' template: hyperdx/deployment.yaml - it: should fail when a namespace entry is empty or blank set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -813,12 +813,12 @@ tests: - team-a asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.namespaces: entries must be non-empty namespace names" + errorMessage: "clickstack.dashboards.namespaces: entries must be non-empty namespace names" template: hyperdx/deployment.yaml - it: should fail when a namespace entry is whitespace-only set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -826,36 +826,36 @@ tests: - team-a asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.namespaces: entries must be non-empty namespace names" + errorMessage: "clickstack.dashboards.namespaces: entries must be non-empty namespace names" template: hyperdx/deployment.yaml - it: should fail on a case or whitespace variant of the ALL sentinel set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: - all asserts: - failedTemplate: - errorMessage: 'hyperdx.dashboards.namespaces: use exactly "ALL" (uppercase, no surrounding spaces) for cluster-wide discovery' + errorMessage: 'clickstack.dashboards.namespaces: use exactly "ALL" (uppercase, no surrounding spaces) for cluster-wide discovery' template: hyperdx/deployment.yaml - it: should fail when a namespace entry is not a valid DNS-1123 label set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: - Team_A asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.namespaces: entries must be valid DNS-1123 labels (lowercase alphanumeric and '-')" + errorMessage: "clickstack.dashboards.namespaces: entries must be valid DNS-1123 labels (lowercase alphanumeric and '-')" template: hyperdx/deployment.yaml - it: should not validate namespaces when dashboards are disabled set: - hyperdx: + clickstack: dashboards: enabled: false namespaces: @@ -875,7 +875,7 @@ tests: namespace: observability set: fullnameOverride: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - hyperdx: + clickstack: dashboards: enabled: true namespaces: @@ -889,7 +889,7 @@ tests: - it: should not render any RBAC when rbac.create is false set: - hyperdx: + clickstack: dashboards: enabled: true rbac: @@ -901,7 +901,7 @@ tests: - it: should still render the watcher sidecar when rbac.create is false set: - hyperdx: + clickstack: dashboards: enabled: true rbac: @@ -914,7 +914,7 @@ tests: - it: should not render inline ConfigMap when configMaps is empty set: - hyperdx: + clickstack: dashboards: enabled: true configMaps: {} @@ -925,7 +925,7 @@ tests: - it: should render inline ConfigMap with discovery label set: - hyperdx: + clickstack: dashboards: enabled: true configMaps: @@ -943,7 +943,7 @@ tests: - it: should include multiple dashboard files in inline ConfigMap set: - hyperdx: + clickstack: dashboards: enabled: true configMaps: @@ -961,7 +961,7 @@ tests: - it: should render without dashboard artifacts when the dashboards subtree is null set: - hyperdx: + clickstack: dashboards: null asserts: - lengthEqual: @@ -982,7 +982,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: null @@ -1000,30 +1000,30 @@ tests: - it: should fail when namespaces is not a list set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: ALL asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.namespaces: must be a list of namespace names" + errorMessage: "clickstack.dashboards.namespaces: must be a list of namespace names" template: hyperdx/deployment.yaml - it: should fail when a namespace entry is not a string set: - hyperdx: + clickstack: dashboards: enabled: true namespaces: - 123 asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.namespaces: entries must be quoted strings" + errorMessage: "clickstack.dashboards.namespaces: entries must be quoted strings" template: hyperdx/deployment.yaml - it: should fail when a configMaps value is not a string set: - hyperdx: + clickstack: dashboards: enabled: true configMaps: @@ -1031,12 +1031,12 @@ tests: name: Test asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.configMaps[test.json]: value must be a JSON string — use a YAML block scalar (|)" + errorMessage: "clickstack.dashboards.configMaps[test.json]: value must be a JSON string — use a YAML block scalar (|)" template: hyperdx/deployment.yaml - it: should fail when a configMaps key does not end in .json set: - hyperdx: + clickstack: dashboards: enabled: true configMaps: @@ -1044,12 +1044,12 @@ tests: { "name": "Kubernetes Overview", "tiles": [] } asserts: - failedTemplate: - errorMessage: 'hyperdx.dashboards.configMaps: key "k8s-overview" must be a valid ConfigMap key ending in .json (the provisioner only reads *.json files)' + errorMessage: 'clickstack.dashboards.configMaps: key "k8s-overview" must be a valid ConfigMap key ending in .json (the provisioner only reads *.json files)' template: hyperdx/deployment.yaml - it: should fail when a user volume is named dashboards set: - hyperdx: + clickstack: dashboards: enabled: true deployment: @@ -1058,12 +1058,12 @@ tests: emptyDir: {} asserts: - failedTemplate: - errorMessage: 'hyperdx.deployment.volumes: the name "dashboards" is reserved by the dashboard provisioner' + errorMessage: 'clickstack.deployment.volumes: the name "dashboards" is reserved by the dashboard provisioner' template: hyperdx/deployment.yaml - it: should fail when a user volumeMount collides with /dashboards set: - hyperdx: + clickstack: dashboards: enabled: true deployment: @@ -1075,14 +1075,14 @@ tests: mountPath: /dashboards asserts: - failedTemplate: - errorMessage: 'hyperdx.deployment.volumeMounts: the name "dashboards" and mountPath "/dashboards" are reserved by the dashboard provisioner' + errorMessage: 'clickstack.deployment.volumeMounts: the name "dashboards" and mountPath "/dashboards" are reserved by the dashboard provisioner' template: hyperdx/deployment.yaml - it: should keep the release namespace in scope when includeReleaseNamespace is explicitly true release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: true @@ -1112,7 +1112,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: null @@ -1137,7 +1137,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false @@ -1222,7 +1222,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: true @@ -1255,7 +1255,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false @@ -1323,7 +1323,7 @@ tests: release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false @@ -1347,7 +1347,7 @@ tests: - it: should still watch all namespaces with ALL when includeReleaseNamespace is false set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false @@ -1371,7 +1371,7 @@ tests: - it: should render no RBAC but scope the watcher when includeReleaseNamespace is false and rbac.create is false set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false @@ -1392,30 +1392,30 @@ tests: - it: should fail when includeReleaseNamespace is false and no namespaces are listed set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.includeReleaseNamespace: false requires at least one entry in hyperdx.dashboards.namespaces (otherwise the watcher has nothing to watch)" + errorMessage: "clickstack.dashboards.includeReleaseNamespace: false requires at least one entry in clickstack.dashboards.namespaces (otherwise the watcher has nothing to watch)" template: hyperdx/deployment.yaml - it: should fail when includeReleaseNamespace is false and namespaces is null set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false namespaces: null asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.includeReleaseNamespace: false requires at least one entry in hyperdx.dashboards.namespaces (otherwise the watcher has nothing to watch)" + errorMessage: "clickstack.dashboards.includeReleaseNamespace: false requires at least one entry in clickstack.dashboards.namespaces (otherwise the watcher has nothing to watch)" template: hyperdx/deployment.yaml - it: should fail when inline configMaps are set but the release namespace is excluded from discovery set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false @@ -1426,14 +1426,14 @@ tests: { "name": "Test", "tiles": [] } asserts: - failedTemplate: - errorMessage: "hyperdx.dashboards.configMaps: inline dashboards are created in the release namespace, which includeReleaseNamespace: false excludes from discovery; list the release namespace in hyperdx.dashboards.namespaces or ship the dashboards as labeled ConfigMaps in a watched namespace" + errorMessage: "clickstack.dashboards.configMaps: inline dashboards are created in the release namespace, which includeReleaseNamespace: false excludes from discovery; list the release namespace in clickstack.dashboards.namespaces or ship the dashboards as labeled ConfigMaps in a watched namespace" template: hyperdx/deployment.yaml - it: should allow inline configMaps when includeReleaseNamespace is false but the release namespace is listed release: namespace: observability set: - hyperdx: + clickstack: dashboards: enabled: true includeReleaseNamespace: false @@ -1455,7 +1455,7 @@ tests: - it: should not enforce the includeReleaseNamespace guard when dashboards are disabled set: - hyperdx: + clickstack: dashboards: enabled: false includeReleaseNamespace: false diff --git a/charts/clickstack/tests/default-env-vars_test.yaml b/charts/clickstack/tests/default-env-vars_test.yaml index a1bc4ec6..9875ec0b 100644 --- a/charts/clickstack/tests/default-env-vars_test.yaml +++ b/charts/clickstack/tests/default-env-vars_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should add DEFAULT_CONNECTIONS env var when configured with secrets set: - hyperdx: + clickstack: deployment: env: - name: DEFAULT_CONNECTIONS @@ -24,7 +24,7 @@ tests: - it: should add DEFAULT_SOURCES env var when configured with plain value set: - hyperdx: + clickstack: deployment: env: - name: DEFAULT_SOURCES @@ -38,7 +38,7 @@ tests: - it: should add DEFAULT_SOURCES env var when configured with secrets set: - hyperdx: + clickstack: deployment: env: - name: DEFAULT_SOURCES @@ -58,7 +58,7 @@ tests: - it: should add both DEFAULT_CONNECTIONS and DEFAULT_SOURCES when configured set: - hyperdx: + clickstack: deployment: env: - name: DEFAULT_CONNECTIONS @@ -98,7 +98,7 @@ tests: - it: should not include DEFAULT_CONNECTIONS when set to empty string set: - hyperdx: + clickstack: deployment: defaultConnections: "" asserts: @@ -128,7 +128,7 @@ tests: pattern: '"exponential histogram": "otel_metrics_exponential_histogram"' # HyperDX only creates promql-kind default sources when ENABLE_PROMQL is true, - # so the entry is safe to ship regardless of hyperdx.promql.enabled. + # so the entry is safe to ship regardless of clickstack.promql.enabled. - it: should include a PromQL source backed by the TimeSeries table asserts: - matchRegex: @@ -140,7 +140,7 @@ tests: - it: should not include DEFAULT_SOURCES when set to empty string set: - hyperdx: + clickstack: deployment: defaultSources: "" asserts: @@ -151,7 +151,7 @@ tests: - it: should work with multiline JSON value for DEFAULT_SOURCES set: - hyperdx: + clickstack: deployment: env: - name: DEFAULT_SOURCES diff --git a/charts/clickstack/tests/external-connections-secret_test.yaml b/charts/clickstack/tests/external-connections-secret_test.yaml index 3b2c8104..8bd31764 100644 --- a/charts/clickstack/tests/external-connections-secret_test.yaml +++ b/charts/clickstack/tests/external-connections-secret_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should use inline configuration when useExistingConfigSecret is false set: - hyperdx: + clickstack: deployment: useExistingConfigSecret: false defaultConnections: | @@ -55,7 +55,7 @@ tests: - it: should use external secret when useExistingConfigSecret is true set: - hyperdx: + clickstack: deployment: useExistingConfigSecret: true existingConfigSecret: "my-external-config" @@ -83,7 +83,7 @@ tests: - it: should use default keys when not specified set: - hyperdx: + clickstack: deployment: useExistingConfigSecret: true existingConfigSecret: "my-external-config" @@ -109,7 +109,7 @@ tests: - it: should use custom keys when specified set: - hyperdx: + clickstack: deployment: useExistingConfigSecret: true existingConfigSecret: "shared-configs" @@ -137,7 +137,7 @@ tests: - it: should not include DEFAULT_CONNECTIONS when defaultConnections is empty and useExistingConfigSecret is false set: - hyperdx: + clickstack: deployment: useExistingConfigSecret: false defaultConnections: "" @@ -149,7 +149,7 @@ tests: - it: should include default configuration when not overridden and useExistingConfigSecret is false set: - hyperdx: + clickstack: deployment: useExistingConfigSecret: false template: hyperdx/deployment.yaml @@ -173,7 +173,7 @@ tests: - it: should prioritize external secret over inline configuration when both are configured set: - hyperdx: + clickstack: deployment: useExistingConfigSecret: true existingConfigSecret: "priority-test-secret" @@ -225,7 +225,7 @@ tests: - it: should handle empty existingConfigSecret gracefully set: - hyperdx: + clickstack: deployment: useExistingConfigSecret: true existingConfigSecret: "" diff --git a/charts/clickstack/tests/hpa_test.yaml b/charts/clickstack/tests/hpa_test.yaml index f44714d5..397a0d21 100644 --- a/charts/clickstack/tests/hpa_test.yaml +++ b/charts/clickstack/tests/hpa_test.yaml @@ -9,7 +9,7 @@ tests: - it: should render HPA when autoscaling is enabled set: - hyperdx: + clickstack: autoscaling: enabled: true spec: @@ -44,7 +44,7 @@ tests: - it: should use fullnameOverride for scaleTargetRef name set: fullnameOverride: hyperdx-api - hyperdx: + clickstack: autoscaling: enabled: true spec: @@ -57,7 +57,7 @@ tests: - it: should fail when spec includes scaleTargetRef set: - hyperdx: + clickstack: autoscaling: enabled: true spec: @@ -69,11 +69,11 @@ tests: maxReplicas: 5 asserts: - failedTemplate: - errorMessage: "hyperdx.autoscaling.spec must not include scaleTargetRef -- the chart auto-wires it to the HyperDX Deployment. Remove scaleTargetRef from your autoscaling.spec values." + errorMessage: "clickstack.autoscaling.spec must not include scaleTargetRef -- the chart auto-wires it to the HyperDX Deployment. Remove scaleTargetRef from your autoscaling.spec values." - it: should render HPA with memory metric set: - hyperdx: + clickstack: autoscaling: enabled: true spec: diff --git a/charts/clickstack/tests/hyperdx-advanced_test.yaml b/charts/clickstack/tests/hyperdx-advanced_test.yaml index 8ab48ee8..adfa39e1 100644 --- a/charts/clickstack/tests/hyperdx-advanced_test.yaml +++ b/charts/clickstack/tests/hyperdx-advanced_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should handle complex environment variables set: - hyperdx: + clickstack: deployment: env: - name: COMPLEX_VAR1 diff --git a/charts/clickstack/tests/hyperdx-deployment_test.yaml b/charts/clickstack/tests/hyperdx-deployment_test.yaml index 20b6cbaa..c489c671 100644 --- a/charts/clickstack/tests/hyperdx-deployment_test.yaml +++ b/charts/clickstack/tests/hyperdx-deployment_test.yaml @@ -42,7 +42,7 @@ tests: - it: should set custom replicas when provided set: - hyperdx: + clickstack: deployment: replicas: 3 asserts: @@ -52,7 +52,7 @@ tests: - it: should configure pod and managed container security contexts set: - hyperdx: + clickstack: deployment: podSecurityContext: runAsNonRoot: true @@ -87,7 +87,7 @@ tests: - it: should preserve the deprecated annotations alias for pod annotations set: - hyperdx: + clickstack: deployment: annotations: prometheus.io/scrape: "true" @@ -101,7 +101,7 @@ tests: - it: should add custom pod annotations when podAnnotations is provided set: - hyperdx: + clickstack: deployment: podAnnotations: example.com/pod: "enabled" @@ -113,7 +113,7 @@ tests: - it: should keep deployment and pod annotations separate set: - hyperdx: + clickstack: deployment: deploymentAnnotations: example.com/configuration: deployment @@ -131,7 +131,7 @@ tests: - it: should prefer podAnnotations over the deprecated annotations alias set: - hyperdx: + clickstack: deployment: annotations: example.com/configuration: legacy @@ -147,7 +147,7 @@ tests: - it: should add custom labels when provided set: - hyperdx: + clickstack: deployment: labels: environment: production @@ -161,7 +161,7 @@ tests: - it: should add custom pod labels when podLabels is provided set: - hyperdx: + clickstack: deployment: podLabels: environment: production @@ -175,7 +175,7 @@ tests: - it: should keep deployment and pod labels separate set: - hyperdx: + clickstack: deployment: labels: example.com/scope: deployment @@ -193,7 +193,7 @@ tests: - it: should add custom environment variables when provided set: - hyperdx: + clickstack: deployment: env: - name: CUSTOM_ENV @@ -223,7 +223,7 @@ tests: - it: should use custom OpAMP port when provided set: - hyperdx: + clickstack: ports: opamp: 5320 asserts: @@ -260,7 +260,7 @@ tests: set: mongodb: enabled: true - hyperdx: + clickstack: deployment: waitForMongodb: image: busybox:1.36.1 @@ -285,7 +285,7 @@ tests: set: mongodb: enabled: false - hyperdx: + clickstack: deployment: initContainers: - name: fetch-cert @@ -312,7 +312,7 @@ tests: set: mongodb: enabled: true - hyperdx: + clickstack: deployment: initContainers: - name: fetch-cert @@ -336,7 +336,7 @@ tests: - it: should render user-provided volumes when set set: - hyperdx: + clickstack: deployment: volumes: - name: certs @@ -369,7 +369,7 @@ tests: - it: should render user-provided volumeMounts on the app container including subPath and readOnly set: - hyperdx: + clickstack: deployment: volumeMounts: - name: certs @@ -429,7 +429,7 @@ tests: - it: should not include livenessProbe when disabled set: - hyperdx: + clickstack: deployment: livenessProbe: enabled: false @@ -439,7 +439,7 @@ tests: - it: should not include readinessProbe when disabled set: - hyperdx: + clickstack: deployment: readinessProbe: enabled: false @@ -449,7 +449,7 @@ tests: - it: should use custom livenessProbe values when provided set: - hyperdx: + clickstack: deployment: livenessProbe: enabled: true @@ -471,7 +471,7 @@ tests: - it: should use custom readinessProbe values when provided set: - hyperdx: + clickstack: deployment: readinessProbe: enabled: true @@ -493,7 +493,7 @@ tests: - it: should use custom probe paths when provided set: - hyperdx: + clickstack: deployment: livenessProbe: enabled: true @@ -511,7 +511,7 @@ tests: - it: should use custom apiPort in probes when provided set: - hyperdx: + clickstack: ports: api: 9000 asserts: @@ -529,7 +529,7 @@ tests: - it: should set serviceAccountName when serviceAccount.create is true set: - hyperdx: + clickstack: serviceAccount: create: true asserts: @@ -539,7 +539,7 @@ tests: - it: should set serviceAccountName to existing SA when create is false but name is set set: - hyperdx: + clickstack: serviceAccount: create: false name: "my-existing-sa" @@ -550,7 +550,7 @@ tests: - it: should use custom name in serviceAccountName when create is true and name is set set: - hyperdx: + clickstack: serviceAccount: create: true name: "my-custom-sa" diff --git a/charts/clickstack/tests/hyperdx-rollout-checksums_test.yaml b/charts/clickstack/tests/hyperdx-rollout-checksums_test.yaml index d7bdd52a..16d91cbf 100644 --- a/charts/clickstack/tests/hyperdx-rollout-checksums_test.yaml +++ b/charts/clickstack/tests/hyperdx-rollout-checksums_test.yaml @@ -28,7 +28,7 @@ tests: - it: should change only the ConfigMap checksum when config content changes template: hyperdx/deployment.yaml set: - hyperdx: + clickstack: config: FRONTEND_URL: https://changed.example asserts: @@ -42,7 +42,7 @@ tests: - it: should change only the Secret checksum when independent secret content changes template: hyperdx/deployment.yaml set: - hyperdx: + clickstack: secrets: HYPERDX_API_KEY: changed asserts: @@ -62,7 +62,7 @@ tests: enabled: false otel-collector: enabled: false - hyperdx: + clickstack: secrets: null config: MONGO_URI: mongodb://external @@ -93,7 +93,7 @@ tests: - it: should preserve user annotations while reserving generated checksum keys template: hyperdx/deployment.yaml set: - hyperdx: + clickstack: deployment: annotations: example.com/legacy: preserved @@ -124,7 +124,7 @@ tests: - it: should keep checksums stable when unrelated values change template: hyperdx/deployment.yaml set: - hyperdx: + clickstack: deployment: replicas: 3 asserts: diff --git a/charts/clickstack/tests/hyperdx-service_test.yaml b/charts/clickstack/tests/hyperdx-service_test.yaml index 6c96b2a1..b5291cc8 100644 --- a/charts/clickstack/tests/hyperdx-service_test.yaml +++ b/charts/clickstack/tests/hyperdx-service_test.yaml @@ -31,7 +31,7 @@ tests: - it: should use LoadBalancer type when configured set: - hyperdx: + clickstack: service: type: LoadBalancer asserts: @@ -41,7 +41,7 @@ tests: - it: should use NodePort type when configured set: - hyperdx: + clickstack: service: type: NodePort asserts: @@ -51,7 +51,7 @@ tests: - it: should render service annotations when provided set: - hyperdx: + clickstack: service: annotations: service.beta.kubernetes.io/aws-load-balancer-internal: "true" @@ -66,7 +66,7 @@ tests: - it: should not render annotations section when annotations are empty set: - hyperdx: + clickstack: service: annotations: {} asserts: @@ -75,7 +75,7 @@ tests: - it: should use custom port when provided set: - hyperdx: + clickstack: ports: app: 4000 asserts: @@ -106,7 +106,7 @@ tests: - it: should use custom OpAMP port when provided set: - hyperdx: + clickstack: ports: opamp: 5320 asserts: @@ -119,7 +119,7 @@ tests: - it: should combine LoadBalancer type with annotations set: - hyperdx: + clickstack: service: type: LoadBalancer annotations: @@ -138,7 +138,7 @@ tests: - it: should fallback to ClusterIP when service type is not specified set: - hyperdx: + clickstack: service: {} asserts: - equal: @@ -153,7 +153,7 @@ tests: - it: should expose api port when apiPort is enabled set: - hyperdx: + clickstack: service: apiPort: enabled: true @@ -173,7 +173,7 @@ tests: - it: should use custom api port when provided set: - hyperdx: + clickstack: ports: api: 9000 service: diff --git a/charts/clickstack/tests/ingress_test.yaml b/charts/clickstack/tests/ingress_test.yaml index 449a5dca..d14f9379 100644 --- a/charts/clickstack/tests/ingress_test.yaml +++ b/charts/clickstack/tests/ingress_test.yaml @@ -18,7 +18,7 @@ _selectors: tests: - it: should not render any ingress templates when disabled set: - hyperdx: + clickstack: ingress: enabled: false asserts: @@ -27,7 +27,7 @@ tests: - it: should render primary ingress with passthrough annotations and spec set: - hyperdx: + clickstack: ingress: enabled: true annotations: @@ -69,17 +69,17 @@ tests: - it: should fail when ingress is enabled but spec is empty set: - hyperdx: + clickstack: ingress: enabled: true spec: {} asserts: - failedTemplate: - errorMessage: "hyperdx.ingress.spec is required when ingress is enabled" + errorMessage: "clickstack.ingress.spec is required when ingress is enabled" - it: should render primary ingress with nginx configuration set: - hyperdx: + clickstack: ingress: enabled: true annotations: @@ -114,7 +114,7 @@ tests: - it: should render primary ingress without annotations when empty set: - hyperdx: + clickstack: ingress: enabled: true annotations: {} @@ -136,7 +136,7 @@ tests: - it: should render additional ingress templates alongside primary set: - hyperdx: + clickstack: ingress: enabled: true annotations: @@ -189,7 +189,7 @@ tests: - it: should render additional ingress templates with TLS enabled set: - hyperdx: + clickstack: ingress: enabled: true spec: @@ -231,7 +231,7 @@ tests: - it: should fail when annotations of the additional ingresses is not a map of strings set: - hyperdx: + clickstack: ingress: enabled: true spec: @@ -264,7 +264,7 @@ tests: - it: should fail when TLS configuration specifies secretName without hosts set: - hyperdx: + clickstack: ingress: enabled: true spec: @@ -296,7 +296,7 @@ tests: - it: should fail when paths object is missing required properties set: - hyperdx: + clickstack: ingress: enabled: true spec: @@ -325,7 +325,7 @@ tests: - it: should use service name suffix when name is provided in additional ingress paths set: - hyperdx: + clickstack: ingress: enabled: true spec: diff --git a/charts/clickstack/tests/legacy-hyperdx-values_test.yaml b/charts/clickstack/tests/legacy-hyperdx-values_test.yaml new file mode 100644 index 00000000..02a4eb7f --- /dev/null +++ b/charts/clickstack/tests/legacy-hyperdx-values_test.yaml @@ -0,0 +1,83 @@ +suite: Test Legacy hyperdx Values Key +templates: + - hyperdx/deployment.yaml + - hyperdx/configmap.yaml + - hyperdx/secret.yaml + - NOTES.txt +tests: + - it: should apply legacy hyperdx values over the clickstack defaults + set: + hyperdx: + deployment: + replicas: 3 + asserts: + - equal: + path: spec.replicas + value: 3 + template: hyperdx/deployment.yaml + - matchRegex: + path: spec.template.spec.containers[0].image + pattern: "^docker\\.hyperdx\\.io/hyperdx/hyperdx:" + template: hyperdx/deployment.yaml + + - it: should let hyperdx win when both keys set the same value + set: + clickstack: + deployment: + replicas: 2 + hyperdx: + deployment: + replicas: 5 + asserts: + - equal: + path: spec.replicas + value: 5 + template: hyperdx/deployment.yaml + + - it: should treat a nested legacy null as removing the clickstack default + set: + hyperdx: + config: + HDX_EXPORTER_ENABLED: null + asserts: + - notExists: + path: data.HDX_EXPORTER_ENABLED + template: hyperdx/configmap.yaml + + - it: should resolve .Values.hyperdx in tpl strings set under the legacy key + set: + hyperdx: + config: + LEGACY_TPL: "{{ .Values.hyperdx.ports.app }}" + asserts: + - equal: + path: data.LEGACY_TPL + value: "3000" + template: hyperdx/configmap.yaml + + - it: should resolve .Values.hyperdx in tpl strings set under clickstack + set: + clickstack: + config: + LEGACY_TPL: "{{ .Values.hyperdx.ports.app }}" + asserts: + - equal: + path: data.LEGACY_TPL + value: "3000" + template: hyperdx/configmap.yaml + + - it: should warn when the legacy key is set + set: + hyperdx: + deployment: + replicas: 3 + asserts: + - matchRegexRaw: + pattern: "the top-level hyperdx values key is deprecated" + template: NOTES.txt + + - it: should not warn without the legacy key + asserts: + - notMatchRegexRaw: + pattern: "hyperdx values key is deprecated" + template: NOTES.txt diff --git a/charts/clickstack/tests/mongodb-deployment_test.yaml b/charts/clickstack/tests/mongodb-deployment_test.yaml index 596e3ba6..f89b7ad2 100644 --- a/charts/clickstack/tests/mongodb-deployment_test.yaml +++ b/charts/clickstack/tests/mongodb-deployment_test.yaml @@ -114,7 +114,7 @@ tests: templates: - mongodb/password-secret.yaml set: - hyperdx: + clickstack: secrets: MONGODB_PASSWORD: "s3cret!" asserts: diff --git a/charts/clickstack/tests/networkpolicy_test.yaml b/charts/clickstack/tests/networkpolicy_test.yaml index de480439..5207c885 100644 --- a/charts/clickstack/tests/networkpolicy_test.yaml +++ b/charts/clickstack/tests/networkpolicy_test.yaml @@ -9,17 +9,17 @@ tests: - it: should fail when networkPolicy is enabled but spec is empty set: - hyperdx: + clickstack: networkPolicy: enabled: true spec: {} asserts: - failedTemplate: - errorMessage: "hyperdx.networkPolicy.spec is required when networkPolicy is enabled" + errorMessage: "clickstack.networkPolicy.spec is required when networkPolicy is enabled" - it: should render NetworkPolicy with egress deny list set: - hyperdx: + clickstack: networkPolicy: enabled: true spec: @@ -44,7 +44,7 @@ tests: - it: should render NetworkPolicy with ingress rules set: - hyperdx: + clickstack: networkPolicy: enabled: true spec: diff --git a/charts/clickstack/tests/node-selector_test.yaml b/charts/clickstack/tests/node-selector_test.yaml index 33507d42..b1302b6d 100644 --- a/charts/clickstack/tests/node-selector_test.yaml +++ b/charts/clickstack/tests/node-selector_test.yaml @@ -18,7 +18,7 @@ tests: - it: should apply nodeSelector to HyperDX deployment when configured set: - hyperdx: + clickstack: deployment: nodeSelector: disktype: ssd @@ -35,7 +35,7 @@ tests: - it: should apply tolerations to HyperDX deployment when configured set: - hyperdx: + clickstack: deployment: tolerations: - key: hyperdx-key @@ -63,7 +63,7 @@ tests: - it: should apply correct nodeSelector and tolerations to HyperDX deployment set: - hyperdx: + clickstack: deployment: nodeSelector: component: api @@ -95,7 +95,7 @@ tests: enabled: false otel: enabled: false - hyperdx: + clickstack: tasks: enabled: false deployment: diff --git a/charts/clickstack/tests/otel-collector-custom-config_test.yaml b/charts/clickstack/tests/otel-collector-custom-config_test.yaml index ef3bde17..83484a79 100644 --- a/charts/clickstack/tests/otel-collector-custom-config_test.yaml +++ b/charts/clickstack/tests/otel-collector-custom-config_test.yaml @@ -81,7 +81,7 @@ tests: path: data.CUSTOM_OTELCOL_CONFIG_FILE value: "/etc/otelcol-contrib/custom/custom.config.yaml" - - it: should let hyperdx.config override CUSTOM_OTELCOL_CONFIG_FILE + - it: should let clickstack.config override CUSTOM_OTELCOL_CONFIG_FILE template: hyperdx/configmap.yaml set: global: @@ -89,7 +89,7 @@ tests: customConfig: | receivers: hostmetrics: - hyperdx: + clickstack: config: CUSTOM_OTELCOL_CONFIG_FILE: "/custom/path/config.yaml" asserts: diff --git a/charts/clickstack/tests/otel-collector_test.yaml b/charts/clickstack/tests/otel-collector_test.yaml index 1279fdc5..4994cfc2 100644 --- a/charts/clickstack/tests/otel-collector_test.yaml +++ b/charts/clickstack/tests/otel-collector_test.yaml @@ -27,7 +27,7 @@ tests: - it: should contain OPAMP_SERVER_URL with default service name set: - hyperdx: + clickstack: ports: opamp: 4321 release: @@ -39,7 +39,7 @@ tests: - it: should contain CLICKHOUSE_USER from config set: - hyperdx: + clickstack: config: CLICKHOUSE_USER: "myuser" asserts: diff --git a/charts/clickstack/tests/otel-exporter-endpoint_test.yaml b/charts/clickstack/tests/otel-exporter-endpoint_test.yaml index df980f07..10426d55 100644 --- a/charts/clickstack/tests/otel-exporter-endpoint_test.yaml +++ b/charts/clickstack/tests/otel-exporter-endpoint_test.yaml @@ -10,7 +10,7 @@ tests: - it: should use custom OTEL_EXPORTER_OTLP_ENDPOINT when explicitly set in config set: - hyperdx: + clickstack: config: OTEL_EXPORTER_OTLP_ENDPOINT: "http://custom-otel-collector:4318" asserts: @@ -20,7 +20,7 @@ tests: - it: should set empty string when OTEL_EXPORTER_OTLP_ENDPOINT is empty in config set: - hyperdx: + clickstack: config: OTEL_EXPORTER_OTLP_ENDPOINT: "" asserts: diff --git a/charts/clickstack/tests/removed-values_test.yaml b/charts/clickstack/tests/removed-values_test.yaml index 5c09c909..4ff781df 100644 --- a/charts/clickstack/tests/removed-values_test.yaml +++ b/charts/clickstack/tests/removed-values_test.yaml @@ -21,7 +21,7 @@ tests: appUserPassword: secret asserts: - failedTemplate: - errorPattern: "- clickhouse.config: set ClickHouse credentials in hyperdx.secrets \\(CLICKHOUSE_PASSWORD, CLICKHOUSE_APP_PASSWORD\\)\\n- hyperdx.replicas: use hyperdx.deployment.replicas\\n- mongodb.password: use hyperdx.secrets.MONGODB_PASSWORD\\n- tasks: use hyperdx.tasks$" + errorPattern: "- clickhouse.config: set ClickHouse credentials in clickstack.secrets \\(CLICKHOUSE_PASSWORD, CLICKHOUSE_APP_PASSWORD\\)\\n- hyperdx.replicas: use clickstack.deployment.replicas\\n- mongodb.password: use clickstack.secrets.MONGODB_PASSWORD\\n- tasks: use clickstack.tasks$" - it: should fail on the 1.x frontendUrl key set: @@ -29,7 +29,7 @@ tests: frontendUrl: https://hyperdx.example.com asserts: - failedTemplate: - errorPattern: "hyperdx.frontendUrl: use hyperdx.config.FRONTEND_URL" + errorPattern: "hyperdx.frontendUrl: use clickstack.config.FRONTEND_URL" - it: should fail on removed in-cluster database settings set: @@ -54,7 +54,7 @@ tests: set: clickhouse: port: 8124 - hyperdx: + clickstack: deployment: replicas: 2 tasks: @@ -137,81 +137,81 @@ tests: - failedTemplate: errorPattern: "- global\\.keepPVC: remove\\ it;\\ operator\\-managed\\ PVCs\\ are\\ always\\ kept\\ on\\ uninstall(\n|$)" - failedTemplate: - errorPattern: "- tasks: use\\ hyperdx\\.tasks(\n|$)" + errorPattern: "- tasks: use\\ clickstack\\.tasks(\n|$)" - failedTemplate: - errorPattern: "- otel: configure\\ the\\ otel\\-collector\\ subchart,\\ and\\ set\\ collector\\ env\\ vars\\ in\\ hyperdx\\.config\\ and\\ hyperdx\\.secrets(\n|$)" + errorPattern: "- otel: configure\\ the\\ otel\\-collector\\ subchart,\\ and\\ set\\ collector\\ env\\ vars\\ in\\ clickstack\\.config\\ and\\ clickstack\\.secrets(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.apiKey: use\\ hyperdx\\.secrets\\.HYPERDX_API_KEY(\n|$)" + errorPattern: "- hyperdx\\.apiKey: use\\ clickstack\\.secrets\\.HYPERDX_API_KEY(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.apiPort: use\\ hyperdx\\.ports\\.api(\n|$)" + errorPattern: "- hyperdx\\.apiPort: use\\ clickstack\\.ports\\.api(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.appPort: use\\ hyperdx\\.ports\\.app(\n|$)" + errorPattern: "- hyperdx\\.appPort: use\\ clickstack\\.ports\\.app(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.opampPort: use\\ hyperdx\\.ports\\.opamp(\n|$)" + errorPattern: "- hyperdx\\.opampPort: use\\ clickstack\\.ports\\.opamp(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.appUrl: use\\ hyperdx\\.config\\.FRONTEND_URL(\n|$)" + errorPattern: "- hyperdx\\.appUrl: use\\ clickstack\\.config\\.FRONTEND_URL(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.frontendUrl: use\\ hyperdx\\.config\\.FRONTEND_URL(\n|$)" + errorPattern: "- hyperdx\\.frontendUrl: use\\ clickstack\\.config\\.FRONTEND_URL(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.logLevel: use\\ hyperdx\\.config\\.HYPERDX_LOG_LEVEL(\n|$)" + errorPattern: "- hyperdx\\.logLevel: use\\ clickstack\\.config\\.HYPERDX_LOG_LEVEL(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.usageStatsEnabled: use\\ hyperdx\\.config\\.USAGE_STATS_ENABLED\\ \\(a\\ string,\\ e\\.g\\.\\ \"false\"\\)(\n|$)" + errorPattern: "- hyperdx\\.usageStatsEnabled: use\\ clickstack\\.config\\.USAGE_STATS_ENABLED\\ \\(a\\ string,\\ e\\.g\\.\\ \"false\"\\)(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.otelExporterEndpoint: use\\ hyperdx\\.config\\.OTEL_EXPORTER_OTLP_ENDPOINT(\n|$)" + errorPattern: "- hyperdx\\.otelExporterEndpoint: use\\ clickstack\\.config\\.OTEL_EXPORTER_OTLP_ENDPOINT(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.mongoUri: use\\ hyperdx\\.config\\.MONGO_URI(\n|$)" + errorPattern: "- hyperdx\\.mongoUri: use\\ clickstack\\.config\\.MONGO_URI(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.ingressClassName: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.ingressClassName: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.host: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.host: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.path: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.path: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.pathType: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.pathType: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.tls: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.tls: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.proxyBodySize: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.proxyBodySize: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.proxyConnectTimeout: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.proxyConnectTimeout: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.proxySendTimeout: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.proxySendTimeout: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.ingress\\.proxyReadTimeout: move\\ into\\ hyperdx\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ hyperdx\\.ingress\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.ingress\\.proxyReadTimeout: move\\ into\\ clickstack\\.ingress\\.spec,\\ and\\ nginx\\ proxy\\ settings\\ into\\ clickstack\\.ingress\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.image: use\\ hyperdx\\.deployment\\.image(\n|$)" + errorPattern: "- hyperdx\\.image: use\\ clickstack\\.deployment\\.image(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.replicas: use\\ hyperdx\\.deployment\\.replicas(\n|$)" + errorPattern: "- hyperdx\\.replicas: use\\ clickstack\\.deployment\\.replicas(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.livenessProbe: use\\ hyperdx\\.deployment\\.livenessProbe(\n|$)" + errorPattern: "- hyperdx\\.livenessProbe: use\\ clickstack\\.deployment\\.livenessProbe(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.readinessProbe: use\\ hyperdx\\.deployment\\.readinessProbe(\n|$)" + errorPattern: "- hyperdx\\.readinessProbe: use\\ clickstack\\.deployment\\.readinessProbe(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.nodeSelector: use\\ hyperdx\\.deployment\\.nodeSelector(\n|$)" + errorPattern: "- hyperdx\\.nodeSelector: use\\ clickstack\\.deployment\\.nodeSelector(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.tolerations: use\\ hyperdx\\.deployment\\.tolerations(\n|$)" + errorPattern: "- hyperdx\\.tolerations: use\\ clickstack\\.deployment\\.tolerations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.annotations: use\\ hyperdx\\.deployment\\.annotations(\n|$)" + errorPattern: "- hyperdx\\.annotations: use\\ clickstack\\.deployment\\.annotations(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.labels: use\\ hyperdx\\.deployment\\.labels(\n|$)" + errorPattern: "- hyperdx\\.labels: use\\ clickstack\\.deployment\\.labels(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.env: use\\ hyperdx\\.deployment\\.env(\n|$)" + errorPattern: "- hyperdx\\.env: use\\ clickstack\\.deployment\\.env(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.waitForMongodb: use\\ hyperdx\\.deployment\\.waitForMongodb(\n|$)" + errorPattern: "- hyperdx\\.waitForMongodb: use\\ clickstack\\.deployment\\.waitForMongodb(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.useExistingConfigSecret: use\\ hyperdx\\.deployment\\.useExistingConfigSecret(\n|$)" + errorPattern: "- hyperdx\\.useExistingConfigSecret: use\\ clickstack\\.deployment\\.useExistingConfigSecret(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.existingConfigSecret: use\\ hyperdx\\.deployment\\.existingConfigSecret(\n|$)" + errorPattern: "- hyperdx\\.existingConfigSecret: use\\ clickstack\\.deployment\\.existingConfigSecret(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.existingConfigConnectionsKey: use\\ hyperdx\\.deployment\\.existingConfigConnectionsKey(\n|$)" + errorPattern: "- hyperdx\\.existingConfigConnectionsKey: use\\ clickstack\\.deployment\\.existingConfigConnectionsKey(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.existingConfigSourcesKey: use\\ hyperdx\\.deployment\\.existingConfigSourcesKey(\n|$)" + errorPattern: "- hyperdx\\.existingConfigSourcesKey: use\\ clickstack\\.deployment\\.existingConfigSourcesKey(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.defaultConnections: use\\ hyperdx\\.deployment\\.defaultConnections(\n|$)" + errorPattern: "- hyperdx\\.defaultConnections: use\\ clickstack\\.deployment\\.defaultConnections(\n|$)" - failedTemplate: - errorPattern: "- hyperdx\\.defaultSources: use\\ hyperdx\\.deployment\\.defaultSources(\n|$)" + errorPattern: "- hyperdx\\.defaultSources: use\\ clickstack\\.deployment\\.defaultSources(\n|$)" - failedTemplate: - errorPattern: "- mongodb\\.password: use\\ hyperdx\\.secrets\\.MONGODB_PASSWORD(\n|$)" + errorPattern: "- mongodb\\.password: use\\ clickstack\\.secrets\\.MONGODB_PASSWORD(\n|$)" - failedTemplate: errorPattern: "- mongodb\\.image: configure\\ the\\ MongoDBCommunity\\ resource\\ under\\ mongodb\\.spec(\n|$)" - failedTemplate: @@ -231,7 +231,7 @@ tests: - failedTemplate: errorPattern: "- clickhouse\\.prometheus\\.endpoint: remove\\ it;\\ only\\ clickhouse\\.prometheus\\.port\\ is\\ read(\n|$)" - failedTemplate: - errorPattern: "- clickhouse\\.config: set\\ ClickHouse\\ credentials\\ in\\ hyperdx\\.secrets\\ \\(CLICKHOUSE_PASSWORD,\\ CLICKHOUSE_APP_PASSWORD\\)(\n|$)" + errorPattern: "- clickhouse\\.config: set\\ ClickHouse\\ credentials\\ in\\ clickstack\\.secrets\\ \\(CLICKHOUSE_PASSWORD,\\ CLICKHOUSE_APP_PASSWORD\\)(\n|$)" - failedTemplate: errorPattern: "- clickhouse\\.image: configure\\ the\\ ClickHouseCluster\\ resource\\ under\\ clickhouse\\.cluster\\.spec(\n|$)" - failedTemplate: diff --git a/charts/clickstack/tests/secrets_test.yaml b/charts/clickstack/tests/secrets_test.yaml index 8bbf4d03..c8fb01d0 100644 --- a/charts/clickstack/tests/secrets_test.yaml +++ b/charts/clickstack/tests/secrets_test.yaml @@ -24,7 +24,7 @@ tests: - it: should use custom secret values when provided set: - hyperdx: + clickstack: secrets: HYPERDX_API_KEY: "custom-api-key" CLICKHOUSE_PASSWORD: "custom-password" @@ -37,6 +37,20 @@ tests: value: "custom-password" - it: should not render secret when secrets is null and subcharts are disabled + set: + clickstack: + secrets: null + mongodb: + enabled: false + clickhouse: + enabled: false + otel-collector: + enabled: false + asserts: + - hasDocuments: + count: 0 + + - it: should not render secret when the legacy hyperdx.secrets is null set: hyperdx: secrets: null @@ -52,30 +66,30 @@ tests: - it: should fail when secrets is null but mongodb is enabled set: - hyperdx: + clickstack: secrets: null mongodb: enabled: true asserts: - failedTemplate: - errorMessage: "hyperdx.secrets cannot be null when mongodb, clickhouse, or otel-collector is enabled -- these subcharts require the clickstack-secret for credentials" + errorMessage: "clickstack.secrets cannot be null when mongodb, clickhouse, or otel-collector is enabled -- these subcharts require the clickstack-secret for credentials" - it: should fail when secrets is null but clickhouse is enabled set: - hyperdx: + clickstack: secrets: null clickhouse: enabled: true asserts: - failedTemplate: - errorMessage: "hyperdx.secrets cannot be null when mongodb, clickhouse, or otel-collector is enabled -- these subcharts require the clickstack-secret for credentials" + errorMessage: "clickstack.secrets cannot be null when mongodb, clickhouse, or otel-collector is enabled -- these subcharts require the clickstack-secret for credentials" - it: should fail when secrets is null but otel-collector is enabled set: - hyperdx: + clickstack: secrets: null otel-collector: enabled: true asserts: - failedTemplate: - errorMessage: "hyperdx.secrets cannot be null when mongodb, clickhouse, or otel-collector is enabled -- these subcharts require the clickstack-secret for credentials" + errorMessage: "clickstack.secrets cannot be null when mongodb, clickhouse, or otel-collector is enabled -- these subcharts require the clickstack-secret for credentials" diff --git a/charts/clickstack/tests/serviceaccount_test.yaml b/charts/clickstack/tests/serviceaccount_test.yaml index 9dcaef1b..747c4180 100644 --- a/charts/clickstack/tests/serviceaccount_test.yaml +++ b/charts/clickstack/tests/serviceaccount_test.yaml @@ -9,7 +9,7 @@ tests: - it: should render ServiceAccount when create is true set: - hyperdx: + clickstack: serviceAccount: create: true asserts: @@ -21,7 +21,7 @@ tests: - it: should use custom name when provided set: - hyperdx: + clickstack: serviceAccount: create: true name: "my-custom-sa" @@ -33,7 +33,7 @@ tests: - it: should use fullnameOverride for ServiceAccount name when name is empty set: fullnameOverride: hyperdx-api - hyperdx: + clickstack: serviceAccount: create: true asserts: @@ -43,7 +43,7 @@ tests: - it: should render annotations when provided set: - hyperdx: + clickstack: serviceAccount: create: true annotations: @@ -55,7 +55,7 @@ tests: - it: should not render annotations section when empty set: - hyperdx: + clickstack: serviceAccount: create: true annotations: {} @@ -65,7 +65,7 @@ tests: - it: should not render ServiceAccount when create is false even with name set set: - hyperdx: + clickstack: serviceAccount: create: false name: "my-existing-sa" diff --git a/charts/clickstack/tests/task-checkAlerts_test.yaml b/charts/clickstack/tests/task-checkAlerts_test.yaml index 25107135..a77e0d3c 100644 --- a/charts/clickstack/tests/task-checkAlerts_test.yaml +++ b/charts/clickstack/tests/task-checkAlerts_test.yaml @@ -4,7 +4,7 @@ templates: tests: - it: should not render when tasks are disabled set: - hyperdx: + clickstack: tasks: enabled: false asserts: @@ -13,7 +13,7 @@ tests: - it: should render correctly when tasks are enabled set: - hyperdx: + clickstack: tasks: enabled: true checkAlerts: @@ -72,7 +72,7 @@ tests: - it: should configure pod and container security contexts set: - hyperdx: + clickstack: deployment: podSecurityContext: runAsNonRoot: true @@ -102,7 +102,7 @@ tests: - it: should use default schedule when not provided set: - hyperdx: + clickstack: tasks: enabled: true asserts: @@ -112,7 +112,7 @@ tests: - it: should not include imagePullSecrets when not configured set: - hyperdx: + clickstack: tasks: enabled: true asserts: @@ -121,7 +121,7 @@ tests: - it: should include imagePullSecrets when configured set: - hyperdx: + clickstack: tasks: enabled: true global: @@ -136,7 +136,7 @@ tests: - it: should use esbuild command path for versions before 2.7.0 set: - hyperdx: + clickstack: tasks: enabled: true deployment: @@ -149,7 +149,7 @@ tests: - it: should use esbuild command path for version 2.6.0 set: - hyperdx: + clickstack: tasks: enabled: true deployment: @@ -162,7 +162,7 @@ tests: - it: should use post-esbuild command path for version 2.7.0 set: - hyperdx: + clickstack: tasks: enabled: true deployment: @@ -175,7 +175,7 @@ tests: - it: should use post-esbuild command path for versions after 2.7.0 set: - hyperdx: + clickstack: tasks: enabled: true deployment: @@ -188,7 +188,7 @@ tests: - it: should use bin/hyperdx command for version 3.0.0 set: - hyperdx: + clickstack: tasks: enabled: true deployment: @@ -201,7 +201,7 @@ tests: - it: should use post-esbuild command path for version 2.21.9 set: - hyperdx: + clickstack: tasks: enabled: true deployment: @@ -214,7 +214,7 @@ tests: - it: should use bin/hyperdx command for version 2.22.0 set: - hyperdx: + clickstack: tasks: enabled: true deployment: @@ -227,7 +227,7 @@ tests: - it: should use bin/hyperdx command for the default appVersion set: - hyperdx: + clickstack: tasks: enabled: true asserts: @@ -237,7 +237,7 @@ tests: - it: should include additionalArgs in bin/hyperdx command set: - hyperdx: + clickstack: tasks: enabled: true checkAlerts: @@ -253,7 +253,7 @@ tests: - it: should not include additionalArgs when empty set: - hyperdx: + clickstack: tasks: enabled: true checkAlerts: @@ -268,7 +268,7 @@ tests: - it: should include additionalArgs with -- prefix in command set: - hyperdx: + clickstack: tasks: enabled: true checkAlerts: @@ -294,7 +294,7 @@ tests: - it: should include additionalArgs in pre-esbuild command path set: - hyperdx: + clickstack: tasks: enabled: true checkAlerts: diff --git a/charts/clickstack/tests/values/configmap-extended.yaml b/charts/clickstack/tests/values/configmap-extended.yaml index 6b07e95c..31ddffe3 100644 --- a/charts/clickstack/tests/values/configmap-extended.yaml +++ b/charts/clickstack/tests/values/configmap-extended.yaml @@ -1,5 +1,5 @@ -hyperdx: +clickstack: config: CUSTOM_TPL_VALUE: '{{ include "clickstack.name" . }}' CUSTOM_STATIC_VALUE: static-value - NESTED_TPL: '{{ .Release.Name }}-{{ .Values.hyperdx.ports.app }}' + NESTED_TPL: '{{ .Release.Name }}-{{ .Values.clickstack.ports.app }}' diff --git a/charts/clickstack/tests/values/dashboards-sa.yaml b/charts/clickstack/tests/values/dashboards-sa.yaml index befde597..873a14ae 100644 --- a/charts/clickstack/tests/values/dashboards-sa.yaml +++ b/charts/clickstack/tests/values/dashboards-sa.yaml @@ -1,3 +1,3 @@ -hyperdx: +clickstack: serviceAccount: create: true diff --git a/charts/clickstack/tests/values/deployment-features.yaml b/charts/clickstack/tests/values/deployment-features.yaml index 3546c396..d6bcdbe6 100644 --- a/charts/clickstack/tests/values/deployment-features.yaml +++ b/charts/clickstack/tests/values/deployment-features.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: deployment: labels: team: observability diff --git a/charts/clickstack/tests/values/deployment-no-mongodb.yaml b/charts/clickstack/tests/values/deployment-no-mongodb.yaml index e3fd64ea..989ba2ab 100644 --- a/charts/clickstack/tests/values/deployment-no-mongodb.yaml +++ b/charts/clickstack/tests/values/deployment-no-mongodb.yaml @@ -1,6 +1,6 @@ mongodb: enabled: false -hyperdx: +clickstack: deployment: initContainers: - name: custom-init diff --git a/charts/clickstack/tests/values/deployment-probes-disabled.yaml b/charts/clickstack/tests/values/deployment-probes-disabled.yaml index 1edab69b..d9bc4830 100644 --- a/charts/clickstack/tests/values/deployment-probes-disabled.yaml +++ b/charts/clickstack/tests/values/deployment-probes-disabled.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: deployment: livenessProbe: enabled: false diff --git a/charts/clickstack/tests/values/deployment-replicas.yaml b/charts/clickstack/tests/values/deployment-replicas.yaml index a25dc9fe..18e49d2c 100644 --- a/charts/clickstack/tests/values/deployment-replicas.yaml +++ b/charts/clickstack/tests/values/deployment-replicas.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: autoscaling: enabled: false deployment: diff --git a/charts/clickstack/tests/values/deployment-tpl-defaults.yaml b/charts/clickstack/tests/values/deployment-tpl-defaults.yaml index dbdae61c..cf3aca4d 100644 --- a/charts/clickstack/tests/values/deployment-tpl-defaults.yaml +++ b/charts/clickstack/tests/values/deployment-tpl-defaults.yaml @@ -1,7 +1,7 @@ # Minimal fixture for deployment-tpl-defaults_test.yaml: exercises tpl # interpolation of the connection host and one log source table name only. # It is intentionally NOT a copy of the values.yaml defaults. -hyperdx: +clickstack: deployment: useExistingConfigSecret: false defaultConnections: | @@ -11,7 +11,7 @@ hyperdx: "host": "http://{{ include "clickstack.clickhouse.svc" . }}:8123", "port": 8123, "username": "app", - "password": "{{ .Values.hyperdx.secrets.CLICKHOUSE_APP_PASSWORD }}" + "password": "{{ .Values.clickstack.secrets.CLICKHOUSE_APP_PASSWORD }}" } ] defaultSources: | diff --git a/charts/clickstack/tests/values/existing-config-secret.yaml b/charts/clickstack/tests/values/existing-config-secret.yaml index b5721116..77b0b4ee 100644 --- a/charts/clickstack/tests/values/existing-config-secret.yaml +++ b/charts/clickstack/tests/values/existing-config-secret.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: deployment: useExistingConfigSecret: true existingConfigSecret: external-hyperdx-config diff --git a/charts/clickstack/tests/values/ingress-additional.yaml b/charts/clickstack/tests/values/ingress-additional.yaml index d58dccb5..f3ff24ca 100644 --- a/charts/clickstack/tests/values/ingress-additional.yaml +++ b/charts/clickstack/tests/values/ingress-additional.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: ingress: enabled: true spec: diff --git a/charts/clickstack/tests/values/ingress-default-service.yaml b/charts/clickstack/tests/values/ingress-default-service.yaml index ea82647e..1628d19d 100644 --- a/charts/clickstack/tests/values/ingress-default-service.yaml +++ b/charts/clickstack/tests/values/ingress-default-service.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: ingress: enabled: true spec: diff --git a/charts/clickstack/tests/values/networkpolicy-enabled.yaml b/charts/clickstack/tests/values/networkpolicy-enabled.yaml index 4e4484e7..b88db5b9 100644 --- a/charts/clickstack/tests/values/networkpolicy-enabled.yaml +++ b/charts/clickstack/tests/values/networkpolicy-enabled.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: networkPolicy: enabled: true spec: diff --git a/charts/clickstack/tests/values/notes-ingress-enabled.yaml b/charts/clickstack/tests/values/notes-ingress-enabled.yaml index d6e9d100..25ad8e40 100644 --- a/charts/clickstack/tests/values/notes-ingress-enabled.yaml +++ b/charts/clickstack/tests/values/notes-ingress-enabled.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: ingress: enabled: true spec: diff --git a/charts/clickstack/tests/values/pdb-enabled.yaml b/charts/clickstack/tests/values/pdb-enabled.yaml index c0ee8152..6750cfd0 100644 --- a/charts/clickstack/tests/values/pdb-enabled.yaml +++ b/charts/clickstack/tests/values/pdb-enabled.yaml @@ -1,3 +1,3 @@ -hyperdx: +clickstack: podDisruptionBudget: enabled: true diff --git a/charts/clickstack/tests/values/pdb-with-labels.yaml b/charts/clickstack/tests/values/pdb-with-labels.yaml index a1b0a837..a407c4b8 100644 --- a/charts/clickstack/tests/values/pdb-with-labels.yaml +++ b/charts/clickstack/tests/values/pdb-with-labels.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: podDisruptionBudget: enabled: true deployment: diff --git a/charts/clickstack/tests/values/secret-custom.yaml b/charts/clickstack/tests/values/secret-custom.yaml index 555b9ab8..ce0b0d6f 100644 --- a/charts/clickstack/tests/values/secret-custom.yaml +++ b/charts/clickstack/tests/values/secret-custom.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: secrets: HYPERDX_API_KEY: custom-api-key CLICKHOUSE_PASSWORD: custom-password diff --git a/charts/clickstack/tests/values/service-features.yaml b/charts/clickstack/tests/values/service-features.yaml index 21dc5c5d..70c65aa7 100644 --- a/charts/clickstack/tests/values/service-features.yaml +++ b/charts/clickstack/tests/values/service-features.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: service: type: LoadBalancer annotations: diff --git a/charts/clickstack/tests/values/serviceaccount-annotated.yaml b/charts/clickstack/tests/values/serviceaccount-annotated.yaml index c9021d72..ab2512f7 100644 --- a/charts/clickstack/tests/values/serviceaccount-annotated.yaml +++ b/charts/clickstack/tests/values/serviceaccount-annotated.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: serviceAccount: create: true annotations: diff --git a/charts/clickstack/tests/values/tasks-enabled.yaml b/charts/clickstack/tests/values/tasks-enabled.yaml index 0a83e179..2d044f91 100644 --- a/charts/clickstack/tests/values/tasks-enabled.yaml +++ b/charts/clickstack/tests/values/tasks-enabled.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: tasks: enabled: true deployment: diff --git a/charts/clickstack/tests/values/tasks-pre-esbuild.yaml b/charts/clickstack/tests/values/tasks-pre-esbuild.yaml index 0a31498d..dd5e1056 100644 --- a/charts/clickstack/tests/values/tasks-pre-esbuild.yaml +++ b/charts/clickstack/tests/values/tasks-pre-esbuild.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: tasks: enabled: true deployment: diff --git a/charts/clickstack/tests/values/tasks-with-args.yaml b/charts/clickstack/tests/values/tasks-with-args.yaml index d57ffa77..010a7c7e 100644 --- a/charts/clickstack/tests/values/tasks-with-args.yaml +++ b/charts/clickstack/tests/values/tasks-with-args.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: tasks: enabled: true checkAlerts: diff --git a/charts/clickstack/tests/values/tasks-with-imagepullsecrets.yaml b/charts/clickstack/tests/values/tasks-with-imagepullsecrets.yaml index 6f70dc09..fbb859f6 100644 --- a/charts/clickstack/tests/values/tasks-with-imagepullsecrets.yaml +++ b/charts/clickstack/tests/values/tasks-with-imagepullsecrets.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: tasks: enabled: true deployment: diff --git a/charts/clickstack/values.yaml b/charts/clickstack/values.yaml index 07a4cb3e..5f537740 100644 --- a/charts/clickstack/values.yaml +++ b/charts/clickstack/values.yaml @@ -35,7 +35,8 @@ global: # exporters: [clickhouse] customConfig: "" -hyperdx: +# HyperDX app settings. This key used to be called hyperdx; that name still works but is deprecated. +clickstack: # -- Ports shared across Deployment, Service, ConfigMap, and Ingress. ports: api: 8000 @@ -140,19 +141,19 @@ hyperdx: # Per-signal TTLs and reconcile need collector image 2.36.0 or newer. # Service endpoint defaults -- override to use external instances FRONTEND_URL: "http://localhost:3000" - MONGO_URI: 'mongodb://hyperdx:{{ .Values.hyperdx.secrets.MONGODB_PASSWORD }}@{{ include "clickstack.mongodb.svc" . }}:27017/hyperdx?authSource=hyperdx' + MONGO_URI: 'mongodb://hyperdx:{{ .Values.clickstack.secrets.MONGODB_PASSWORD }}@{{ include "clickstack.mongodb.svc" . }}:27017/hyperdx?authSource=hyperdx' OTEL_EXPORTER_OTLP_ENDPOINT: 'http://{{ include "clickstack.otel.fullname" . }}:4318' # HyperDX's own browser and Next.js server telemetry. Browsers can't reach the in-cluster # endpoint above, so this is on only when a browser-reachable collector URL is set: # NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT: "https://otel.example.com" - HDX_EXPORTER_ENABLED: '{{ if .Values.hyperdx.config.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT }}true{{ else }}false{{ end }}' + HDX_EXPORTER_ENABLED: '{{ if .Values.clickstack.config.NEXT_PUBLIC_OTEL_EXPORTER_OTLP_ENDPOINT }}true{{ else }}false{{ end }}' CLICKHOUSE_ENDPOINT: 'tcp://{{ include "clickstack.clickhouse.svc" . }}:{{ .Values.clickhouse.nativePort }}?dial_timeout=10s' CLICKHOUSE_SERVER_ENDPOINT: '{{ include "clickstack.clickhouse.svc" . }}:{{ .Values.clickhouse.nativePort }}' CLICKHOUSE_PROMETHEUS_METRICS_ENDPOINT: '{{ include "clickstack.clickhouse.svc" . }}:{{ .Values.clickhouse.prometheus.port }}' - OPAMP_SERVER_URL: 'http://{{ include "clickstack.hyperdx.fullname" . }}:{{ .Values.hyperdx.ports.opamp }}' - # PromQL feature flags, driven by hyperdx.promql.enabled. - ENABLE_PROMQL: '{{ if .Values.hyperdx.promql.enabled }}true{{ else }}false{{ end }}' - NEXT_PUBLIC_ENABLE_PROMQL: '{{ if .Values.hyperdx.promql.enabled }}true{{ else }}false{{ end }}' + OPAMP_SERVER_URL: 'http://{{ include "clickstack.hyperdx.fullname" . }}:{{ .Values.clickstack.ports.opamp }}' + # PromQL feature flags, driven by clickstack.promql.enabled. + ENABLE_PROMQL: '{{ if .Values.clickstack.promql.enabled }}true{{ else }}false{{ end }}' + NEXT_PUBLIC_ENABLE_PROMQL: '{{ if .Values.clickstack.promql.enabled }}true{{ else }}false{{ end }}' # -- Shared sensitive environment variables (clickstack-secret). # Set to null to skip Secret creation (requires mongodb, clickhouse, and otel-collector disabled). @@ -173,7 +174,7 @@ hyperdx: # -- Image tag. Defaults to Chart appVersion when empty. tag: pullPolicy: IfNotPresent - # -- Pod replica count. Ignored when hyperdx.autoscaling.enabled is true. + # -- Pod replica count. Ignored when clickstack.autoscaling.enabled is true. replicas: 1 resources: {} livenessProbe: @@ -234,7 +235,7 @@ hyperdx: "host": "http://{{ include "clickstack.clickhouse.svc" . }}:8123", "port": 8123, "username": "app", - "password": "{{ .Values.hyperdx.secrets.CLICKHOUSE_APP_PASSWORD }}" + "password": "{{ .Values.clickstack.secrets.CLICKHOUSE_APP_PASSWORD }}" } ] defaultSources: | @@ -463,14 +464,14 @@ clickhouse: extraUsersConfig: users: app: - password: '{{ .Values.hyperdx.secrets.CLICKHOUSE_APP_PASSWORD }}' + password: '{{ .Values.clickstack.secrets.CLICKHOUSE_APP_PASSWORD }}' profile: default grants: # The prometheus_api_v1 handler reads via the timeSeriesSelector() table function, # and ClickHouse gates every table function behind CREATE TEMPORARY TABLE. - query: "GRANT SHOW ON *.*, SELECT ON system.*, SELECT ON default.*, CREATE TEMPORARY TABLE ON *.*" otelcollector: - password: '{{ .Values.hyperdx.secrets.CLICKHOUSE_PASSWORD }}' + password: '{{ .Values.clickstack.secrets.CLICKHOUSE_PASSWORD }}' profile: default grants: - query: "GRANT SELECT,INSERT,CREATE,SHOW ON default.*" @@ -518,7 +519,7 @@ otel-collector: # Merges with any user-provided podAnnotations. podAnnotations: checksum/custom-config: '{{ .Values.global.otelCollector.customConfig | default "" | sha256sum }}' - # Subchart tpl can't see hyperdx.config/secrets to hash them, so roll on every upgrade. + # Subchart tpl can't see clickstack.config/secrets to hash them, so roll on every upgrade. # helm template (Argo CD) always renders revision 1; restart the collector manually there. rollout/release-revision: '{{ .Release.Revision }}' # Mount for the optional custom config ConfigMap rendered from diff --git a/docs/ADDITIONAL-MANIFESTS.md b/docs/ADDITIONAL-MANIFESTS.md index 7d0634ef..2112dff4 100644 --- a/docs/ADDITIONAL-MANIFESTS.md +++ b/docs/ADDITIONAL-MANIFESTS.md @@ -158,7 +158,7 @@ additionalManifests: When using the [AWS Load Balancer Controller](https://kubernetes-sigs.github.io/aws-load-balancer-controller/), disable the chart's built-in nginx Ingress and define a custom ALB Ingress: ```yaml -hyperdx: +clickstack: ingress: enabled: false @@ -224,7 +224,7 @@ metadata: labels: {{- include "clickstack.labels" . | nindent 4 }} data: - appPort: "{{ .Values.hyperdx.ports.app }}" + appPort: "{{ .Values.clickstack.ports.app }}" ``` ## Tips diff --git a/docs/SECURITY-HARDENING.md b/docs/SECURITY-HARDENING.md index a5859114..de5a682c 100644 --- a/docs/SECURITY-HARDENING.md +++ b/docs/SECURITY-HARDENING.md @@ -30,7 +30,7 @@ OTLP/gRPC is HTTP/2 by definition. The chart wires HyperDX to talk to the collec The chart ships a NetworkPolicy template at `templates/hyperdx/networkpolicy.yaml`. Enable it and provide a deny-by-default spec, e.g.: ```yaml -hyperdx: +clickstack: networkPolicy: enabled: true spec: @@ -59,10 +59,10 @@ For the OTel collector, configure the analogous NetworkPolicy through the sub-ch ## Cap container memory so cgroup OOM bounds any DoS -The default `hyperdx.deployment.resources` is empty. Setting limits ensures that a memory-exhaustion attack (HTTP/2 bomb, slow-loris variants, large-result query) gets OOM-killed and respawned rather than dragging the host into swap. A conservative starting point: +The default `clickstack.deployment.resources` is empty. Setting limits ensures that a memory-exhaustion attack (HTTP/2 bomb, slow-loris variants, large-result query) gets OOM-killed and respawned rather than dragging the host into swap. A conservative starting point: ```yaml -hyperdx: +clickstack: deployment: resources: requests: diff --git a/docs/UPGRADE.md b/docs/UPGRADE.md index cff09fa7..2b064ff9 100644 --- a/docs/UPGRADE.md +++ b/docs/UPGRADE.md @@ -2,6 +2,10 @@ Each section lists what changes when you upgrade to that chart version and anything you have to do first, newest first. A version that isn't listed needs nothing beyond `helm upgrade`. The full list of changes is in [CHANGELOG.md](../CHANGELOG.md). +## Unreleased + +- The top-level `hyperdx` values key is now `clickstack`. Values files and `--set hyperdx.*` flags still work and print a deprecation warning in the install notes; move them under `clickstack` before a future chart version removes `hyperdx`. Where both keys set the same value, `hyperdx` wins. Rendered resources don't change. `--reuse-values` keeps the release's stored `hyperdx` values, which then override anything you move under `clickstack`, so do the upgrade that moves them with `-f ` instead. + ## 3.7.0 - PromQL is on by default via `hyperdx.promql.enabled`. The chart adds Prometheus remote write/read handlers, the `prometheus_api_v1` HTTP handler and the experimental `allow_experimental_time_series_table` setting to the ClickHouse config, so the ClickHouse pods restart once. If you pin `clickhouse.cluster.spec.containerTemplate.image.tag` to a version older than 26.6, the ClickHouse settings are skipped but the HyperDX PromQL UI still shows; set `hyperdx.promql.enabled: false` there. New installs also get a `PromQL` default source; existing sources are not modified. diff --git a/examples/alb-ingress/values.yaml b/examples/alb-ingress/values.yaml index b608743c..215a4029 100644 --- a/examples/alb-ingress/values.yaml +++ b/examples/alb-ingress/values.yaml @@ -20,7 +20,7 @@ # - Replace clickstack.example.com with your domain # - Adjust ALB annotations as needed (scheme, target-type, etc.) -hyperdx: +clickstack: ingress: enabled: true annotations: diff --git a/examples/api-only/values.yaml b/examples/api-only/values.yaml index f0a2e85c..397d2705 100644 --- a/examples/api-only/values.yaml +++ b/examples/api-only/values.yaml @@ -24,7 +24,7 @@ clickhouse: otel-collector: enabled: false -hyperdx: +clickstack: secrets: null config: diff --git a/integration-tests/api-only/values.yaml b/integration-tests/api-only/values.yaml index f8bfb7da..a9267dd7 100644 --- a/integration-tests/api-only/values.yaml +++ b/integration-tests/api-only/values.yaml @@ -7,7 +7,7 @@ clickhouse: otel-collector: enabled: false -hyperdx: +clickstack: secrets: null config: diff --git a/integration-tests/full-stack/values.yaml b/integration-tests/full-stack/values.yaml index dd9fccd1..0f7ddc2b 100644 --- a/integration-tests/full-stack/values.yaml +++ b/integration-tests/full-stack/values.yaml @@ -1,4 +1,4 @@ -hyperdx: +clickstack: secrets: HYPERDX_API_KEY: "test-api-key-for-ci" config: