Helm Chart 部署

Tableau Server Helm Chart - 部署

重要提示:本文件假設您瞭解 Helm 和 Helm Chart,並且不嘗試提供詳細的規範性範例。它是為熟悉 Tableau Server 以及 Helm 和 Helm Chart的客戶設計的。

本主題會引導您完成使用 Helm Chart 在 Kubernetes 上部署 Tableau Server 的高階步驟。

必要條件

在開始之前,請確保您已滿足必要條件。有關更多資訊,請參閱 Tableau Server Helm Chart - 必要條件。

Helm Chart 下載

Helm Chart 會作為容器中的 Tableau Server 設定工具 (tableau-server-container-setup-tool-<version>.tar.gz) 中的一部分提供,並可從 Tableau Server 下載頁面下載。

擷取後,所需的 Helm Chart 檔案位於 helm/tableau 目錄中。

使用 Helm Chart 部署 Tableau Server 的快速概觀

重要資訊:這是使用 Helm Chart 部署 Tableau Server 的基本高階描述。這不是一個完整的程序。假設您已瞭解 Helm 和 Helm Chart。

在開始之前,請確保您已滿足使用 Helm Chart 部署 Tableau Server 的必要條件。有關詳細資訊,請參閱 Tableau Server Helm Chart - 必要條件。

將產品金鑰新增至 values.yaml

編輯 values.yaml,並設定產品金鑰。

部署單一節點 Tableau Server

透過在提示字元中執行下列命令來部署 Tableau Server 的單一節點執行個體(用 Release 命名空間替代<namespace>,例如 tableau 或 default):

helm install tableau-server ./helm/tableau-server \
-n <namespace> \
--create-namespace \ -f ./helm/tableau-server/values-single.yaml

部署多節點 Tableau Server

透過在提示字元中執行下列命令來部署 Tableau Server 的多節點執行個體,使用與上述相同的命名空間慣例:

helm install tableau-server ./helm/tableau-server \
-n <namespace> \
--create-namespace \ -f ./helm/tableau-server/values-multinode.yaml

EKS 多節點 Runbook(命名空間 + 靜態啟動程序 PV)

