Skip to content

Examples and use cases

This page provides complete examples for common Apex deployment scenarios. Use these as starting points and adapt them to your environment.

The simplest deployment: all components on one node using local transport.

Use case: Development, testing, or small production deployments on a single machine.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: single-node-local
spec:
release:
profile: all-in-one
channel: stable
nodes:
- name: localhost
transport: local
host: localhost
platform: linux-x64
roles:
- id: tsdb
component: tsdb
version: auto
- id: idmp
component: idmp
version: auto
- id: tdgpt
component: tdgpt
version: auto

Deploy:

Terminal window
apex deploy -f single-node-local.yaml --yes

Deploy to one remote server via SSH.

Use case: Dedicated TDengine server separate from your workstation.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: single-remote-node
spec:
release:
profile: all-in-one
channel: stable
ssh:
user: root
keyPath: ~/.ssh/apex-deploy
port: 22
nodes:
- name: tdengine-server
transport: ssh
host: 192.168.1.100
platform: linux-x64
roles:
- id: tsdb
component: tsdb
version: auto
- id: idmp
component: idmp
version: auto
- id: tdgpt
component: tdgpt
version: auto

Setup:

Terminal window
# Generate deployment key
ssh-keygen -t ed25519 -f ~/.ssh/apex-deploy
# Deploy public key
ssh-copy-id -i ~/.ssh/apex-deploy.pub root@192.168.1.100
# Check connectivity
apex check -f single-remote-node.yaml
# Deploy
apex deploy -f single-remote-node.yaml --yes

Deploy TSDB across multiple nodes for high availability.

Use case: Production TSDB cluster with dedicated IDMP and TDgpt nodes.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: multi-node-cluster
spec:
release:
profile: TSDB-Enterprise
channel: stable
ssh:
user: root
keyPath: ~/.ssh/apex-deploy
port: 22
nodes:
# TSDB nodes
- name: tsdb-node1
transport: ssh
host: 10.0.1.101
platform: linux-x64
roles:
- id: tsdb1
component: tsdb
version: "3.3.5.0"
- name: tsdb-node2
transport: ssh
host: 10.0.1.102
platform: linux-x64
roles:
- id: tsdb2
component: tsdb
version: "3.3.5.0"
- name: tsdb-node3
transport: ssh
host: 10.0.1.103
platform: linux-x64
roles:
- id: tsdb3
component: tsdb
version: "3.3.5.0"
# IDMP node
- name: idmp-node
transport: ssh
host: 10.0.1.110
platform: linux-x64
roles:
- id: idmp
component: idmp
version: "1.2.3.0"
# TDgpt node
- name: tdgpt-node
transport: ssh
host: 10.0.1.120
platform: linux-x64
roles:
- id: tdgpt
component: tdgpt
version: "1.0.5.0"

Deploy:

Terminal window
# Validate configuration
apex validate -f multi-node-cluster.yaml --manifests ~/.apex/manifests/
# Review plan
apex apply -f multi-node-cluster.yaml --dry-run
# Deploy
apex deploy -f multi-node-cluster.yaml --yes

Deploy to Windows servers.

Use case: Windows-based infrastructure.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: windows-deployment
spec:
release:
profile: all-in-one
channel: stable
ssh:
user: Administrator
keyPath: ~/.ssh/windows-deploy
port: 22
nodes:
- name: win-server1
transport: ssh
host: 192.168.1.200
platform: windows-x64
apexDir: C:\ProgramData\TDengine\Apex
roles:
- id: tsdb
component: tsdb
version: auto
- id: idmp
component: idmp
version: auto

Notes:

  • OpenSSH must be installed on Windows targets
  • Use Administrator or a user with admin privileges
  • apexDir defaults to C:\ProgramData\TDengine\Apex if omitted

Deploy to both Linux and Windows nodes.

Use case: Heterogeneous infrastructure.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: mixed-platform
spec:
release:
profile: TSDB-Enterprise
channel: stable
ssh:
user: root
keyPath: ~/.ssh/apex-deploy
nodes:
- name: linux-tsdb
transport: ssh
host: 10.0.1.101
platform: linux-x64
roles:
- id: tsdb-linux
component: tsdb
version: "3.3.5.0"
- name: windows-idmp
transport: ssh
host: 10.0.1.200
platform: windows-x64
ssh:
user: Administrator
keyPath: ~/.ssh/windows-deploy
roles:
- id: idmp-win
component: idmp
version: "1.2.3.0"

