惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
V
Vulnerabilities – Threatpost
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
Schneier on Security
Schneier on Security
B
Blog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
H
Hacker News: Front Page
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园_首页
D
Docker
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
W
WeLiveSecurity
N
News and Events Feed by Topic
F
Fortinet All Blogs
PCI Perspectives
PCI Perspectives
WordPress大学
WordPress大学
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Recent Announcements
Recent Announcements
Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hacker News: Ask HN
Hacker News: Ask HN
爱范儿
爱范儿
腾讯CDC
Last Week in AI
Last Week in AI
月光博客
月光博客
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed
Help Net Security
Help Net Security
V
V2EX
C
Cyber Attacks, Cyber Crime and Cyber Security
C
CXSECURITY Database RSS Feed - CXSecurity.com
H
Heimdal Security Blog
L
LINUX DO - 最新话题
GbyAI
GbyAI
The Hacker News
The Hacker News
罗磊的独立博客
S
SegmentFault 最新的问题
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 【当耐特】
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
V2EX - 技术
V2EX - 技术
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
O
OpenAI News
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

Sealos Blog

Build a Full-Stack App with Claude Code + InsForge — Zero Backend Code | Sealos Blog InsForge vs Supabase: Which Backend for AI-Powered Development? | Sealos Blog Kubernetes NodePort Exhaustion: SSH Gateway Solution | Sealos Blog Claude Code Metrics Dashboard: Grafana Setup (2026) | Sealos Blog What Is RustFS? Apache 2.0 MinIO Alternative (2026) | Sealos Blog Claude Code Mobile: iPhone, Android & SSH (2026) | Sealos Blog Eaglercraft Server Hosting: Fast Setup (2026) | Sealos Blog An Honest Review: Migrating a Complex Microservice App from Heroku to Sealos | Sealos Blog The Ultimate Guide to Kubernetes Audit Logging for Security and Compliance | Sealos Blog Cost Optimization Shootout: Sealos Autonomous FinOps vs. Kubecost Manual Reports | Sealos Blog For CTOs: How to Cut Your Cloud Bill by 50% Without Sacrificing Performance | Sealos Blog Building Resilient Systems: A Deep Dive into Sealos High-Availability and Auto-Failover | Sealos Blog Building a Scalable Event-Driven Architecture with Sealos Managed Kafka | Sealos Blog Beyond kubectl apply: 5 GitOps Best Practices for Production-Ready CI/CD on Sealos | Sealos Blog Advanced RAG Pipelines: Why Your Choice of Vector Database (like Milvus) Matters | Sealos Blog Advanced MLOps: How to Monitor and Evaluate LLM Applications in Production | Sealos Blog A Developer's Guide to Kubernetes RBAC: Securing Your Cluster the Easy Way with Sealos | Sealos Blog A CISO's Guide to Cloud Development: Securing the CI/CD Pipeline with Sealos DevBox | Sealos Blog What is Kubernetes Multi-Tenancy? A Guide for Platform Engineers | Sealos Blog What is Infrastructure from Code (IfC)? The Next Step After Infrastructure as Code (IaC) | Sealos Blog What is GitOps? A Beginner's Guide to "Push-to-Deploy" Workflows | Sealos Blog What is eBPF? The Future of Kubernetes Networking and Security | Sealos Blog What is an "AI-Native" Platform? (And Why You Need One for MLOps) | Sealos Blog What is an Agentic Workflow? Building the Next Generation of AI Apps | Sealos Blog What is a Kubernetes Chargeback Model (And How Does it Save You Money?) | Sealos Blog What is a "Headless" Development Environment? (And How it Works with VS Code) | Sealos Blog What is a Graph-Based Vector Database? (And When to Use It Over Milvus) | Sealos Blog What is a "Cloud Operating System"? The Next Evolution of PaaS Explained | Sealos Blog The Real Cost of EKS: How Sealos Delivers a Simpler, Cheaper Kubernetes Experience | Sealos Blog The 3 Types of Kubernetes Autoscaling (HPA, VPA, CA) and How Sealos Manages Them for You | Sealos Blog Sealos vs Vercel: Why a Cloud OS Beats a Frontend Platform for Full-Stack Apps | Sealos Blog Sealos vs. Render vs. Fly.io: A 2025 Guide to the Best Heroku Alternatives | Sealos Blog Sealos vs. OpenShift: Kubernetes for Developers vs. Kubernetes for Ops Teams | Sealos Blog Sealos vs. Netlify: When to Choose a Full Kubernetes Platform over a Static Site Hoster | Sealos Blog Sealos vs. DigitalOcean App Platform: A Head-to-Head Comparison on Cost, Features, and Scalability | Sealos Blog Sealos vs. AWS Elastic Beanstalk: The Modern PaaS for Developers Who Hate YAML | Sealos Blog Sealos DevBox vs. AWS Cloud9: Why Your CDE Should Be Platform-Agnostic | Sealos Blog For Developers: Stop Wasting Time on DevOps. A 10-Minute Guide to Shipping Faster with DevBox. | Sealos Blog Deploying n8n with Docker: From Local Setups to a Radically Simple Cloud Alternative | Sealos Blog The Impact of Prompt Bloat: How the Sealos AI Proxy Can Cache Queries and Cut LLM Costs | Sealos Blog The FinOps Playbook: How to Implement Kubernetes Chargebacks and Showbacks with Sealos | Sealos Blog Smoke Testing for ML Pipelines: Catching Data and Model Errors Before They Hit Production | Sealos Blog Optimizing PostgreSQL Performance: A Guide to Sealos Managed Database Tuning | Sealos Blog Managing Kubernetes Multi-Tenancy: How Sealos Enforces Resource Quotas and Network Policies | Sealos Blog From Days to Minutes: How to Standardize Developer Environments for Your Entire Engineering Org | Sealos Blog For Platform Engineers: How to Build a Golden Path IDP (Internal Developer Platform) with Sealos | Sealos Blog For FinOps Managers: The 5 Leakiest Buckets in Your Kubernetes Budget (And How to Plug Them) | Sealos Blog For Educators & IT Admins: How to Provide a Secure, Scalable Cloud Lab for 1000+ Students on a Budget | Sealos Blog What is a Vector Database? A Beginner's Guide to Milvus, Pinecone, and More | Sealos Blog Why Your Microservices Architecture is Failing (And How a Cloud OS Can Fix It) | Sealos Blog The Power of Autoscaling: A Deep Dive into HPA, VPA, and Cluster Autoscaler | Sealos Blog The Total Economic Impact of Cloud Development Environments (CDEs) | Sealos Blog The Illustrated Guide to the Kubernetes Control Plane | Sealos Blog The MLOps Lifecycle Explained: From Data Prep to Model Deployment | Sealos Blog Beyond Vercel's AI Cloud: The Case for an AI-Native Operating System | Sealos Blog The Architecture of a Modern AI Application: A 2025 Blueprint | Sealos Blog GitHub Codespaces is Great, But Your Workflow is Incomplete. Here's Why. | Sealos Blog The Best Heroku Alternatives in 2025 for Scalability and Cost | Sealos Blog CAST AI vs. Kubecost vs. Sealos: Choosing the Right K8s Cost Management Tool | Sealos Blog DevBox vs. Gitpod vs. Replit: An Unbiased Comparison for 2025 | Sealos Blog Unlocking Hidden Savings: A Guide to Using Spot Instances Safely in Kubernetes | Sealos Blog Can a CDE Really Replace Your MacBook Pro? A Performance Benchmark | Sealos Blog The End of "Works on My Machine": Achieving 100% Reproducible Builds with DevBox | Sealos Blog The Ultimate Guide to GPU Provisioning and Management in Kubernetes | Sealos Blog Rightsizing Kubernetes Workloads: How to Stop Wasting Money on CPU and Memory Requests | Sealos Blog The 2025 Guide to Kubernetes Cost Optimization: 10 Strategies to Cut Your Bill in Half | Sealos Blog FinOps for Startups: How to Build a Cost-Conscious Culture from Day One | Sealos Blog How to Onboard a New Developer in Under 5 Minutes with Sealos DevBox | Sealos Blog Calculating Kubernetes Costs: A Breakdown of EKS, GKE, and AKS Pricing Models | Sealos Blog Case Study: How We Reduced Our Kubernetes Bill by 87% with Sealos | Sealos Blog Are You Overpaying for Managed Kubernetes? The True Cost of Vendor Lock-in | Sealos Blog Beyond Monitoring: How Sealos Autonomously Optimizes Your Cloud Spend | Sealos Blog A Practical Guide to Kubernetes Security: Hardening Your Cluster in 2025 | Sealos Blog A Secure-by-Design Development Workflow with Isolated Cloud Environments | Sealos Blog Setting Up a Collaborative Python Data Science Environment with DevBox | Sealos Blog Using the Sealos AI Proxy to Manage and Cache LLM API Calls | Sealos Blog Migration Guide: Moving Your Node.js & Postgres App from Heroku to Sealos in Under an Hour | Sealos Blog Serving Machine Learning Models at Scale: A Guide to Inference Optimization | Sealos Blog Headless Development with Sealos: Using Your Local VS Code with a Powerful Cloud Backend | Sealos Blog How to Build and Deploy a RAG Pipeline with Llama 3 and Milvus on Sealos | Sealos Blog From Localhost to Production in 15 Minutes: A Full-Stack CDE Workflow with Sealos DevBox | Sealos Blog GitOps on Autopilot: Implementing a CI/CD Pipeline with Sealos and GitHub Actions | Sealos Blog Fine-Tuning Open-Source LLMs on a Budget with Sealos | Sealos Blog Building an AI Agentic Workflow with LangChain and Sealos | Sealos Blog What is Helm for Kubernetes? The Ultimate Package Manager Explained | Sealos Blog What is a Custom Resource Definition (CRD) in Kubernetes? | Sealos Blog What is a Kubernetes StatefulSet? A Practical Guide | Sealos Blog What is a Kubernetes Ingress Controller? A Guide to Smart Traffic Routing | Sealos Blog What is a Kubernetes Operator? Automating Complex Applications | Sealos Blog What is a Kubernetes Service? A Simple Guide for Developers | Sealos Blog Streamlining Your CI/CD Pipeline with a DevBox Build Environment | Sealos Blog Why Standardized Development Environments Are Key to Team Velocity | Sealos Blog What Is GitHub Codespace? | Sealos Blog DevBox Install? Skip It Entirely. Get a Ready-to-Code Environment in One Click with Sealos DevBox. | Sealos Blog How to Set Up a DevBox: The Ultimate Guide to 1-Click Cloud Development | Sealos Blog Empowering Indie Devs and Startup Teams: How Sealos DevBox Accelerates Agile Development | Sealos Blog From Chaos to Consistency: How Sealos DevBox Transforms Enterprise Development Workflows | Sealos Blog From Campus Labs to Cloud Freedom: How Sealos DevBox Supercharges Student Development | Sealos Blog How Sealos DevBox Cut Container Commit Time from 15 Minutes to 1 Second | Sealos Blog DevBox vs Codespaces: Which Remote Dev Environment Fits You Best? | Sealos Blog
From Docker Compose to Kubernetes: A Simple Migration Path with Sealos | Sealos Blog
Sealos · 2025-09-02 · via Sealos Blog