本部分會介紹 EKS 的作業順序:專用命名空間、EFS CSI 附加元件、節點角色上的 IAM、靜態啟動程序 PV 和 Helm。

  1. 建立專用命名空間。

    這必須符合啟動程序 PV 上的 claimFef.namespace。此範例使用 tableau。

    kubectl create namespace tableau-server
    kubectl get namespace tableau
  2. 確認 EFS CSI 附加元件存在。

    若缺少附加元件,請建立附加元件,並等待其狀態變為 ACTIVE:

    kubectl get csidriver efs.csi.aws.com
    aws eks describe-addon \
      --cluster-name <cluster-name> \  
      --addon-name aws-efs-csi-driver \
      --region <region> \
      --query 'addon.status'
  3. 確認儲存類別:

    efs-bootstrap 儲存類別 — 若尚未存在,請套用。有關詳細資訊,請參閱 Amazon Elastic Kubernetes Service (EKS) 必要條件。

    kubectl get csidriver efs.csi.aws.com
    aws eks describe-addon \
      --cluster-name <cluster-name> \  
      --addon-name aws-efs-csi-driver \
      --region <region> \
      --query 'addon.status'
  4. 確認靜態啟動程序 PV。

    claimRef 必須引用 Helm Chart 建立的相同命名空間和 PVC 名稱 (tableau-server-bootstrap).將 fs-... 取代為您的 EFS 檔案系統 ID:

    cat > /tmp/tableau-bootstrap-pv.yaml <<'EOF'
    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: tableau-bootstrap-pv
    spec:
      capacity:
        storage: 1Gi
      volumeMode: Filesystem
      accessModes:
        - ReadWriteMany
    persistentVolumeReclaimPolicy: Retain
    storageClassName: efs-bootstrap
    claimRef:
      namespace: tableau
      name: tableau-server-bootstrap
    csi:
      driver: efs.csi.aws.com
      volumeHandle: <fs-xxxxxxxxxxxxxxxxx>
    EOF
    kubectl apply -f /tmp/tableau-bootstrap-pv.yaml
    kubectl get pv tableau-bootstrap-pv
  5. 節點執行個體角色上的 IAM。

    附加 EFS 用戶端和 EC2 唯讀原則。有關從節點群組解析 <your-node-instance-role> 的資訊,請參閱 Amazon Elastic Kubernetes Service (EKS) 必要條件。

    efs-bootstrap 儲存類別 — 若尚未存在,請套用。有關詳細資訊,請參閱 Amazon Elastic Kubernetes Service (EKS) 必要條件。

    kubectl get csidriver efs.csi.aws.com
    aws eks describe-addon \
      --cluster-name <cluster-name> \  
      --addon-name aws-efs-csi-driver \
      --region <region> \
      --query 'addon.status'
  6. 值

    在 values-multinode.yaml(或重疊)中,設定手動靜態 PV 模式

    persistence:
      bootstrap:
    createPV: false
    volumeName: tableau-bootstrap-pv
    storageClass: efs-bootstrap
  7. 確保已按要求設定 image.repository、image.tag 和密碼/授權。

  8. 安裝 Helm Chart

    將 Chart 安裝到與 PV claimRef 相同的命名空間中:

    helm install tableau-server ./helm/tableau-server \
      -n tableau \
    -f ./helm/tableau-server/values-multinode.yaml
  9. 驗證儲存和 Pod:

    kubectl get pv,pvc -n tableau
    kubectl get pods -n tableau -w
  10. 資料 PVC 狀態

    資料 PVC 可能會短暫顯示 Pending,直到 EBS 磁碟區完成連接。所有 PVC 應轉換為 Bound,然後轉換為 Running,並最終轉換為 READY 1/1。

  11. 拓撲(可選)

    若已停用安裝後勾點,則可能需要設定節點 clustercontroller,並套用暫止的變更(請參閱本文件後面的「安裝後拓撲自動化(勾點)」)。您有多個 Tableau 節點時,tsm pending-changes apply 命令可能會導致有關索引和搜尋伺服器分佈或協調服務整體的警告。請按照索引和搜尋伺服器 以及 Tableau Server 協調服務中所述解決這些警告。

自訂安裝

  1. 自訂值

    cp ./helm/tableau-server/values.yaml 
    ./helm/tableau-server/my-values.yaml
    # Edit ./helm/tableau-server/my-values.yaml with your configuration
  2. 使用自訂值安裝

    helm install tableau-server ./helm/tableau-server -f ./helm/tableau-server/my-values.yaml

設定

部署模式

單一節點部署

單一節點部署會將 Tableau Server 作為整合型容器執行。

使用 values-single.yaml 或設定:

deploymentMode: "single"
primary:
replicaCount: 1
worker:
replicaCount: 0

多節點部署

多節點部署會執行一個主要背景工作以及一個或多個背景工作。使用 worker.replicaCount 設定背景工作計數— 使用 1、2 或叢集容量和 Tableau 拓撲允許的任何更高值。對於 replicaCount: N,Chart 會建立 tableau-server-worker-0 … tableau-server-worker-(N-1)。

使用 values-multinode.yaml(預設範例使用兩個背景工作)或明確設定:

deploymentMode: "multinode"
primary:
replicaCount: 1
worker:
replicaCount: 3 # example: three workers

拓撲對齊:values-multinode.yaml 隨附範例 config.configJson 拓撲(節點 ID,例如 node1、node2、node3)。若變更 worker.replicaCount 或重新排列服務,請更新該拓撲(以及任何相關的 Tableau 流程指派),以便 TSM 節點的數量和角色與部署相符 - 有關叢集和流程配置的資訊,請參閱 Tableau Server 說明。

