Skip to content

Offline Deployment

Standalone Deployment

Note

Standalone deployment is only suitable for POC environments, not for production environments.

1. Prerequisites
1.1 Prerequisites for Using Sealos
  • The hostname can be configured; the hostname should not contain underscores.
  • Node time synchronization.
  • Run the sealos run command on the first node of the Kubernetes cluster. Cluster installation from nodes outside the cluster is currently not supported.
  • It is recommended to use a clean operating system to create the cluster. Do not install Docker yourself.
  • Supports most Linux distributions, such as: Ubuntu, CentOS, Rocky Linux.
  • Published supported versions of Kubernetes.
  • Supports using containerd as the container runtime.
  • Use private IP addresses when on public clouds.
2. Installation and Deployment
2.1 Configure the Installation Package

2.1.1 Download the Installation Package

Installation package URL: https://static.guance.com/dataflux/package/guance-middleware-arm64.tar.gz Extract the installation package:

tar -zvxf guance-middleware-arm64.tar.gz

Installation package URL: https://static.guance.com/dataflux/package/guance-middleware-amd64.tar.gz Extract the installation package:

tar -zvxf guance-middleware-amd64.tar.gz

2.2 Install Sealos

2.2.1 Install Sealos

tar zxvf sealos_4.3.0_linux.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin && sealos -h
Commonly used sealos commands:
sealos save            Saves the cluster image to a file
sealos load            Loads a cluster image from a file
sealos images          Lists all images
sealos rmi             Deletes local images
sealos run imageId     Runs an application based on an image
sealos version         Displays the sealos version
sealos help            Displays the sealos help documentation

2.3 Install Kubernetes Cluster

2.3.1 Install Kubernetes

sealos load -i calico_3.22.1.tar.gz && sealos load -i helm_3.8.2.tar.gz && sealos load -i kubernetes_1.24.0.tar.gz && sealos images

sealos run pubrepo.guance.com/googleimages/kubernetes:v1.24.0 pubrepo.guance.com/googleimages/helm:v3.8.2 pubrepo.guance.com/googleimages/calico:v3.22.1 --single

# Verification
kubectl get nodes 

2.3.2 Modify Containerd Data Directory

The default data directory for containerd is under /. In Kubernetes versions 1.16 and later, once the default root directory usage threshold reaches 85%, pods on the node will be evicted. To avoid eviction, we need to switch the containerd data directory to the data disk.

