> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Helm 部署选项（v1.x）

> v1.x ClickStack Helm 图表的高级部署配置

<Warning>
  **已弃用 — v1.x 图表**

  本页介绍处于维护模式的 **v1.x** 内联模板 Helm 图表的部署选项。有关 v2.x 图表，请参见 [Helm 部署选项](/zh/clickstack/deployment/helm-deployment-options)。如需迁移，请参见 [升级指南](/zh/clickstack/deployment/helm-upgrade)。
</Warning>

本指南介绍使用 Helm 部署 ClickStack 的高级部署选项。有关基础安装，请参见 [Helm 部署主指南](/zh/clickstack/deployment/helm-v1)。

<div id="overview">
  ## 概述
</div>

ClickStack 的 Helm 图表支持多种部署配置：

* **完整栈** (默认) - 包含所有组件
* **外部 ClickHouse** - 使用现有的 ClickHouse 集群
* **外部 OTel collector** - 使用现有的 OTel 基础设施
* **最小化部署** - 仅部署 HyperDX，并使用外部依赖

<div id="external-clickhouse">
  ## 外部 ClickHouse
</div>

如果您已有现有的 ClickHouse 集群 (包括 ClickHouse Cloud) ，则可以禁用内置的 ClickHouse 并连接到外部实例。

<div id="external-clickhouse-inline">
  ### 选项 1：内联配置 (开发/测试)
</div>

此方式适用于快速测试或非生产环境：

```yaml theme={null}
# values-external-clickhouse.yaml
clickhouse:
  enabled: false  # 禁用内置的 ClickHouse

otel:
  clickhouseEndpoint: "tcp://your-clickhouse-server:9000"
  clickhousePrometheusEndpoint: "http://your-clickhouse-server:9363"  # 可选

hyperdx:
  defaultConnections: |
    [
      {
        "name": "External ClickHouse",
        "host": "http://your-clickhouse-server:8123",
        "port": 8123,
        "username": "your-username",
        "password": "your-password"
      }
    ]
```

使用以下配置进行安装：

```shell theme={null}
helm install my-clickstack clickstack/clickstack -f values-external-clickhouse.yaml
```

<div id="external-clickhouse-secret">
  ### 选项 2：外部 Secret (推荐用于生产环境)
</div>

对于要将凭据与 Helm 配置分开的生产环境部署：

<div id="create-configuration">
  #### 创建配置文件
</div>

```bash theme={null}
# 创建 connections.json
cat <<EOF > connections.json
[
  {
    "name": "Production ClickHouse",
    "host": "https://your-production-clickhouse.com",
    "port": 8123,
    "username": "hyperdx_user",
    "password": "your-secure-password"
  }
]
EOF

# 创建 sources.json
cat <<EOF > sources.json
[
  {
    "from": {
      "databaseName": "default",
      "tableName": "otel_logs"
    },
    "kind": "log",
    "name": "Logs",
    "connection": "Production ClickHouse",
    "timestampValueExpression": "TimestampTime",
    "displayedTimestampValueExpression": "Timestamp",
    "implicitColumnExpression": "Body",
    "serviceNameExpression": "ServiceName",
    "bodyExpression": "Body",
    "eventAttributesExpression": "LogAttributes",
    "resourceAttributesExpression": "ResourceAttributes",
    "severityTextExpression": "SeverityText",
    "traceIdExpression": "TraceId",
    "spanIdExpression": "SpanId"
  },
  {
    "from": {
      "databaseName": "default",
      "tableName": "otel_traces"
    },
    "kind": "trace",
    "name": "Traces",
    "connection": "Production ClickHouse",
    "timestampValueExpression": "Timestamp",
    "displayedTimestampValueExpression": "Timestamp",
    "implicitColumnExpression": "SpanName",
    "serviceNameExpression": "ServiceName",
    "traceIdExpression": "TraceId",
    "spanIdExpression": "SpanId",
    "durationExpression": "Duration"
  }
]
EOF
```

