### Test Environment Setup Source: https://github.com/labring/sealos/blob/main/frontend/desktop/README.md Instructions for setting up the test environment by configuring the NODE_ENV variable and starting the development server before running tests. ```bash # Set environment variable for testing # Linux/macOS: export NODE_ENV=test # Windows PowerShell: $env:NODE_ENV="test" # Start the development server pnpm dev # Run tests in watch mode pnpm test:w ``` -------------------------------- ### Example Global YAML Configuration Source: https://github.com/labring/sealos/blob/main/proposal/design/en/global-yaml-usage-convention.md Demonstrates a typical structure for global configuration, including settings for installation, billing, certificates, HTTP, storage, and feature configurations. ```yaml global: install: dryRun: false billing: currency: cny cert: mode: self-signed certFile: "" keyFile: "" http: domain: 127.0.0.1.nip.io httpsPort: 443 httpPort: 80 disableHttps: false storage: openebs: storage: /data/openebs vgName: "" volumeGroups: [] nfs: storageClass: name: nfs-csi annotations: storageclass.kubernetes.io/is-default-class: "false" parameters: server: "" share: "/" subDir: "" mountPermissions: "0777" reclaimPolicy: Delete volumeBindingMode: Immediate mountOptions: - nfsvers=4.1 - hard featureConfigs: database: type: cockroachdb kubeblocksVersion: "0.8.2" version: v23.1.11 mongodbURI: "" nmAgentMongodbURI: "" ``` -------------------------------- ### Install Dependencies Source: https://github.com/labring/sealos/blob/main/frontend/providers/costcenter/README.md Installs project dependencies using npm. Run this before starting the development server. ```bash npm install ``` -------------------------------- ### Start Production Server Source: https://github.com/labring/sealos/blob/main/frontend/providers/costcenter/README.md Starts the production server after the project has been built. Use this for live deployments. ```bash npm start ``` -------------------------------- ### Start Development Server Source: https://github.com/labring/sealos/blob/main/frontend/desktop/README.md Run this command to start the development server for the Next.js project. Open http://localhost:3000 in your browser to view the application. ```bash pnpm run dev ``` -------------------------------- ### Download and Install sealos and image-cri-shim Source: https://github.com/labring/sealos/blob/main/lifecycle/staging/src/github.com/labring/image-cri-shim/USAGE.md Download the sealos package, extract it, and install the sealos binary and the image-cri-shim binary to the system path. Verify the installation of image-cri-shim. ```bash # Download sealos (recommend v5.1.0-rc3 or higher version) wget https://github.com/labring/sealos/releases/download/v5.1.0-rc3/sealos_5.1.0-rc3_linux_amd64.tar.gz # Extract tar -xzf sealos_5.1.0-rc3_linux_amd64.tar.gz # Install sealos to system path sudo cp sealos /usr/local/bin/ sudo chmod +x /usr/local/bin/sealos # Extract image-cri-shim from sealos package sudo cp image-cri-shim /usr/local/bin/ sudo chmod +x /usr/local/bin/image-cri-shim # Verify installation image-cri-shim --version ``` -------------------------------- ### Install Sealos Desktop SDK Source: https://github.com/labring/sealos/blob/main/frontend/packages/client-sdk/README.md Install the SDK using npm, pnpm, or yarn. ```bash # Using npm npm install @zjy365/sealos-desktop-sdk # Using pnpm pnpm add @zjy365/sealos-desktop-sdk # Using yarn yarn add @zjy365/sealos-desktop-sdk ``` -------------------------------- ### Install Sealos via Script Source: https://github.com/labring/sealos/blob/main/CHANGELOG/CHANGELOG-4.2.0.md Install Sealos by downloading and executing an installation script. Specify the desired version and image repository. ```shell curl -sfL https://raw.githubusercontent.com/labring/sealos/v4.2.0/scripts/install.sh \ | sh -s v4.2.0 labring/sealos ``` -------------------------------- ### Global Configuration Example Source: https://github.com/labring/sealos/blob/main/lifecycle/staging/src/github.com/labring/image-cri-shim/CONFIGMAP_GUIDE.md Example of setting global configuration parameters like reload interval, debug mode, and gRPC timeout. ```yaml reloadInterval: 15s # 配置重载间隔 debug: false # Debug 模式 timeout: 15m # gRPC 超时时间 force: false # 强制模式 ``` -------------------------------- ### Full Configuration Example for Account Service Deployment Source: https://github.com/labring/sealos/blob/main/service/account/deploy/README.md A comprehensive example demonstrating various configuration options for deploying the account-service, including namespace, image, resources, probes, and autoscaling. ```shell # 8. 完整配置示例 sealos run labring/account-service:latest \ --env RELEASE_NAMESPACE=production-account \ --env HELM_OPTS="--set replicaCount=3 \ --set image=ghcr.io/labring/sealos-account-service:v1.0.0 \ --set resources.limits.cpu=1000m \ --set resources.limits.memory=512Mi \ --set resources.requests.cpu=100m \ --set resources.requests.memory=50Mi \ --set livenessProbe.initialDelaySeconds=10 \ --set readinessProbe.initialDelaySeconds=10" ``` -------------------------------- ### Install dependencies Source: https://github.com/labring/sealos/blob/main/frontend/README.md Install all required project dependencies using pnpm. ```sh pnpm install ``` -------------------------------- ### Development Tools Installation Source: https://github.com/labring/sealos/blob/main/frontend/packages/client-sdk/README.md Install necessary development tools like yalc and nodemon for local development. ```bash # 1. Install development tools npm i -g yalc nodemon ``` -------------------------------- ### Install and Run Controller (One Step) Source: https://github.com/labring/sealos/blob/main/controllers/license/README.md A shortcut to install the CRDs and run the controller in a single command. ```sh make install run ``` -------------------------------- ### Cache Configuration Example Source: https://github.com/labring/sealos/blob/main/lifecycle/staging/src/github.com/labring/image-cri-shim/CONFIGMAP_GUIDE.md Example of configuring cache settings, including image cache size, TTLs, and statistics logging. ```yaml cache: imageCacheSize: 1024 # 镜像缓存大小 imageCacheTTL: 30m # 镜像缓存过期时间 domainCacheTTL: 10m # 域名缓存过期时间 statsLogInterval: 1m # 统计日志输出间隔 disableStats: false # 禁用统计 ``` -------------------------------- ### Install Golang on Linux Source: https://github.com/labring/sealos/blob/main/lifecycle/DEVELOPGUIDE.md Installs Go version 1.20.x on a Linux system and updates the PATH environment variable. ```shell wget https://go.dev/dl/go1.20.linux-amd64.tar.gz tar -C /usr/local -zxvf go1.20.linux-amd64.tar.gz cat >> /etc/profile <> /etc/profile </app:tag` with your registry details. ```sh make docker-build docker-push IMG=/app:tag ``` -------------------------------- ### Scenario 1: Admin Unified Registry Configuration Source: https://github.com/labring/sealos/blob/main/lifecycle/staging/src/github.com/labring/image-cri-shim/CONFIGMAP_GUIDE.md Demonstrates how a cluster administrator can uniformly manage registry configurations across all nodes by creating a ConfigMap and verifying the sync. ```bash # 1. 创建 ConfigMap kubectl apply -f - </license:tag` with your registry details. ```sh make docker-build docker-push IMG=/license:tag ``` -------------------------------- ### Repository CRD Example Source: https://github.com/labring/sealos/blob/main/proposal/design/en/imagehub.md An example of the Repository CRD, which aggregates common information for an image and manages authority. This CRD is automatically generated after an Image CR is created. ```yaml apiVersion: imagehub.sealos.io/v1 kind: Repository metadata: labels: keyword.imagehub.sealos.io/Storage: "" organization.imagehub.sealos.io: labring repository.imagehub.sealos.io: cert-manager name: labring.cert-manager spec: name: labring/cert-manager status: latestTag: creatTime: "2022-12-27T07:33:08Z" metaName: labring.cert.manager.v1.8.0 name: v1.8.0 tags: - creatTime: "2022-12-27T07:37:34Z" metaName: labring.cert.manager.v1.7.0 name: v1.7.0 - creatTime: "2022-12-27T07:33:08Z" metaName: labring.cert.manager.v1.8.0 name: v1.8.0 ``` -------------------------------- ### Install Kubernetes with Sealos Source: https://github.com/labring/sealos/blob/main/proposal/design/zh/self-hosting.md Use this command to install a specific version of Kubernetes using Sealos. Ensure you provide the necessary parameters for password, memory, and network configuration. ```bash sealos run kubernetes:v1.23.0 -p xxx -m ... -n ... ``` -------------------------------- ### Download and Install Sealos Client (arm64) Source: https://github.com/labring/sealos/blob/main/CHANGELOG/CHANGELOG-4.0.0.md Use this command to download the Sealos client binary for arm64 architecture, extract it, make it executable, and move it to your PATH. Ensure you have wget and tar installed. ```shell wget https://github.com/labring/sealos/releases/download/v4.0.0/sealos_4.0.0_linux_arm64.tar.gz && \ tar -zxvf sealos_4.0.0_linux_arm64.tar.gz sealos && chmod +x sealos && mv sealos /usr/bin ```