Production deployment with explicit version control.

Use case: Production environments requiring version stability.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: production-stable
spec:
# No release section - all versions explicit
ssh:
user: deploy-user
keyPath: ~/.ssh/apex-prod
port: 2222 # Non-standard SSH port
nodes:
- name: prod-node1
transport: ssh
host: prod-db01.example.com
platform: linux-x64
apexDir: /opt/apex
roles:
- id: tsdb-prod
component: tsdb
version: "3.3.5.0" # Pinned version
- id: idmp-prod
component: idmp
version: "1.2.3.0" # Pinned version
- id: tdgpt-prod
component: tdgpt
version: "1.0.5.0" # Pinned version

Best practices:

  • Pin all versions explicitly
  • Use non-standard SSH port
  • Use dedicated deployment user
  • Set custom apexDir if needed
  • Test in staging first with same versions

Development setup mixing local and remote nodes.

Use case: Develop locally, test on remote infrastructure.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: dev-hybrid
spec:
release:
profile: all-in-one
channel: stable
ssh:
user: developer
keyPath: ~/.ssh/dev-key
nodes:
# Local development TSDB
- name: local-tsdb
transport: local
host: localhost
platform: linux-x64
roles:
- id: local-tsdb
component: tsdb
version: auto
# Remote IDMP for testing
- name: remote-idmp
transport: ssh
host: dev-server.internal
platform: linux-x64
roles:
- id: remote-idmp
component: idmp
version: auto

Deploy to ARM64 servers (e.g., AWS Graviton, Raspberry Pi clusters).

Use case: ARM-based infrastructure.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: arm64-deployment
spec:
release:
profile: TSDB-Enterprise
channel: stable
ssh:
user: ubuntu
keyPath: ~/.ssh/arm-deploy
nodes:
- name: graviton-node1
transport: ssh
host: 10.0.2.101
platform: linux-arm64
roles:
- id: tsdb-arm1
component: tsdb
version: auto
- name: graviton-node2
transport: ssh
host: 10.0.2.102
platform: linux-arm64
roles:
- id: tsdb-arm2
component: tsdb
version: auto

Deploy in an environment without internet access.

Use case: Secure or isolated networks.

Preparation (on connected machine):

Terminal window
# Download Apex release
curl -O https://downloads.tdengine.com/apex/v0.4.0/apex-linux-x64-v0.4.0.tar.gz
# Download component artifacts (after preparing on connected host)
cp -r ~/.apex/cache offline-bundle/
# Transfer offline-bundle/ to air-gapped environment

Deployment YAML (on air-gapped machine):

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: airgap-deployment
spec:
release:
profile: all-in-one
channel: stable
nodes:
- name: secure-node
transport: local
host: localhost
platform: linux-x64
roles:
- id: tsdb
component: tsdb
version: "3.3.5.0"
- id: idmp
component: idmp
version: "1.2.3.0"

Deploy:

Terminal window
# Install Apex from offline bundle
tar xzf apex-linux-x64-v0.4.0.tar.gz
cd apex-linux-x64-v0.4.0
./install.sh -OfflineBundle .
# Import artifacts
apex prepare -f airgap-deployment.yaml \
--manifests ~/.apex/manifests/ \
--import-dir ./cache
# Deploy
apex apply -f airgap-deployment.yaml --yes

Per-node SSH configuration overrides.

Use case: Different credentials or ports per node.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: custom-ssh
spec:
# Global SSH defaults
ssh:
user: root
keyPath: ~/.ssh/default-key
port: 22
nodes:
- name: node1
transport: ssh
host: 10.0.1.101
platform: linux-x64
# Uses global SSH settings
roles:
- id: tsdb1
component: tsdb
version: auto
- name: node2
transport: ssh
host: 10.0.1.102
platform: linux-x64
# Override SSH settings for this node
ssh:
user: ubuntu
keyPath: ~/.ssh/node2-key
port: 2222
roles:
- id: tsdb2
component: tsdb
version: auto
- name: node3
transport: ssh
host: 10.0.1.103
platform: linux-x64
# Use password auth for this node (not recommended)
ssh:
user: admin
password: "${NODE3_PASSWORD}"
roles:
- id: idmp
component: idmp
version: auto

Deploy:

Terminal window
export NODE3_PASSWORD="secure-password"
apex deploy -f custom-ssh.yaml --yes

Deploy through a bastion host.

