Skip to content

Helm Deployment

This article introduces how to deploy HENGSHI SENSE on Kubernetes using Helm, as well as how to perform version upgrades and data backups after deployment.

Pre-deployment Preparation

Helm VersionDownload File
v3.xhelm-v3.13.3-linux-amd64.tar.gz

Tip

Download the Helm binary package to the deployment machine, copy it to the /usr/bin directory, and execute helm version to output version.BuildInfo Version:"v3.13.3", indicating that the installation is complete.

  1. Add Helm Repository

    shell
    helm repo add hengshi-charts https://hs-chart-repo.s3.cn-north-1.amazonaws.com.cn/charts/
  2. Update Helm Repository

    shell
    helm repo update
    helm search repo hengshi-charts # -l to list all versions
  3. Import Offline Images

    shell
    wget https://download.hengshi.com/releases/hengshi-sense-xxx.tar.gz
    docker load -i hengshi-sense-xxx.tar.gz

Tip

The k8s/helm environment requires pushing the images to the image registry used by the cluster, such as registry, harbor, Alibaba Cloud image registry, Tencent Cloud image registry.

Cluster Deployment

Both k8s/helm deployments are defaulted to cluster mode.

  1. Custom Configuration File
    • Adjust the number of HENGSHI instances based on the license

Tip

For the initial deployment, set the hengshi replica count to 1. That is, in the custom configuration file parameters below, set hengshi_replicas: 1 After obtaining the license file and importing it, start scaling the number of pods --replicas= to match the instance limit in the license

shell
  kubectl -n [namespace] scale deployment/hengshi-sense --replicas=3
  • Essential parameters required for deployment, save them to a local file
shell
hengshi_replicas: 3 # Default hengshi node count is 3, please match it with the license limit
gpdb_seg_replicas: 3
gpdb_segments:
  - segment-0
  - segment-1
  - segment-2
image: # Modify your image tag
  hengshi: "registry.hengshi.org/hengshi-sense:4.0.4-dp-a3d11d"
  gpdb: "registry.hengshi.org/gpdb:6.18.2.0"
stroage_name:
  gpdb_master_size: 50Gi
  gpdb_segment_size: 50Gi
  metadb_size: 50Gi
  minio_size: 50Gi
  redis_size: 10Gi
  flink_size: 10Gi
  ClassName: longhorn
  accessModes: ['ReadWriteOnce']

Tip

Modify ClassName to the storage class of the current cluster, pay attention to the minimum disk size limit for cloud architecture. eg. Alibaba Cloud ssd disk minimum 20Gi

  1. Install Charts
shell
# Get the latest version of the current chart -l parameter to view all versions
helm search repo hengshi-charts
NAME                        	CHART VERSION	APP VERSION	DESCRIPTION
hengshi-charts/hengshi-sense	1.2.2        	4.2        	HENGSHI SENSE
shell
helm install -f hs-config.yaml hengshi-sense hengshi-charts/hengshi-sense --version [chart_version] -n [namespace] # chart_version is the available version listed by helm search repo hengshi-charts
  1. Modify configmap (Execute this step if you need to modify custom configurations such as account passwords, otherwise skip)
shell
# Configmap names that can be modified: hengshi-sense greenplum metadb
kubectl edit configmap [configmap_name] -n [namespace]

Configuration Content Reference

  1. Initialize engine (This step can be skipped as the hengshi built-in engine has been replaced, no need to initialize)
shell
kubectl -n [namespace] exec -it master-0 -- /entrypoint.sh -m initsystem
kubectl -n [namespace] exec -it master-0 -- /entrypoint.sh -m startsystem

Standalone Deployment

  1. Custom Configuration File
    • Essential parameters required for deployment
shell
cluster_enable: false
image: # Modify your image tag
  hengshi: "registry.hengshi.org/hengshi-sense:4.0.4-dp-a3d11d"
  gpdb: "registry.hengshi.org/gpdb:6.18.2.0"
stroage_name:
  gpdb_master_size: 50Gi
  gpdb_segment_size: 50Gi
  metadb_size: 50Gi
  minio_size: 50Gi
  redis_size: 10Gi
  flink_size: 10Gi
  ClassName: longhorn # Modify to your local storage class
  accessModes: ['ReadWriteOnce']
  1. Install Charts
shell
# Get the latest version of the current chart -l parameter to view all versions
helm search repo hengshi-charts
NAME                        	CHART VERSION	APP VERSION	DESCRIPTION
hengshi-charts/hengshi-sense	1.2.2        	4.2        	HENGSHI SENSE
shell
# Install a specific version of the "HengshiSense" application using custom configuration
helm install -f hs-config.yaml hengshi-sense hengshi-charts/hengshi-sense --version 1.1.2 -n [namespace]
  1. Modify ConfigMap (Execute this step if you need to modify custom configurations such as account passwords, otherwise ignore)
shell
# ConfigMap names that can be modified: hengshi-sense greenplum metadb
kubectl edit configmap [configmap_name] -n [namespace]

Configuration Reference

  1. Initialize Engine