<div id="create-kubernetes-secret">
  #### 创建 Kubernetes Secret
</div>

```bash theme={null}
kubectl create secret generic hyperdx-external-config \
  --from-file=connections.json=connections.json \
  --from-file=sources.json=sources.json

# 清理本地文件
rm connections.json sources.json
```

<div id="configure-helm-secret">
  #### 配置 Helm 使用 Secret
</div>

```yaml theme={null}
# values-external-clickhouse-secret.yaml
clickhouse:
  enabled: false

otel:
  clickhouseEndpoint: "tcp://your-clickhouse-server:9000"
  clickhousePrometheusEndpoint: "http://your-clickhouse-server:9363"

hyperdx:
  useExistingConfigSecret: true
  existingConfigSecret: "hyperdx-external-config"
  existingConfigConnectionsKey: "connections.json"
  existingConfigSourcesKey: "sources.json"
```

```shell theme={null}
helm install my-clickstack clickstack/clickstack -f values-external-clickhouse-secret.yaml
```

<div id="using-clickhouse-cloud">
  ### 使用 ClickHouse Cloud
</div>

如果使用 ClickHouse Cloud：

```yaml theme={null}
# values-clickhouse-cloud.yaml
clickhouse:
  enabled: false
  persistence:
    enabled: false

otel:
  clickhouseEndpoint: "tcp://your-cloud-instance.clickhouse.cloud:9440?secure=true"

hyperdx:
  useExistingConfigSecret: true
  existingConfigSecret: "clickhouse-cloud-config"
  existingConfigConnectionsKey: "connections.json"
  existingConfigSourcesKey: "sources.json"
```

<div id="external-otel-collector">
  ## 外部 OTEL Collector
</div>

如果你已有 OTEL collector 基础设施：

```yaml theme={null}
# values-external-otel.yaml
otel:
  enabled: false  # 禁用内置 OTel collector

hyperdx:
  otelExporterEndpoint: "http://your-otel-collector:4318"
```

```shell theme={null}
helm install my-clickstack clickstack/clickstack -f values-external-otel.yaml
```

有关通过入口暴露 OTel collector 端点的说明，请参阅[入口配置](/zh/clickstack/deployment/helm-configuration-v1#otel-collector-ingress)。

<div id="minimal-deployment">
  ## 最小化部署
</div>

对于已有基础设施的组织，只需部署 HyperDX：

```yaml theme={null}
# values-minimal.yaml
clickhouse:
  enabled: false

otel:
  enabled: false

hyperdx:
  otelExporterEndpoint: "http://your-otel-collector:4318"

  # Option 1: Inline (for testing)
  defaultConnections: |
    [
      {
        "name": "External ClickHouse",
        "host": "http://your-clickhouse-server:8123",
        "port": 8123,
        "username": "your-username",
        "password": "your-password"
      }
    ]

  # 选项 2：外部 Secret（生产环境）
  # useExistingConfigSecret: true
  # existingConfigSecret: "my-external-config"
  # existingConfigConnectionsKey: "connections.json"
  # existingConfigSourcesKey: "sources.json"
```

```shell theme={null}
helm install my-clickstack clickstack/clickstack -f values-minimal.yaml
```

<div id="next-steps">
  ## 后续步骤
</div>

* [配置指南 (v1.x)](/zh/clickstack/deployment/helm-configuration-v1) - API 密钥、Secret 和入口设置
* [云部署 (v1.x)](/zh/clickstack/deployment/helm-cloud-v1) - GKE、EKS 和 AKS 的特定配置
* [Helm 主指南 (v1.x)](/zh/clickstack/deployment/helm-v1) - 基础安装
* [部署选项 (v2.x)](/zh/clickstack/deployment/helm-deployment-options) - v2.x 部署选项
* [升级指南](/zh/clickstack/deployment/helm-upgrade) - 从 v1.x 迁移到 v2.x