關鍵設定選項

映像設定

image:
repository: tableau_server_image
tag: "latest"
pullPolicy: IfNotPresent
pullSecrets: []

授權和密碼

secrets:
  licenseKey: "YOUR-LICENSE-KEY"
tsmRemotePassword: "password"
tableauUsername: "admin"
tableauPassword: "password"

或者,可以使用環境變數進行設定:

env:
LICENSE_KEY: "YOUR-LICENSE-KEY"
TSM_REMOTE_PASSWORD: "password"
TABLEAU_USERNAME: "admin"
TABLEAU_PASSWORD: "password"

我們建議使用單獨檔案(例如,secrets.yaml),並使用 -f 開關傳遞該檔案。

secrets.yaml:

secrets:
licenseKey: "YOUR-LICENSE-KEY"
tsmRemotePassword: "YOUR-TSM-PASSWORD"
tableauUsername: "YOUR-ADMIN-USER"
tableauPassword: "YOUR-ADMIN-PASSWORD"

使用 secrets.yaml 的安裝/升級範例:

helm upgrade --install tableau-server ./helm/tableau-server \
-n default \
-f ./helm/tableau-server/values-multinode.yaml \
-f ./helm/tableau-server/secrets.yaml

附註:目前不支援引用預先存在的 Kubernetes 密碼(例如 secrets.existingSecret)。唯一支援的方法是使用具有單獨密碼值檔案的 Chart 值。

外部 PostgreSQL 存放庫

預設情況下,Helm Chart 不會使用專用值金鑰啟用外部存放庫。

我們建議您執行以下步驟來啟用外部存放庫:

  1. 部署 Chart 並確認主要 Pod 運作良好。

  2. 從主要 Pod 執行 Tableau tsm external repository。

  3. 套用暫止的變更。

範例工作流程(命令探索和套用):

# Discover command syntax for your Tableau version
kubectl exec -n default tableau-server-primary-0 -- sh -lc 'tsm topology external-services repository enable --help'
# After enabling external repository with Tableau-supported args/options:
kubectl exec -n default tableau-server-primary-0 -- sh -lc 'tsm pending-changes apply -iw --ignore-prompt'
kubectl exec -n default tableau-server-primary-0 -- sh -lc 'tsm status -v'

附註:

  • 外部存放庫設定特定於 Tableau 版本(SSL 模式、容錯移轉選項、認證欄位)。有關更多資訊,請參閱 Tableau Server 外部存放庫和 tsm topology。

  • 對於客戶部署,請將資料庫認證儲存在 Kubernetes 密碼中,並避免在 shell 歷程記錄中使用純文字。

永續性儲存

persistence:
enabled: true
storageClass: "standard"
accessMode: ReadWriteOnce
size: 100Gi

# Bootstrap volume (required for multi-node)
bootstrap:
enabled: true
storageClass: "standard"
accessMode: ReadWriteMany
size: 1Gi
createPV: false

對於使用靜態 EFS CSI 的叢集(例如,具有 mounttargetip),Helm 可以管理啟動程序 PV 和 PVC:

persistence:
bootstrap:
enabled: true
storageClass: "efs-bootstrap"
accessMode: ReadWriteMany
size: 1Gi
createPV: true
permissionsFix:
enabled: true
pv:
name: "tableau-bootstrap-pv"
csi:
driver: efs.csi.aws.com
volumeHandle: "fs-xxxxxxxx"
volumeAttributes:
mounttargetip: "10.x.x.x"

permissionsFix.enabled 會新增一個初始化容器 chown/chmods /docker/config/bootstrap,以便 Tableau 程序 (UID/GID 999:998) 可以在預設為 root:root 的共用 EFS 掛接上寫入 bootstrap.json。

createPV: true 時,Chart 會根據值(例如 tableau-bootstrap-pv)建立啟動程序 PV,並將 tableau-server-bootstrap PVC 繫結至該 PV。

