Skip to main content

Kubernetes Cluster Edition Deployment Guide

Note

K8s Cluster Edition is only applicable to WeDa private deployment Enterprise Edition and above plans.

1. Resource Preparation

1.1. To deploy the Cluster Edition, the following requirements must be met:

  • kubernetes version must be v1.22.0 or above.

  • The cluster must have at least two nodes with 8 vCPUs and 16GB memory for WeDa deployment;

    • It is recommended to deploy base platform services - with multiple replicas for high availability, and rolling updates are also supported.

    • Deploy CICD services on one 4C8G machine.

  • The cluster must have the kubectl and helm command-line tools installed;

  • Ingress-Controller must be installed;

  • Storage-class middleware must be provided: MySQL and object storage --- where MySQL databases require version 8.x, and object storage must be S3-compatible; (If unavailable, refer to the Middleware Deployment Guide)

  • Software packages installed via wget and unzip

1.2. Network Access

  • Allow access to port 443 for weda-private.tencentcloudcr.com

  • https://license.tcloudbasegateway.com (Certificate activation/Get the latest version)

  • https://weda-private.tencentcloudcr.com (Image pull)

  • https://tcr-9r3x9jec-1302110647.cos.ap-guangzhou.myqcloud.com (Image pull)

2. Obtain the deployment package and fill in the configuration information

111

2.1 Download the deployment script

Download (by running the following command)

For Linux servers with x86_64 architecture:


mkdir -p k8s_weda && cd k8s_weda

wget -L -O wedaCli https://software-1302110647.cos.ap-guangzhou.myqcloud.com/rc/k8s/x86_64/lastest/wedaCli && chmod +x wedaCli

For Linux servers with aarch64 architecture:

mkdir -p k8s_weda && cd k8s_weda

wget -L -O wedaCli https://software-1302110647.cos.ap-guangzhou.myqcloud.com/rc/k8s/arm64/lastest/wedaCli && chmod +x wedaCli

In the k8s_weda directory, there is the wedaCli executable file. Then run the following command:

./wedaCli init

2.2 Fill in the configuration file config.yml to generate helm values.yaml. Below are descriptions of the fields in config.yml:

FieldMeaning
weda.nsThe namespace in Kubernetes for deploying the WeDa cluster. [Execute kubectl create ns weda-software to create it; see section 2.1]
weda.ingressClassThe name of the ingressClass in the k8s cluster. [Obtain by running kubectl get ingressClass]
weda.nodeSelectorThe node selector for WeDa baas service pods. It must be pre-configured on Kubernetes nodes; if not set, the system will automatically select suitable nodes for deployment based on resource availability.
weda.replicaCountThe replica count for WeDa baas service, defaults to: 1
weda.disableRollingUpdateWhether to disable rolling updates. false enables rolling updates (default), true disables them [resulting in service-downtime updates], typically used when resources are constrained.
weda.domainThe domain name for the WeDa service, which should not include the http or https protocol.
weda.domainProtocolEnter the http or https protocol name
weda.tlsSecretNameOptional: Requires creating a TLS secret using a certificate and key first. Only fill in when accessing the WeDa service via https and mounting the TLS certificate to the ingress; see section 3.4.2 for details.
weda.licenseWeDa license
middleware.mysql.hostHostname, domain name, or IP address of the self-hosted MySQL database
middleware.mysql.portThe port number of the self-hosted MySQL database
middleware.mysql.usernameThe username for the self-hosted MySQL database
middleware.mysql.passwordThe password for the self-hosted MySQL database
middleware.mysql.dbnameFill in the name of the self-hosted MySQL database (stores design-time data), which can generally be named 'lowcode'. The statement to create the database is: CREATE DATABASE `lowcode` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
middleware.mysql.dbRuntimeNameFill in the name of the self-hosted MySQL database (stores runtime data), which can generally be named 'lcruntime'. The statement to create the database is: CREATE DATABASE `lcruntime` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
middleware.s3.endpointConnection ip or domain name for the self-hosted S3 object storage service, which should not include the http or https protocol
middleware.s3.portThe port number of the self-hosted S3 object storage service
middleware.s3.schemeThe protocol for the self-hosted S3 object storage service; specify either http or https.
middleware.s3.accessKeyThe access key for the self-hosted S3 object storage service
middleware.s3.secretKeyThe secret key for the self-hosted S3 object storage service
middleware.s3.insecureSkipVerifyWhether to skip certificate verification for the self-hosted S3 object storage service; defaults to false
middleware.s3.defaultBucketCreate a bucket in the self-hosted S3 object storage service and ensure its access permissions are set to public read, private write
middleware.s3.cloudStorageBucketCreate a bucket in the self-hosted S3 object storage service with access permissions set to private read and private write
middleware.s3.ciSourceCreate a bucket in the self-hosted S3 object storage service with access permissions set to private read and private write
middleware.s3.regionThe region where the self-hosted S3 is located
middleware.s3.pathStyleWhether the self-hosted S3 supports pathStyle: set to true if supported, otherwise false
Note