Modern applications seldom stay small. What starts as a handful of containers running happily in Docker Compose often grows into a distributed system that demands better scalability, resilience, and governance. That’s the point where Kubernetes shines—and also where many teams hesitate, worried that the migration will be complex, disruptive, or time-consuming.

Good news: it doesn’t need to be. In this article, you’ll learn a practical, low-friction path from Docker Compose to Kubernetes using Sealos—a cloud operating system built on Kubernetes that makes cluster creation and operations dramatically simpler. We’ll cover what each piece is, why this migration matters, how the conversion works in practice (with real code), and how to deploy and operate your workloads on Sealos.

By the end, you’ll be able to:

  • Stand up a production-grade Kubernetes cluster quickly with Sealos.
  • Convert Docker Compose to Kubernetes manifests using familiar tools.
  • Apply best practices for secrets, storage, networking, and health checks.
  • Deploy, observe, and scale your migrated workloads with confidence.

Docker Compose in 30 Seconds

Docker Compose is a developer-friendly tool for defining and running multi-container applications with a single YAML file. It’s perfect for local development and simple deployments because it hides a lot of complexity. But as your system grows, Compose becomes harder to scale, secure, and manage across environments.

Kubernetes: The Standard for Orchestrating Containers

Kubernetes is a container orchestration platform that handles scheduling, networking, storage, health checks, rollouts, and autoscaling. It’s more complex than Compose because it solves a larger problem: running containerized apps reliably at scale in production.