Use case: Production networks requiring jump servers.

apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: bastion-deployment
spec:
release:
profile: all-in-one
channel: stable
ssh:
user: deploy-user
keyPath: ~/.ssh/prod-key
port: 22
proxyJump: bastion-user@bastion.example.com
nodes:
- name: prod-db01
transport: ssh
host: 10.0.1.101 # Private IP
platform: linux-x64
roles:
- id: tsdb
component: tsdb
version: "3.3.5.0"
- id: idmp
component: idmp
version: "1.2.3.0"

SSH Config (~/.ssh/config):

Host bastion.example.com
User bastion-user
IdentityFile ~/.ssh/bastion-key
Host 10.0.1.*
ProxyJump bastion.example.com
User deploy-user
IdentityFile ~/.ssh/prod-key

Deploy components in stages with validation between.

Use case: Large production deployments requiring careful orchestration.

Stage 1: Deploy TSDB only

stage1-tsdb.yaml
apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: stage1-tsdb
spec:
release:
profile: TSDB-Enterprise
channel: stable
ssh:
user: root
keyPath: ~/.ssh/prod-key
nodes:
- name: tsdb-node1
transport: ssh
host: 10.0.1.101
platform: linux-x64
roles:
- id: tsdb1
component: tsdb
version: "3.3.5.0"
Terminal window
apex deploy -f stage1-tsdb.yaml --yes
# Validate TSDB is working
apex-component-status.sh

Stage 2: Add IDMP

stage2-idmp.yaml
apiVersion: tdengine.taosdata.com/v1
kind: Deployment
metadata:
name: stage2-with-idmp
spec:
ssh:
user: root
keyPath: ~/.ssh/prod-key
nodes:
- name: tsdb-node1
transport: ssh
host: 10.0.1.101
platform: linux-x64
roles:
- id: tsdb1
component: tsdb
version: "3.3.5.0"
- id: idmp1
component: idmp
version: "1.2.3.0"
Terminal window
apex deploy -f stage2-idmp.yaml --yes
# Validate IDMP connectivity to TSDB

Automated deployment from CI/CD pipeline.

Use case: Automated testing and deployment.

GitLab CI (.gitlab-ci.yml):

deploy-staging:
stage: deploy
environment: staging
script:
- curl -fsSL https://downloads.tdengine.com/apex/latest/install.sh | bash
- apex check -f deployments/staging.yaml
- apex validate -f deployments/staging.yaml --manifests ~/.apex/manifests/
- apex deploy -f deployments/staging.yaml --yes
only:
- develop
deploy-production:
stage: deploy
environment: production
script:
- curl -fsSL https://downloads.tdengine.com/apex/latest/install.sh | bash
- apex deploy -f deployments/production.yaml --yes
only:
- main
when: manual # Require manual approval

GitHub Actions (.github/workflows/deploy.yml):

name: Deploy TDengine
on:
push:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Apex
run: |
curl -fsSL https://downloads.tdengine.com/apex/latest/install.sh | bash
echo "$HOME/.apex/bin" >> $GITHUB_PATH
- name: Setup SSH Key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy-key
chmod 600 ~/.ssh/deploy-key
- name: Deploy
env:
SSH_PASSWORD: ${{ secrets.SSH_PASSWORD }}
run: |
apex check -f deployment.yaml
apex deploy -f deployment.yaml --yes

Resolve versions dynamically but save for reproducibility:

Terminal window
# Resolve versions
apex validate -f deployment.yaml --manifests ~/.apex/manifests/ \
> deployment-resolved.yaml
# Review resolved versions
cat deployment-resolved.yaml
# Deploy with resolved versions
apex prepare -f deployment-resolved.yaml --manifests ~/.apex/manifests/
apex apply -f deployment-resolved.yaml --yes
# Save for rollback
cp deployment-resolved.yaml deployments/prod-$(date +%Y%m%d).yaml
Terminal window
apex deploy -f deployment.yaml --yes
# Wait for services to start
sleep 30
# Check component status
apex-component-status.sh
# Custom health checks
curl -f http://localhost:6041/rest/sql -u root:taosdata \
-d 'show databases'
Terminal window
# Save current deployment
cp deployment.yaml deployment-backup-$(date +%Y%m%d).yaml
# Deploy new version
apex deploy -f deployment-new.yaml --yes
# If problems occur, rollback
apex deploy -f deployment-backup-20250115.yaml --yes