The above three buckets (defaultBucket, cloudStorageBucket, ciSource) must not have the same name. For specific configurations, refer to: Custom S3 Object Storage Bucket Configuration Guide

3. Install WeDa Services

3.1 Install and Deploy WeDa

./wedaCli install

3.2 Verify

Run the following command to verify if the pod is running

kubectl -n weda-software get po
NAME                                  READY   STATUS    RESTARTS   AGE
allin-one-design-b8f855787-58zsj 1/1 Running 0 44m
allin-one-runtime-66cf7b5658-pjw8c 1/1 Running 0 43m
gateway-7c7c786495-vprl6 1/1 Running 0 48m
idaasserver-b6bf65cfc-5dvvg 1/1 Running 0 48m
lcap-service-55dcb9fd-vcpxw 1/1 Running 0 48m
lowcode-5d45ffd9cc-zckxd 1/1 Running 1 48m
proxy-7bf84f8c48-bszw7 1/1 Running 0 48m
weda-plugin-adaptor-dd67659b5-4vcn8 1/1 Running 0 48m

3.3 Access WeDa web UI

3.3.1 Expose WeDa Service
  • Expose the WeDa service. The WeDa cluster version uses ingress to expose the service for external access, as shown below for the http service. Depending on the exposure method of the ingress-controller, the external access ip will differ:

    • If using the NodePort method, you can directly use each node's external IP—an accessible IP outside the cluster—to access WeDa externally from the cluster (requiring an external LB).
    • If using the LoadBalancer method, check the load balancer VIP of this Ingress Controller. The bound IP [accessible IP outside the cluster] can be used to access WeDa externally from the cluster.
    ## For example: The following ingress-controller uses LoadBalancer. We bind the EXTERNAL-IP to our "external IP", subject to the actual cluster configuration.
    kubectl -n ingress-nginx get svc
    NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
    ingress-nginx-controller LoadBalancer 10.0.134.188 192.168.2.40 80:30252/TCP,443:31414/TCP 52d

    Note: ingress-nginx is the namespace where the ingress-controller resides.

    kubectl get ing -n <namespace where WeDa is deployed>
    Example:
    NAME CLASS HOSTS ADDRESS PORTS AGE
    proxy nginx weda-test-cloud.com 192.168.2.40 80 6d20h
  • Map the accessible IP outside the cluster to the configured domain name (weda.domain) (1. dns configuration; 2. For testing purposes, configure local hosts for resolution).

  • Access the login URL: http://weda.domain/dev

    weda.domain is the domain name set in section 2.2

  • Default username/password: admin/Weda@123456

3.3.2 Configure https tls Certificate (Optional)
  • Support configuring tls on the ingress to enable https access to the WeDa service. Proceed as follows:

    • i Obtain the tls certificate file
    • ii Use the following command to create a tls secret
    ### The "NAME" is the name to be assigned when creating the secret; it should be descriptive, e.g., weda-tls. ---cert specifies the file path of the certificate, --key specifies the file path of the private key.

    kubectl create secret tls NAME --cert=path/to/cert/file --key=path/to/key/file -n weda-software
    • iii Fill in the "NAME" in the config.yml file
    ### e.g., NAME: weda-tls

    tlsSecretName: weda-tls
    • iv Execute the installation or update command for WeDa services

      • Then proceed to Section 3.2 (Installation or Update)

3.4 Update Service

i Switch to the directory where WeDa was last deployed. Do you need to modify config.yaml? If not, skip this step.

ii Switch to the deployment directory and delete the previous wedaCli file

iii Download the execution script to the deployment directory

iv Execute ../wedaCli install

3.5 Renew Service

i Obtain the license, switch to the directory where WeDa was last deployed, and replace the license value in config.yaml

ii Execute mv env env-bak to back up the env file

iii Execute: ./wedaCli install

3.6 Uninstall Service

Note

Need to use helm to uninstall the service

i First, query the service

helm list -n weda-software   ## -n followed by the namespace

ii Uninstall the service


helm delete wedabaas -n weda-software ## The content following 'delete' is the service name.