若手動管理啟動程序 PV,請先建立 tableau-bootstrap-pv,然後使用 createPV: false 和 volumeName: tableau-bootstrap-pv: 安裝 Helm

apiVersion: v1
kind: PersistentVolume
metadata:
  name: tableau-bootstrap-pv
spec:
  capacity:
    storage: 1Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: efs-bootstrap
  csi:
    driver: efs.csi.aws.com
    volumeHandle: fs-xxxxxxxx
    volumeAttributes:
      mounttargetip: 10.x.x.x
kubectl apply -f tableau-bootstrap-pv.yaml
kubectl get pv tableau-bootstrap-pv

資源限制

primary:
  resources:
    limits:
      cpu: "4"
      memory: "8Gi"
    requests:
      cpu: "2"
      memory: "4Gi"

worker:
  resources:
    limits:
      cpu: "4"
      memory: "8Gi"
    requests:
      cpu: "2"
      memory: "4Gi"

服務設定

service:
  primary:
    type: ClusterIP  # or NodePort, LoadBalancer
    ports:
      http: 80
      https: 8080
      tsm: 8850

輸入

ingress:
  enabled: true
  className: "nginx"
  hosts:
    - host: tableau.example.com
      paths:
        - path: /
          pathType: Prefix
  tls:
    - secretName: tableau-tls
      hosts:
        - tableau.example.com

輸入設定 Runbook(範例:NGINX 輸入控制器)

  1. 在叢集中安裝輸入控制器(啟用 Chart 輸入之前需要)。

  2. 在值檔案中設定輸入值:

    ingress:
    enabled: true
    className: "nginx"
    annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: "64m"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
    hosts:
    - host: tableau.example.com
    paths:
    - path: /
    pathType: Prefix
    tls:
    - secretName: tableau-tls
    hosts:
    - tableau.example.com
  3. 建立 DNS 記錄,將 tableau.example.com 指向輸入/負載平衡器端點。

  4. 在 Release 命名空間中建立 TLS 密碼(或使用 cert-manager)。

  5. 部署/升級 Chart 並驗證輸入:

    helm upgrade --install tableau-server ./helm/tableau-server -n default -f ./helm/tableau-server/values.yaml
    kubectl get ingress -n default
    kubectl describe ingress tableau-server

有關詳情,請參閱:

健康情況檢查

Chart 支援啟動、活躍度和整備度探查。啟動探查允許在活躍度/整備度執行之前進行長時間的首次初始化(例如,failureThreshold: 200 × periodSeconds):

healthChecks:
  startup:
    enabled: true
    initialDelaySeconds: 300
    periodSeconds: 15
    timeoutSeconds: 30
    failureThreshold: 200
  liveness:
    enabled: true
    initialDelaySeconds: 300
    periodSeconds: 30
    timeoutSeconds: 10
    failureThreshold: 3
  readiness:
    enabled: true
    initialDelaySeconds: 300
    periodSeconds: 10
    timeoutSeconds: 5
    failureThreshold: 3

對於多節點背景工作 Pod,Chart 預設 worker.healthChecks.enabled: false,以避免在背景工作執行有限的程序集(例如,僅管理員代理程式 + 叢集控制器)時出現錯誤的探查失敗。

使用情況

存取 Tableau Server

安裝後,根據服務設定存取 Tableau Server:

  • 叢集 IP:使用連接埠轉送或輸入

  • 節點連接埠:透過 <node-ip>:<node-port> 存取

  • 負載平衡器:透過提供的外部 IP 存取

使用 TSM 命令

# Get pod name
POD_NAME=$(kubectl get pods -l app.kubernetes.io/component=primary -o jsonpath='{.items[0].metadata.name}')

# Run tabcmd
kubectl exec -it $POD_NAME -- tsm status
kubectl exec -it $POD_NAME -- tsm configuration get

使用 tabcmd