Key benefits:

  • Self-healing deployments and rolling updates
  • Service discovery and load balancing
  • Persistent storage orchestration
  • Resource quotas, security policies, and multi-tenancy
  • Horizontal autoscaling

Sealos: Kubernetes Made Simple

Sealos is a cloud operating system that simplifies the lifecycle of Kubernetes:

  • Create a cluster with a single command (or use the Sealos Cloud).
  • Package cluster components as container images for reproducible installs.
  • Operate with standard Kubernetes tools like kubectl and Helm.

Sealos does not reinvent Kubernetes. Instead, it makes Kubernetes accessible by streamlining installation and management, so you can focus on your workloads rather than cluster plumbing.


  1. Scalability and Resilience: Kubernetes reschedules failed containers, handles rolling updates, and scales workloads.
  2. Environment Parity: Reuse the same manifests across dev, staging, and production with minimal drift.
  3. Security and Control: Namespaces, network policies, secrets management, admission control, and RBAC.
  4. Day-2 Operations: Metrics, logs, tracing, and autoscaling are first-class citizens.
  5. Simpler Cluster Ops: Sealos removes much of the friction in setting up and maintaining Kubernetes.

In short, Kubernetes future-proofs your deployments, and Sealos reduces the operational load to get you there.


Migrating isn’t just running a converter on your compose file and calling it a day. Plan for these steps to ensure success:

  1. Inventory Your Services

    • List all services, images, environment variables, volumes, and ports.
    • Identify external dependencies (databases, message brokers, third-party APIs).
  2. Classify State

    • Stateless (web, API workers) → Deployments.
    • Stateful (databases, queues) → StatefulSets with PersistentVolumeClaims (PVCs).
  3. Externalize Secrets

    • Move passwords, tokens, and keys into Kubernetes Secrets.
  4. Replace Volumes

    • Map Compose volumes to StorageClasses and PVCs.
    • Decide on a storage backend (local-path, hostPath for dev, or cloud CSI/OpenEBS/Longhorn for prod).
  5. Networking and Ingress

    • Replace Compose ports with Services and Ingress.
    • Plan TLS and DNS.
  6. Health Checks and Resources

    • Map Compose healthchecks to Kubernetes readiness/liveness/startup probes.
    • Add resource requests/limits for better scheduling and autoscaling.
  7. Dev-to-Prod Promotion

    • Use Kustomize or Helm to parameterize environments.