# After all nodes are Ready, modify the containerd data directory
vim /etc/containerd/config.toml
root = "/data/containerd"
mkdir -p /data/containerd
cp -r /var/lib/containerd/* /data/containerd
chmod 777 -R /data/containerd
# Restart containerd
sudo systemctl restart containerd

2.4 Install NFS

2.4.1 Turn Off the Firewall

CentOS shutdown command

systemctl stop firewalld
systemctl disable firewalld

Ubuntu shutdown command

sudo systemctl stop ufw.service
sudo systemctl disable ufw.service

2.4.2 Install NFS Service

If the server can access the Internet, deploy NFS with the following commands:

CentOS installation command

yum install rpcbind nfs-utils -y

Ubuntu installation command

apt-get install nfs-kernel-server -y

If the server cannot access the Internet, find the nfs-package folder in the extracted files and locate the offline packages for the corresponding version. Install them using the following commands:

CentOS offline installation command

tar -zvxf nfs-utils.tar.gz
cd nfs-utils
rpm -Uvh *.rpm --nodeps --force

Ubuntu offline installation command

tar -zvxf nfs-utils.tar.gz
cd nfs-utils
sudo dpkg -i *.deb    

2.4.3 Configure NFS Shared Path

Create shared directory:

mkdir /nfsdata
Run the command vim /etc/exports to create the exports file with the following content:

#/nfsdata *(insecure,rw,async,no_root_squash)
/nfsdata *(rw,no_root_squash,no_all_squash,insecure) 

Note: /nfsdata is the shared directory configured for NFS. This directory is usually located in a separately mounted data disk, such as /data/nfsdata.

2.4.4 Start NFS Service

Run the following commands to start the NFS service:

CentOS startup command

systemctl enable rpcbind
systemctl enable nfs-server
systemctl restart rpcbind
systemctl restart nfs-server

Ubuntu startup command

service nfs-kernel-server start   

2.4.5 Verify Configuration

showmount -e localhost
2.5 Install Kubernetes Storage

2.5.1 Install Kubernetes Storage

sealos load -i nfs_4.0.2.tar.gz
# Get the imageId of the nfs cluster image
sealos images
# Replace the imagesId value below with the obtained cluster image ID
sealos run imagesId -e nfs_server=192.168.0.41,nfs_path=/nfsdata

Note: For other components mentioned later, their imageIds can be obtained and replaced in the same way.

Parameter Description:

Name Description Value
nfs_server Server IP e.g., 192.168.3.143
nfs_path NFS shared path e.g., /data/nfsdata
2.6 Install Ingress

2.6.1 Install Ingress

sealos load -i ingress_1.3.0.tar.gz
sealos run imagesId

Note: If the domain name directly resolves to the server, you can add the configuration hostNetwork: true to the ingress deployment.

2.7 Install Openebs

2.7.1 Install Openebs

sealos load -i localpv-provisioner_3.3.0.tar.gz
sealos run imagesId

Note: The installation of openebs is optional and offers better performance than NFS when using local storage.

2.8 Create Middleware Namespace

2.8.1 Create Middleware Namespace

kubectl create ns middleware
2.9 Install MySQL

2.9.1 Install MySQL

Install MySQL using sealos:

sealos load -i mysql_8.0.tar.gz 
# Example 1: Disk type is NFS, deployment command with storageclass named df-nfs-storage
sealos run imageId -e storageclass_type=nfs,openebs_localpath='',nfs_name=df-nfs-storage
# Example 2: Disk type is openebs, local shared path is /data/mysql_data
sealos run imageId -e storageclass_type=openebs,openebs_localpath='/data/mysql_data',nfs_name=''

Parameter Description:

Name Description Value
storageclass_type Type of SC to use, either nfs or openebs nfs or openebs (required)
openebs_localpath Only required when SC type is set to openebs, specify local path e.g., /data/mysql_data (required if SC type is openebs)
nfs_name If SC type is set to nfs, this option specifies the storageclass name that PVC needs to bind e.g., df-nfs-storage (required if SC type is nfs)

2.9.2 Create MySQL Configuration User

# Create user 'guance_setup_user'
kubectl -n middleware exec -it podname bash
# Enter password: rootPassw0rd
mysql -uroot -p 
create user 'guance_setup_user'@'%' identified by 'Aa123456';
-- WITH GRANT OPTION indicates that the user can grant their permissions to others
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, LOCK TABLES, CREATE TEMPORARY TABLES, TRIGGER, EXECUTE, CREATE VIEW, SHOW VIEW, EVENT, GRANT OPTION, PROCESS, REFERENCES, RELOAD, CREATE USER, USAGE on *.* TO 'guance_setup_user'@'%' with GRANT OPTION;
FLUSH PRIVILEGES;

# Connection Information
Connection Address: mysql.middleware
Port: 3306
User: guance_setup_user
Password: Aa123456
2.10 Install OpenSearch

2.10.1 Install OpenSearch

sealos load -i opensearch_2.3.0.tar.gz
sealos run imagesId -e nfs_name=df-nfs-storage

Note: Currently, OpenSearch supports only NFS as the disk type.

Parameter Description:

Name Description Value
nfs_name If SC type is set to nfs, this option specifies the storageclass name that PVC needs to bind e.g., df-nfs-storage (required)

2.10.2 Modify Default Password for OpenSearch

# Change password
kubectl exec -ti -n middleware opensearch-single-0 -- curl -u admin:admin \
       -XPUT "http://localhost:9200/_plugins/_security/api/internalusers/elastic" \
       -H 'Content-Type: application/json' \
       -d '{
            "password": "4dIv4VJQG5t5dcJOL8R5",
            "opendistro_security_roles": ["all_access"]
        }'

# Connection Information
Connection Address: opensearch-single.middleware
Port: 9200
User: elastic
Password: 4dIv4VJQG5t5dcJOL8R5
2.11 Install GuanceDB

2.11.1 Install GuanceDB

sealos load -i guancedb.tar.gz
sealos run imagesId -e nfs_name=df-nfs-storage

Note: Currently, GuanceDB supports only NFS as the disk type.

Parameter Description:

Name Description Value
nfs_name If SC type is set to nfs, this option specifies the storageclass name that PVC needs to bind e.g., df-nfs-storage (required)
2.12 Deploy Launcher

2.12.1 Business Service Installation Package Download

Image package download address: https://static.guance.com/dataflux/package/guance-arm64-latest.tar.gz

Image package download address: https://static.guance.com/dataflux/package/guance-amd64-latest.tar.gz

2.12.2 Launcher Chart Package Download

Chart package download address: https://static.guance.com/dataflux/package/launcher-helm-latest.tgz

2.12.3 Import Business Service Images

# Import into containerd environment
gunzip guance-amd64-latest.tar.gz
ctr -n=k8s.io images import guance-amd64-latest.tar

2.12.4 Install Launcher

helm install launcher launcher-*.tgz -n launcher --create-namespace  \
  --set ingress.hostName=launcher.dataflux.cn \
  --set storageClassName=df-nfs-storage

2.12.5 Configure Single Replica for Business Services (Optional)

For a POC environment where a single replica is desired, configure it as follows:

kubectl edit cm launcher-settings -n launcher
# Add the following configuration
settings.yaml: 'debug: True'
# Restart the launcher service after adding
kubectl -n launcher rollout restart deploy launcher

2.12.6 Access Launcher

# Modify the network mode of ingress, add hostNetwork: true to the ingress deployment
hostNetwork: true
# After modification, configure local settings. Replace 8.130.126.215 with the server's IP address. Port 80 must be opened externally.
8.130.126.215 launcher.dataflux.cn
2.13 Deploy Business Services via Launcher

After deploying the launcher, refer to Start Installation for business service deployment.

Feedback

Is this page helpful? ×