shell
kubectl -n [namespace] exec -it master-0 -- /entrypoint.sh -m initsystem
kubectl -n [namespace] exec -it master-0 -- /entrypoint.sh -m startsystem

Wait a few minutes to check if the hengshi-sense service has started successfully. You can then access it via any k8s node NODE_IP:PORT. If you need to configure Nginx forwarding, you can check the NodePort exposed by the current Service8080 port.

shell
kubectl -n [namespace] get svc
NAME            TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)                                                         AGE
hengshi-sense   NodePort    10.0.0.146   <none>        8080:31204/TCP,54320:30524/TCP,15432:31062/TCP,5005:32465/TCP   286d

Replace or Disable HENGSHI Components

Refer to the following example configuration to disable or enable.

shell
# Any of the following components set to false will not start after installation
metadb_enabled: false
gpdb_enabled: false
redis_enabled: false
minio_enabled: false
flink_enabled: false

# Example: Use AnalyticDB MySQL to replace the built-in Greenplum engine of HENGSHI
# 1. Set the gpdb_enabled parameter to false in the custom configuration file
# 2. Add the example configuration from "Installation and Startup > System Configuration > Engine Advanced Configuration" to the "Configuration Item (configmap)"
HS_ENGINE_TYPE: "mysql"
IS_ENGINE_EMBEDDED: false
SYSTEM_ENGINE_URL: "jdbc:mysql://192.168.211.4:3306/testdb?user=root&password=Test123@"
INTERNAL_ENGINE_DATASET_PATH: "enginedb"
INTERNAL_ENGINE_TMP_PATH: "enginetmp"
INTERNAL_ENGINE_OUTPUT_PATH: "enginecommon"

# Remove the default engine variables
HS_ENGINE_TYPE: greenplum
HS_ENGINE_HOST: "master-0.gp-hs"
HS_ENGINE_PORT: "15432"
HS_ENGINE_DB: hengshi
HS_ENGINE_USR: hengshi
HS_ENGINE_PWD: hengshi202020
# Example: Use RDS PostgreSQL to replace the built-in metadb of HENGSHI
# 1. Set the metadb_enabled parameter to false in the custom configuration file
# 2. Add the example configuration from "Installation and Startup > System Configuration > Replace HENGSHI metadb" to the "Configuration Item (configmap)", and create the corresponding account and permissions in the cloud database
HS_PG_HOST=xxx
HS_PG_PORT=5432
HS_PG_DB="hengshi"
HS_PG_USR=hengshi
HS_PG_PWD="hengshi"
INTERNAL_STORAGE_DB_NAME="hengshi_sense_internal_storage"
HS_SYSLOG_HOST=xxxx
HS_SYSLOG_PORT=5432
HS_SYSLOG_DB=syslog
HS_SYSLOG_USR=syslog
HS_SYSLOG_PWD=syslog

Custom Configuration File Complete Example

Refer to the complete example below.

shell
cluster_enable: true
hengshi_replicas: 3 # hengshi node count default 3, please keep consistent with the number of licenses obtained
enable_hengshi_share_storage: false
node_selector:
  ns_enable: false
  node_selector_kv: "diskType: ssd"


# metadb configmap
metadb_enabled: true
metadb_slave_enabled: false

# gpdb configmap
gpdb_enabled: true
gpdb_seg_replicas: 1
gpdb_master: master-0
gpdb_segments:
  - segment-0
# redis configmap
redis_enabled: true

# minio configmap
minio_enabled: true

# flink configmap
flink_enabled: true

# service
service:
  web_port: 8080
  apm_port: 5005
  metadb_port: 54320
  metadb_slave_port: 54321
  greenplum_port: 15432
  minio_port: 9001
  flink_rest_port: 8082
  flink_job_rpc_port: 6123

# storage
stroage_name:
  gpdb_master_size: 50Gi
  gpdb_segment_size: 50Gi
  metadb_size: 50Gi
  metadb_slave_size: 50Gi
  minio_size: 50Gi
  redis_size: 10Gi
  flink_size: 10Gi
  ClassName: longhorn
  accessModes: ['ReadWriteOnce']

# image
image:
  hengshi: "registry.hengshi.org/hengshi-sense:4.0.4-dp-a3d11d"
  pullPolicy: Always
  dnsPolicy: ClusterFirst
  # Overrides the image tag whose default is the chart appVersion.
  gpdb: "registry.hengshi.org/gpdb:6.18.2.0"
  secret: false
  secret_name: secret-name

# ingress default not enabled
ingress:
  enabled: false
  className: "nginx"
  annotations:
    ingress.kubernetes.io/force-ssl-redirect: "false"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
    nginx.ingress.kubernetes.io/proxy-body-size: "500M"
  hosts:
    - host: helm.hengshi.org
      paths:
        - path: /
          pathType: Prefix
  tls: []
  #  - secretName: hengshi-org-tls
  #    hosts:
  #      - helm.hengshi.org

Upgrade/Backup

  1. Container Deployment Upgrade

  2. Backup and Restore in k8s Environment

HENGSHI SENSE Platform User Manual