You can use Sealos to spin up a Kubernetes cluster on VMs or bare metal quickly. Once you have the Sealos CLI installed, creating a single-node development cluster is often as simple as:

Notes:

  • Replace the Kubernetes version tag with the release you need.
  • For multi-node clusters, Sealos can join masters and workers via flags or inventory files. Consult the Sealos docs for production-ready topologies, HA control planes, and advanced networking.
  • Sealos works with standard Kubernetes tooling, so all kubectl and Helm workflows apply.

Install an ingress controller (for HTTP/HTTPS routing), and a default storage class (for PVCs) if your environment doesn’t provide them:

With Sealos handling cluster creation and the basic add-ons in place, you’re ready to migrate your applications.


Let’s start with a representative docker-compose.yaml for a simple web API with Redis and PostgreSQL:

Key concerns we’ll address:

  • Secrets: Move POSTGRES_PASSWORD to a Kubernetes Secret.
  • Volumes: Use PVCs for postgres data.
  • Health checks: Convert to readiness/liveness probes.
  • Networking: Replace host port mappings with Services and Ingress.
  • Dependencies: Compose’s depends_on is not a startup gate; we’ll use probes and retries.

Kompose is a tool that translates Docker Compose files into Kubernetes manifests. It won’t produce perfect production manifests, but it’s a great starting point.

