Sealos Documentation

website·Indexed 34 days ago

https://sealos.io

Guides for the Sealos DevBox environment, including creating tls.crt files, connecting via Cursor IDE, and deploying applications. Includes documentation on the Model Context Protocol (MCP) and using Sealos MCP to make cloud platforms AI-ready.

Tokens
35.5K
Snippets
136
Records
205
Agent score
70%

What's inside Sealos

  1. Overview of Sealos Cloud Platform

    Sealos is an AI-native cloud development platform that unifies the application lifecycle from development to production. It is powered by Kubernetes and provides several core capabilities:

    • Cloud Development Environments (DevBox): Zero-setup, collaborative environments that eliminate local inconsistencies. Supports connection via VS Code, JetBrains, and Cursor IDEs.
    • App Store: One-click deployment of 100+ pre-built templates without requiring YAML configuration.
    • Managed Databases & Storage: Production-ready, high-availability managed services for PostgreSQL, MySQL, MongoDB, Redis, and S3-compatible object storage.
    • Kubernetes Access: Provides raw Kubernetes access and automatic container orchestration.
    • Enterprise Multi-Tenancy: Workspace-based isolation with granular RBAC controls and resource quotas.
  2. Overview of Sealos DevBox

    DevBox is a managed cloud development environment built on Kubernetes. It provides production-ready runtimes accessible via Cursor, VS Code, JetBrains Gateway, or a browser terminal. It allows developers to release OCI images directly from the runtime and deploy them to Sealos Cloud.
  3. Overview of Sealos DevBox

    DevBox is a fully-managed cloud development environment (CDE) built on Kubernetes. It eliminates local setup and environment drift by providing consistent, production-ready workspaces accessible via popular IDEs. Unlike self-hosted CDEs, DevBox is a SaaS offering that handles orchestration, scaling, and networking.
  4. Manage multi-architecture image manifests with sealos manifest

    The sealos manifest command allows you to create, modify, and push manifests for Docker and OCI images that support multiple architectures.
    sealos manifest
  5. Connect AI tools to Sealos via Model Context Protocol (MCP)

    Sealos provides MCP servers that allow AI hosts (like Cursor, VS Code, or Cherry Studio) to control cloud infrastructure using natural language.

    Requirements for connection:

    1. MCP Service URL: Found in the MCP services section of the Sealos Console for your specific region.
    2. Authentication Token: A URL-encoded KubeConfig used in the Authorization header.

    Available Sealos MCP Capabilities:

    • DevBox: Manage development environments and execute code.
    • Database: Query and manage databases.
    • Cost Center: Manage billing and expenses.
    • Observability: View logs and monitor performance.
  6. Understand Sealos DevBox Architecture

    Sealos DevBox simulates a virtual machine experience using cloud-native container and Kubernetes technologies.

    Control Flow:

    1. User triggers action via web interface or plugin.
    2. DevBox Controller processes the request.
    3. Controller translates instructions into Kubernetes API calls.
    4. Kubernetes executes container operations.

    State Persistence:

    • Automatic Saving: Environment changes are packaged as image layers and appended to the base image as commits in an internal registry.
    • Recovery: The system boots from the most recent image on startup to preserve historical changes.
    • Optimization: A Container-shim layer regularly merges image layers and cleans redundant data to optimize storage and performance.
  7. Use Sealos AI Proxy for OpenAI-compatible requests

    AI Proxy is a managed entry point on Sealos for making OpenAI-compatible AI requests. It provides a single endpoint and API key to simplify the integration of AI services into applications.
  8. Connect Sealos DevBox to Cursor IDE

    To start coding in your DevBox project using Cursor IDE, navigate to the project canvas in the Sealos Dashboard, open the DevBox detail panel, and select 'Cursor' from the IDE dropdown menu. You must install the DevBox plugin when prompted by Cursor to establish the remote connection to the runtime.
  9. Perform MySQL operations using Python

    The following example demonstrates how to create a table, insert records using parameterized queries (to prevent SQL injection), and retrieve data using mysql-connector-python.
    from mysql.connector import Error
    from db_connection import get_db_connection, close_connection
    
    def create_table(cursor):
        cursor.execute("CREATE TABLE IF NOT EXISTS employees (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), email VARCHAR(100))")
    
    def insert_employee(cursor, name, email):
        cursor.execute("INSERT INTO employees (name, email) VALUES (%s, %s)", (name, email))
    
    def get_all_employees(cursor):
        cursor.execute("SELECT * FROM employees")
        return cursor.fetchall()
    
    def main():
        connection = get_db_connection()
        if connection:
            try:
                cursor = connection.cursor()
                create_table(cursor)
                insert_employee(cursor, "John Doe", "john@example.com")
                connection.commit()
                print(get_all_employees(cursor))
            except Error as e:
                print(f"Error: {e}")
            finally:
                if cursor: cursor.close()
                close_connection(connection)
    
    if __name__ == "__main__":
        main()

    Run the script:

    python test_mysql.py

  10. Install Milvus SDK for Node.js in Sealos DevBox

    To connect to a Milvus database using Node.js, install the official SDK and the dotenv package for environment variable management.
    npm install @zilliz/milvus2-sdk-node dotenv
  11. Launch a DevBox project from a template

    To create a new project using a pre-configured runtime template:

    1. During the project creation flow, browse the Runtime tab.
    2. Select a template from All Templates (community/public) or My Templates (your private templates).
    3. Once the template is applied, configure additional project parameters such as resources and networking.
    4. Complete the standard project creation process.
  12. Update an existing CronJob configuration in Sealos

    To modify the schedule, target URL, or task type of an existing CronJob, reopen the CronJob from the list or details page and edit the fields. Note that changes only affect future runs; they do not impact jobs that are currently running or have already finished.