# Get pod name
POD_NAME=$(kubectl get pods -l app.kubernetes.io/component=primary -o jsonpath='{.items[0].metadata.name}')

# Run tabcmd
kubectl exec -it $POD_NAME -- tabcmd login -u admin -p password
kubectl exec -it $POD_NAME -- tabcmd sites

檢視 Tableau Server 記錄檔

# Primary node logs
kubectl logs -l app.kubernetes.io/component=primary -f

# Worker node logs (multi-node)
kubectl logs -l app.kubernetes.io/component=worker -f

# All logs
kubectl logs -l app.kubernetes.io/instance=tableau-server -f

Shell 存取

# Get pod name
POD_NAME=$(kubectl get pods -l app.kubernetes.io/component=primary -o jsonpath='{.items[0].metadata.name}')

# Open shell
kubectl exec -it $POD_NAME -- /bin/bash

升級

升級 Tableau Server Helm Chart

helm upgrade tableau-server ./helm/tableau-server -f ./helm/tableau-server/values.yaml

使用新值升級

helm upgrade tableau-server ./helm/tableau-server -f ./helm/tableau-server/new-values.yaml

安裝後拓撲自動化(勾點)

對於多節點安裝,此 Chart 可以執行安裝後/升級後勾點作業:

  • 等待背景工作節點在 TSM 中註冊

  • 設定背景工作 clustercontroller 程序指派

  • 變更暫止時,執行 tsm pending-changes apply -iw --ignore-prompt

設定:

hooks:
  autoApplyWorkerTopology:
    enabled: true
    kubectlImage: "bitnami/kubectl:latest"
    timeoutSeconds: 3600

預設:

  • 在 values.yaml 中停用

  • 在 values-multinode.yaml 中,檢查 hooks.autoApplyWorkerTopology.enabled(可能為 true 或 false ,根據 Release 而定;對於自動背景工作 clustercontroller 設定,啟用)

驗證勾點執行:

kubectl get jobs -n default
kubectl get pods -n default -l job-name=tableau-server-hook-topology
kubectl logs -n default job/tableau-server-hook-topology

勾點停用或失敗時手動遞補 — 對每個背景工作 TSM 節點執行 tsm topology set-process(有 N 個背景工作時,通常為節點 2 到節點 (1+N));使用 tsm topology list-nodes -v 確認 ID):

kubectl exec -n default tableau-server-primary-0 -- sh -lc '
tsm topology set-process -n node2 -pr clustercontroller -c 1
tsm topology set-process -n node3 -pr clustercontroller -c 1
# Add one line per additional worker node, e.g. for four workers:
# tsm topology set-process -n node4 -pr clustercontroller -c 1
# tsm topology set-process -n node5 -pr clustercontroller -c 1
tsm pending-changes apply -iw --ignore-prompt
tsm topology list-nodes -v

tsm status -v

附註:對於 tsm pending-changes apply,使用 -iw。-ig 選項在此環境中無效。

解除安裝

helm uninstall tableau-server

警告:這將刪除所有資源,包括永續性磁碟區。請務必在解除安裝之前備份資料。

驗證步驟

在 Release 之前或變更 Chart 時,請執行:

  1. Lint:

    helm lint helm/tableau-server -f helm/tableau-server/values-single.yaml
    helm lint helm/tableau-server -f helm/tableau-server/values-multinode.yaml
  2. 範本(試執行):

    helm template tableau-server helm/tableau-server -f helm/tableau-server/values-single.yaml
    helm template tableau-server helm/tableau-server -f helm/tableau-server/values-multinode.yaml
  3. 安裝測試(可選):

    1. 在測試命名空間中,使用 values-single 或 values-multinode 執行 helm install。

    2. 執行 kubectl rollout status(對於 StatefulSet,等待 Pod 就緒)和基本煙霧檢查(例如 tsm status 或透過 HTTP 連線至服務)。

有關詳細的疑難排解資訊,請參閱 Tableau Server Helm Chart - 疑難排解。

其他資源