Install Kompose:

Convert:

You’ll get several YAML files under k8s/, typically including Deployments, Services, and PVCs. Review the output for api, redis, and postgres resources.

To keep things maintainable, we’ll use Kustomize to layer improvements on top of the generated manifests without editing them directly.


Create a structure like this:

Base kustomization.yaml

We’ll patch in secrets, probes, and other improvements in the overlay.


Create a Secret for sensitive values and a ConfigMap for non-sensitive config:

Patch the api Deployment to reference them:

Also add resource requests/limits (helps scheduling, stability, and autoscaling):

Patch postgres Deployment into a StatefulSet with a PVC:

Note: We’re replacing the kompose-generated postgres Deployment and PVC with a StatefulSet and a volumeClaimTemplate for better data consistency. Ensure you remove or override the original postgres Deployment in the overlay so only the StatefulSet is applied.

If you need Ingress to reach the API, add it:

Finally, wire the overlay together:

Apply to your Sealos-managed cluster:

If you’re not using DNS, you can test the API by port-forwarding:


For Redis, the kompose-generated Deployment is adequate for dev/test. For production, consider:

  • Redis as a StatefulSet with a PVC for persistence.
  • Using a well-maintained Helm chart (bitnami/redis) for built-in replication, metrics, and password support.

Example Redis resource patch for a simple persistent standalone:


Kompose can generate a Helm chart:

Helm can be a better fit if you want:

  • Parameterized values for different environments.
  • A packaging format for distribution.
  • Built-in rollback and release history.

Sealos plays nicely with Helm—use whichever packaging strategy suits your team.


Kubernetes gives you powerful primitives for operations. With Sealos providing the cluster, you can layer standard tools:

Observability Stack

  • Logs: Use kubectl logs for ad-hoc, then deploy EFK/ELK or Loki for centralized logging.
  • Metrics: Install the Prometheus Operator (kube-prometheus-stack) via Helm for cluster and application metrics.
  • Tracing: Deploy OpenTelemetry Collector to export traces from your services.

Example install:

Horizontal Pod Autoscaling (HPA)

Add resource requests and deploy an HPA for the API:

Apply:

Ensure the metrics server is running (often deployed by default in many clusters; if not, install it):

Rolling Updates and Rollbacks

Kubernetes Deployments enable zero-downtime rollouts:

Backups for Persistent Volumes

Your storage backend dictates backup strategy:

  • CSI snapshots: Use VolumeSnapshot resources to take point-in-time snapshots.
  • Application-level: pg_dump for PostgreSQL, Redis RDB/AOF persistence, and off-site backups.
  • For production, adopt a tested operator or backup toolchain (e.g., Velero for cluster resources and supported PVs).

  • Namespaces: Use namespaces for isolation across environments and teams.
  • Network Policies: Restrict pod-to-pod communication to only what’s necessary.
  • Secrets Management: Use Kubernetes Secrets, sealed-secrets, or an external KMS (e.g., HashiCorp Vault).
  • Pod Security: Use Pod Security Admission or Pod Security Policies (where applicable) and ensure containers run as non-root where possible.
  • Ingress and TLS: Terminate TLS at the ingress controller and manage certificates via cert-manager.

Install cert-manager:

Then create ClusterIssuer and annotate your Ingress for automatic certificates.


Your choice depends on environment:

  • Development: local-path-provisioner or hostPath volumes (simple, not HA).
  • Bare Metal Production: OpenEBS (LVM/Mayastor), Longhorn, or Ceph/Rook.
  • Cloud: Use your provider’s CSI driver (EBS, PD, Azure Disk).

Make sure:

  • A default StorageClass exists.
  • Stateful workloads use ReadWriteOnce volumes, unless your setup supports shared access (RWX).
  • I/O requirements and capacity are sized correctly.

Before declaring success, run through a checklist:

  • Pods become Ready consistently after a fresh deploy.
  • Readiness/liveness probes behave correctly under failure scenarios.
  • Databases persist data across restarts and node reboots.
  • Services are reachable via ClusterIP and Ingress/TLS is configured.
  • Resource limits prevent noisy neighbor issues.
  • HPA scales up under load test and scales down cleanly.
  • Logs and metrics are visible; alerts are configured for key SLOs.
  • Backups work and restores are tested.
  • RBAC roles are least-privilege for CI/CD and ops.

For each environment, automate:

  • Build and push images to a trusted registry.
  • Update image tags in Kustomize/Helm (e.g., via GitOps).
  • Run kubectl apply -k or helm upgrade as a pipeline stage.
  • Add gates for canary or blue-green releases when appropriate.

GitOps with Argo CD or Flux is a natural next step for reliability and auditability.


  • Pods Pending due to PVC: Ensure a default StorageClass exists and the provisioner is healthy.
  • CrashLoopBackOff: Inspect container logs and events (kubectl describe pod). Check secrets and env vars.
  • Ingress Not Routing: Confirm the ingress controller is running, the Ingress resource uses the correct class, and DNS resolves to the controller’s endpoint.
  • Image Pull Errors: Verify the registry is reachable and imagePullSecrets are set for private registries.
  • DNS Failures in Pods: Check CoreDNS status (kubectl -n kube-system get pods) and network policies.

Helpful commands:


  • Monolith → Microservices: Kubernetes lets you decompose the system incrementally. Start by migrating the whole Compose stack, then split services.
  • Stateful Workloads: Move dev databases first using StatefulSets, then consider managed databases or operators (e.g., Postgres Operator) for production.
  • Multi-tenant SaaS: Namespaces per tenant, resource quotas, and network policies keep tenants isolated with predictable performance.
  • Edge and On-Prem: Sealos simplifies standing up clusters outside cloud providers; use CSI drivers suited to your hardware.

As your usage grows:

  • Cluster Lifecycle: Create, upgrade, or tear down clusters predictably using Sealos “cluster images.”
  • Standard Tooling: Keep using kubectl, Helm, Kustomize, and your favorite operators—Sealos embraces the ecosystem.
  • Portability: Move clusters or workloads across environments with minimal friction.

The aim is to make Kubernetes feel as approachable as Docker Compose without sacrificing the power you need in production.


Moving from Docker Compose to Kubernetes doesn’t have to be a leap into the unknown. With a clear strategy, a conversion tool like Kompose, and a simplified cluster lifecycle via Sealos, you can migrate in a measured, confidence-building way.

Key takeaways:

  • Use Sealos to stand up a robust Kubernetes cluster quickly.
  • Convert Compose to Kubernetes manifests with Kompose, then refine with Kustomize or Helm.
  • Externalize secrets, map volumes to PVCs, add probes, and define resource requests/limits.
  • Install ingress and a storage class; adopt observability and autoscaling early.
  • Validate with health checks, backups, and load tests before promoting to production.

Start small: migrate a single Compose stack into your Sealos-managed cluster, iterate on best practices, and scale features as your needs grow. The Kubernetes ecosystem will meet you where you are—and with Sealos, getting there is far simpler than you might think.