diff --git a/docs/blog/en/2023/k8s-multi-tenancy.md b/docs/blog/en/2023/k8s-multi-tenancy.md index 2fcee8270dd..99239400d71 100644 --- a/docs/blog/en/2023/k8s-multi-tenancy.md +++ b/docs/blog/en/2023/k8s-multi-tenancy.md @@ -5,7 +5,7 @@ description: explores the value proposition of multi-tenant Kubernetes, implemen authors: [fanux] tags: [Kubernetes, Sealos, Multi-Tenant] keywords: [Cloud Operating System, Sealos, K8s, Cloud Native, Cloud Computing, Cloud OS, PaaS, Multi-Tenant, Runtime Isolation, Namespace] -image: https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-17-36-fBsk9p.jpg +image: https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-17-36-fBsk9p.jpg date: 2023-11-29T10:00 --- @@ -19,7 +19,7 @@ In today's business landscape, managing cloud and server resources is becoming i Multi-tenancy refers to an architecture allowing multiple users or "tenants" to share resources from the same system while keeping data isolated and secure. For Kubernetes, this means running workloads from different teams on a shared cluster without risk of resource conflicts, data leaks, or security issues. -![Diagram of single vs multi-tenant Kubernetes](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-rLPyaY.jpg) +![Diagram of single vs multi-tenant Kubernetes](https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-rLPyaY.jpg) ### Pain Points of Single-Tenant Setups @@ -30,7 +30,7 @@ Consider an enterprise Kubernetes cluster used by 20 internal departments. Witho 3. **Sprawl** - Lacking isolation allows cluster entanglement over time. 4. **Limitations** - Fixed single-tenant structure strains under changing demands. -![Comparison table of single vs multi-tenant Kubernetes](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-15-53-DGg4ig.png) +![Comparison table of single vs multi-tenant Kubernetes](https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-15-53-DGg4ig.png) ### The Multi-Tenant Advantage @@ -55,13 +55,13 @@ Sealos addresses these concerns through a multi-faceted isolation approach. It e Inherent to K8s is the absence of a native user management framework. This necessitates the creation of a user identity system, integration with external user management platforms, and issuance of unique kubeconfig files or tokens. Moreover, it's imperative to forge a multifaceted linkage between users and namespaces, coupled with the distribution of tailored permissions. -![Image Depicting User-Namespace Association](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-Dfn5xa.png) +![Image Depicting User-Namespace Association](https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-Dfn5xa.png) Sealos's framework enables administrators to effectively slot users into designated namespaces and regulate their roles, thereby achieving a granular control over permissions. This guarantees that users access only the resources they are legitimately permitted to use. -![Image Illustrating User Permissions Management](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-wknQxI.png) +![Image Illustrating User Permissions Management](https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-wknQxI.png) -![Image Showcasing User Role Control](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-RQFrTB.png) +![Image Showcasing User Role Control](https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-RQFrTB.png) ### Challenge 3: Metering and Managing Quotas @@ -69,13 +69,13 @@ A critical aspect of multi-tenancy in K8s is the equitable distribution and meti Utilizing eBPF technology, Sealos adeptly monitors network traffic, correlating it with tenant information and storing it in a database for precise billing and resource management. For compute and storage resources, Sealos relies on controllers to gather and administer relevant data, ensuring efficient resource oversight. -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-36-HsycaI.png) +![](https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-36-HsycaI.png) ## Extreme Multi-Tenancy - The Sealos Challenge In the realm of multi-tenancy, Sealos embarks on an ambitious journey, operating within the unpredictable confines of a public network. This scenario invites any developer to join and partake in a communal Kubernetes cluster, which inherently raises substantial security and stability risks. -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-54-kbCMsN.png) +![](https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-54-kbCMsN.png) The method adopted by Sealos brings forth distinct benefits: cost-effectiveness, as it negates the need for users to independently build and manage their clusters, leading to significant cost reductions in cloud services. It also enhances resource utilization, allowing container operations on a smaller scale, thereby leveraging the platform’s flexibility and resources. Crucially, establishing strong isolation in such a public network setting can bolster security and stability. diff --git a/docs/blog/en/2023/sealos-release.md b/docs/blog/en/2023/sealos-release.md index a9b239d3ce3..5725dc826a9 100644 --- a/docs/blog/en/2023/sealos-release.md +++ b/docs/blog/en/2023/sealos-release.md @@ -5,7 +5,7 @@ description: Explore the journey of Sealos, a grand cloud operating system proje authors: [fanux] tags: [Kubernetes, Sealos] keywords: [cloud operating system, Sealos, Kubernetes, cloud native, Cloud computing, cluster image, Sealer, cloud-native technologies] -image: https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting5@main/uPic/2023-08-31-09-52-gLmSek.jpg +image: https://cdn.jsdelivr.net/gh/yangchuansheng/imghosting5@main/uPic/2023-08-31-09-52-gLmSek.jpg date: 2023-06-13T10:00 --- diff --git a/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/feature.jpg b/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/feature.jpg new file mode 100644 index 00000000000..47e90ce0728 Binary files /dev/null and b/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/feature.jpg differ diff --git a/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/sealos-database.png b/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/sealos-database.png new file mode 100644 index 00000000000..f51861d140c Binary files /dev/null and b/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/sealos-database.png differ diff --git a/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/index.md b/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/index.md new file mode 100644 index 00000000000..66eb19d1633 --- /dev/null +++ b/docs/blog/en/2023/to-run-or-not-to-run-a-database-on-kubernetes/index.md @@ -0,0 +1,148 @@ +--- +slug: to-run-or-not-to-run-a-database-on-kubernetes +title: To run or not to run a database on Kubernetes? +description: This article thoroughly examines the advantages of using Kubernetes (K8s) for database management, including enhanced stability, performance, and operational efficiency. +authors: [fanux] +tags: [Kubernetes, Sealos, Database] +keywords: [Cloud Operating System, Sealos, K8s, Cloud Native, Cloud Computing, Cloud OS, PaaS, Database, Container] +image: images/feature.jpg +date: 2023-12-06T10:00 +--- + +Yesterday, an insightful article by Mr. Feng explored [the drawbacks of deploying databases in K8S](https://mp.weixin.qq.com/s/4a8Qy4O80xqsnytC4l9lRg). + +Debating the merits of containerized databases might have been relevant four years ago, but in 2023, it's crucial to understand the broader acceptance of this technology. + + + +I began working with K8s from its 0.9 version. Initially, with the CSI still in its nascent stage, true stability wasn't achieved until version 1.0. During my time at iFLYTEK, I played a key role in developing and maintaining a comprehensive system that was integral to the company's internal PaaS services. + +We set up a cluster with 30 physical machines, deceptively small yet technologically advanced, running around 3000 applications of varied types including microservices, databases, message queues, and caches. **This cluster, utilized by hundreds of our developers, was maintained with less than half a person's effort, illustrating the efficiency brought by K8s.** + +Additionally, we managed to upgrade the Linux kernel seamlessly, a task unimaginable without the support of K8s. Normally, coordinating such an upgrade could take as long as six months. + +I've also seen a cluster hosting 400 databases, which required 400 servers and a 40-person team, yet operated at less than 10% efficiency. This cluster, a victim of excessive manual maintenance, reflects a common challenge many teams encounter in managing and optimizing their infrastructure efficiently. + +Upon joining Alibaba, I observed that all databases for delivery purposes were operated on K8s. For over five years now, we've been running databases in containers flawlessly, with no incidents. + +## Democratizing Database Expertise on K8s + +In the business sector, companies often confront two primary challenges with database management: either their management skills are not robust enough to maximize database potential, or they face significant expenditures in managing their databases. The concept of "[Database on K8s](https://sealos.io/docs/platform-components/dbprovider/)" introduces a standardization that addresses these issues. Such standardization facilitates collaboration and alters the dynamics of productivity and production relationships, leading to a substantial increase in efficiency. This approach empowers teams, even those lacking in specialized skills, to leverage professional capabilities. This is analogous to the distinct roles in agriculture and animal husbandry, where focus in their respective domains enhances overall efficiency and output. + +The KubeBlocks team is a prime example of this. Their expertise and accumulation of knowledge in database management are likely superior to that of most companies. They have transformed their experiential knowledge into code, crafting controllers that enable other businesses to operate in an exceptionally streamlined manner. K8s plays a crucial role in making this feasible. + +One common query is: Why not opt for Ansible? Operational staff often favor Ansible due to its compatibility with their tools. However, Ansible is primarily focused on deployment and operational tasks. K8s controllers, on the other hand, are built on the principle that **tasks achievable by machines should not be manually performed by humans**. They facilitate **a constant, 24-hour synchronization between desired and actual states**, a challenging task with Ansible. Would Ansible be the choice for setting up a routine task? + +This mirrors the era before operating systems when programmers manually punched holes in paper tapes to execute programs. Running programs on paper tapes or CDs was possible, but it begged the question of the necessity of operating systems. + +The underlying principle is the same: Ansible is a valuable tool for operational staff, but K8s's objective is to do away with lower-level operational work (such as writing and executing Ansible scripts). K8s enables more efficient and automated database management, granting teams without extensive database management expertise access to high-level services. + +## The Benefits of Running Databases on Kubernetes + +Most concerns around database-on-Kubernetes boil down to: + +**How stable is it?** + +**Can I effectively troubleshoot issues?** + +**Does performance suffice?** + +### Complexity + +Complexity for databases on Kubernetes involves two key aspects: + +1. Build complexity +2. Usage complexity + +**First: Build Complexity** + +Building a production-grade database platform directly atop native Kubernetes proves costly, unfriendly for beginners lacking depth of expertise. You'd need to create multiple critical components yourself - Kubernetes storage drivers, database controllers, etc. Hands-on expertise makes this possible, but proves challenging. + +Hence the appeal of distributions, much like CentOS, Ubuntu, etc. for Linux instead of direct kernel wrangling. Consider Kubernetes the "cloud kernel." Using the raw kernel sans customization leaves an insufficiently robust, user-friendly experience. The kernel merely provides a framework; users must architect and integrate many optimizations themselves. Kubernetes distributions help solve this. For instance, [Sealos delivers](https://sealos.io/docs/self-hosting/lifecycle-management/quick-start/deploy-kubernetes/) **full systems including highly available clusters, finely-tuned storage, and optimized databases in one click**. Two simple commands: + +```bash +$ sealos run labring/kubernetes:v1.27.7 labring/helm:v3.9.4 labring/cilium:v1.13.4 \ +--masters 192.168.64.2,192.168.64.22,192.168.64.20 \ +--nodes 192.168.64.21,192.168.64.19 -p [your-ssh-passwd] + +$ sealos run labring/openebs:v3.9.0 labring/mysql:8.0 +``` + +Done. The complete system with HA cluster, finely-tuned storage, and optimized databases emerges in minutes. While Ansible aids installs, **it cannot handle critical runtime needs like self-healing and multi-tenancy** - key advantages Kubernetes provides for databases-as-a-service. + +**Second: Usage Complexity** + +Leveraging cloud operating system distributions and controllers, users can deploy standardized database services, moving away from script-based solutions. + +![](images/sealos-database.png) + +This interface is designed for universal ease of use. Even beginners can manage to establish a three-replica PostgreSQL cluster, incorporating backup, recovery, and monitoring functions. This capability democratizes access for all developers within an organization and **underscores the fundamental divergence between 'cloud computing thinking' and 'script-based thinking'. Cloud computing democratizes service provision (as a Service), in contrast to the traditional script-based methods which serve more as operational conveniences.** + +### Stability + +Our team, despite not specializing in database technology, has successfully established a highly stable database system. This demonstrates the potential of what dedicated experts in the field can accomplish. For users, this means that database stability concerns can be confidently entrusted to seasoned professionals. + +Consider the [Sealos Public Cloud](https://cloud.sealos.io) as an example. It currently supports thousands of applications with fully containerized databases, all under the maintenance of the KubeBlocks team. Any arising database issues are efficiently handled by them. From a cost-benefit perspective, utilizing KubeBlocks' commercial services is more economical than employing a full-time database administrator. Furthermore, as Sealos architects, we ensure that database users face minimal operational concerns. Our stability standards exceed those of many non-specialist teams. + +Additionally, database lifecycle management involves specific tasks, and over time, stability issues are progressively resolved. These improvements, often made at the code level, incrementally reduce end-user concerns. This parallels the enhanced stability of the Linux system, achieved through ongoing technological development and optimization. **A well-designed software architecture not only improves but also consolidates its robustness, reducing dependence on human oversight. An illustrative comparison is that Oracle users might find themselves enjoying more leisure time than those using open-source MySQL.** + +Hence, both empirical evidence and theoretical considerations suggest that stability should not pose a hurdle for running databases on K8s. **Choosing K8s for database management effectively means leveraging the pooled expertise of numerous preeminent database experts. Their extensive knowledge and skill, embedded in the code, provide standardized, high-quality services to users. Such depth and efficiency of expertise are challenging to replicate with basic scripting alone.** + +### Performance + +It's a common belief that databases in containers underperform, but this is usually due to a lack of proper handling. The KubeBlocks team's in-depth testing and optimization, detailed in their analysis, show that these complexities are not for users to worry about. **The intricacies are already incorporated into the controller's code, making the process user-friendly**. In fact, the effect of containers on database performance is minor, with disk I/O and network bandwidth latency being the real influential factors. + +The OpenEBS raw disk plus database controller solution addresses these performance issues effectively. By employing a database controller, dependency on distributed storage is removed. This controller ensures both high performance and availability for database replicas, irrespective of the service type, and is seamless for the user. In case of a failure, it automatically makes adjustments, offering a superior database user experience. + +[Sealos](https://sealos.io) is a prime example of this solution in action, achieving high availability without compromising performance. It interacts directly with raw disks, facilitating automatic scaling, backup, and recovery. In the event of a node failure, the controller swiftly launches a new node, synchronizes the data, and integrates it into the cluster. These advanced capabilities, beyond the reach of traditional scripting methods that often require manual intervention, showcase the superiority of cloud operating systems. + +Thus, **running databases on K8s not only avoids performance issues but also offers stability that often surpasses the capabilities of many IT operations teams**. This approach is user-friendly and straightforward, with self-service functionalities. Would this be an option you'd consider? + + +## Do not deny or affirm without considering practical scenarios + +In considering whether to containerize databases, we must take into account diverse real-world applications. + +For some companies with stable non-containerized databases and sufficient funds for database experts, there's little motivation to migrate to Kubernetes (K8s). Why risk migration issues? For example, banks often rely on specialized Oracle machines with straightforward subscription models, providing little impetus for change. + +Conversely, many business development teams and organizations now face a compelling choice: **to access sophisticated database capabilities at a minimal cost, thereby focusing their primary efforts on business development.** + +They might choose cloud database services like RDS (Relational Database Service) or Kubernetes (K8s) based database solutions. This method requires an ongoing management process, replacing manual roles and equipping teams with limited database knowledge. This represents a significant trend, where upfront costs (like developing controllers) increase, but the incremental costs for each team utilizing the database substantially decrease. + +There are various approaches to achieve this, such as virtual machines or Ansible, but Kubernetes-based controllers stand out as the superior solution. Even for services offering RDS-like functionalities, the Kubernetes tech stack emerges as the optimal choice. Virtual machines, being more cumbersome and costly, incur greater performance overheads. And for tools like Ansible to achieve self-service and multi-tenancy seems overly optimistic. + +## Summary + +### Kubernetes' Unique Strategic Significance + +Kubernetes brings tremendous force multiplication, like mastering lifelong martial arts training. Without Kubernetes, you might exert 10% of a database's true potential. Used skillfully, Kubernetes massively amplifies operational database efficiency, savings, and resilience. + +### Technological Progress Reshapes Work Patterns + +As technology advances, specialized database users and caretakers decouple. Manual upkeep yields to intelligent automation. Amidst this shift, standardization enables effective collaboration at global scale. No stronger de facto standard for cloud-native automation exists now than containers and Kubernetes, so database adoption seems inevitable. + +### Practical Proof Points + +Globally, many teams have successfully run databases on Kubernetes in production across critical dimensions like cost, usability, stability, performance, and more - with remarkable measurable results. Once accustomed to Kubernetes' advantages, tough to justify reverting to old-school manual operations. For instance, Sealos' architecture evolved from Ansible (v2) to Golang (v3) - now at [v4 and v5](https://github.com/labring/sealos). This exemplifies "cloud native thinking", not legacy "ops script thinking" tied to specific individuals. If a solution lacks even basic APIs, how can we discuss advanced scalability and productivity? Systems should consider machine consumers first, then human ones - this unlocks true automation leverage. Hence, API > CLI > GUI. + +### Operations Roles Transform + +Many legacy DBAs naturally feel inclined to spread Kubernetes database FUD, protecting their niche skillsets. But enlightened technology leadership will consistently discover immense TCO and productivity gains from thoughtful, staged standardization - we've erased entire 40-person ops teams when strategically migrating systems to Kubernetes without layoffs. Without question, many ops engineers justifiably feel their roles threatened amidst displacement by increasingly automated toolchains. But technologies only accelerate; they cannot unwind. Leaders must shepherd transitions. + +### Kubernetes Maturity and Ecosystem Growth + +Kubernetes rapidly matures while its ecosystem explodes with new solutions. Inevitable chaos results as practices and culture race to catch adoption. But time cures challenges - take heart knowing robust distributions have repeatedly emerged across domains like Linux. These tame entropy and ease adoption by curating “batteries-included” solutions optimized for regular challenges. Sealos leads here as a purpose-built Kubernetes cloud-native OS distribution for standardizing database (and other) operational burdens. Recently, across 200+ Sealos users, literally none reported fundamental database operational struggles. A few cited early instability, but root causes like resource misconfigurations got systematically addressed - now they report Kubernetes-automated databases proving >9 times more stable than DIY trial-and-error. + +### The Enterprise Strategic Choice + +Actual organizational needs should determine if and how organizations adopt Kubernetes databases-as-a-service. But the intelligent path brings tremendous advantages: solutions like Sealos + KubeBlocks equate to: + +1. 8+ years of specialized Kubernetes platform expertise +2. A top-tier database team including multiple senior engineers +3. Extreme usability, resilience, and performance + +...all for less than the cost of staffing database specialists internally. Internal political hesitations naturally arise amid shifts. But pragmatic facts speak volumes about the optimal way forward. + +### Final Thoughts + +Rather than rebutting each counterargument exhaustively, I'll leave readers to independently judge the landscape and merits based on results. Please share your perspectives so together we uncover greater collective truth. The future looks abundantly bright for Kubernetes' democratization of reliability and scale across critical domains like databases. \ No newline at end of file diff --git a/docs/blog/zh-Hans/2023/k8s-multi-tenancy.md b/docs/blog/zh-Hans/2023/k8s-multi-tenancy.md index 2d0974f1bf5..42d28054fc1 100644 --- a/docs/blog/zh-Hans/2023/k8s-multi-tenancy.md +++ b/docs/blog/zh-Hans/2023/k8s-multi-tenancy.md @@ -5,7 +5,7 @@ description: 本文深入探讨了 K8s 多租户的概念、其在现代企业 authors: [fanux] tags: [Kubernetes, Sealos, 多租户] keywords: [云操作系统, Sealos, K8s, 云原生, 多租户, 隔离, 命名空间] -image: https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-17-36-fBsk9p.jpg +image: https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-17-36-fBsk9p.jpg date: 2023-11-29T10:00 --- @@ -19,7 +19,7 @@ date: 2023-11-29T10:00 “多租户”是一种软件架构的设计方式,允许多个用户(租户)共享相同的系统或程序组件,同时保持各自数据的隔离性和安全性。在 K8s 环境中,实现有效的多租户机制意味着能够在同一 K8s 集群中运行多个独立的租户工作负载,而无需担心资源冲突、数据泄露或安全问题。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-rLPyaY.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-rLPyaY.jpg) ### 没有多租户支持的挑战 @@ -33,7 +33,7 @@ date: 2023-11-29T10:00 4. **规模扩展受限:**在一个单一租户的环境下,集群难以支持多样化的业务需求,限制了企业的扩展能力。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-yua4G3.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-yua4G3.png) ### 多租户架构的优势 @@ -61,13 +61,13 @@ date: 2023-11-29T10:00 K8s 本身不具备原生的用户管理系统。因此,需要通过扩展功能来构建用户概念,与第三方用户系统对接,为每个用户生成独立的 kubeconfig 认证文件或 token。此外,需要建立用户与命名空间 (namespace) 之间的多对多关系,并为用户分配适当的权限。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-Dfn5xa.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-Dfn5xa.png) Sealos 的设计允许管理员将用户加入特定的命名空间,并对其角色进行管理,从而有效地控制权限。这样管理员就可以细粒度地管理用户权限,确保每个用户只能访问和修改他们被授权的资源。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-wknQxI.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-wknQxI.png) -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-RQFrTB.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-34-RQFrTB.png) ### 挑战 3:计量与配额管理 @@ -75,13 +75,13 @@ Sealos 的设计允许管理员将用户加入特定的命名空间,并对其 Sealos 采用 eBPF 技术来监控网络流量,并通过控制器将流量数据与租户信息相关联,存储到数据库中。这样可以与计量计费系统对接,实现对资源使用的准确计费。对于计算和存储资源的监控,Sealos 同样采用了控制器来收集和管理这些信息。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-36-HsycaI.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-36-HsycaI.png) ## Sealos 多租户的挑战 如果说上面的这些问题很难解决,那么 **Sealos 的场景是在上述难度上乘以了 10 倍**,因为 Sealos 选择了在公网这个不可信的环境中解决多租户问题,意味着给任意的开发者公开注册,然后一起共享一个 K8s 集群。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-54-kbCMsN.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting6@main/uPic/2023-11-29-10-54-kbCMsN.png) 公网环境的不可信性和开放性使得实现多租户变得尤为复杂。在这种环境下,任何开发者都可以注册并共享同一个 K8s 集群,这就带来了巨大的安全和稳定性挑战。但是,如果能够成功实现,其好处也是显而易见的: diff --git a/docs/blog/zh-Hans/2023/sealos-release.md b/docs/blog/zh-Hans/2023/sealos-release.md index b4d96ae1a34..948e4514a9a 100644 --- a/docs/blog/zh-Hans/2023/sealos-release.md +++ b/docs/blog/zh-Hans/2023/sealos-release.md @@ -5,7 +5,7 @@ description: 深入探索 Sealos 的发展历程,从一个简单的 K8s 安装 authors: [fanux] tags: [Kubernetes, Sealos] keywords: [云操作系统, Sealos, K8s, 云原生] -image: https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting5@main/uPic/2023-08-31-09-52-gLmSek.jpg +image: https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting5@main/uPic/2023-08-31-09-52-gLmSek.jpg date: 2023-06-13T10:00 --- @@ -17,7 +17,7 @@ date: 2023-06-13T10:00 2018 年的某个夜晚,夜深人静,我挥舞键盘,敲下了 Sealos 的第一行代码。当时仓库命名为 “kubeinit”,后来觉得格局太小,我不可能只做一个安装 K8s 的工具。安装只是更大计划的一部分,于是更名为 [Sealos](https://github.com/labring/sealos/ "Sealos"),一个宏大的[云操作系统](https://sealos.run)计划就此诞生! -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting5@main/uPic/2023-08-31-09-52-gLmSek.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting5@main/uPic/2023-08-31-09-52-gLmSek.jpg) @@ -25,7 +25,7 @@ Sealos 的第一个版本写完后,我就把它发布到了阿里云市场出 先来一波回忆杀: -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-VHeU8B.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-VHeU8B.jpg) 随后销量暴增,很快我就换了新手机 iPhone 8,但是问题也同时增加,以至于我根本无法及时提供所有的售后服务。于是我决定重写 Sealos,发布了基于 Ansible 的 v2 版本。最终还是觉得没有做到极致,因为用户还是遇到太多依赖问题无法解决。直到读完 kube-proxy 的源码,我发现有一种方案可以把负载均衡变得更简单,**干掉所有依赖**。于是我编写了 Sealos 的 v3 版本,在安装方面做到了极致。 @@ -51,7 +51,7 @@ CMD helm install mysql . 理解这一点其实很简单,只需要把单机操作系统上安装的单机应用替换成各种分布式应用即可。整个数据中心,**你看到的不再是一台台孤立的服务器,而是一个整体,变成了一台虚拟的超级计算机。** -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-ffDeDv.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-ffDeDv.jpg) 这样简洁、清爽且臻至完美的[云操作系统](https://sealos.run),相信你在第一眼见到它的时候,便会喜欢上它! @@ -63,7 +63,7 @@ Sealos 保持了极简的设计,没有任何多余的按钮。实现简洁与 在 B 端软件的世界里,付款者与使用者往往并非同一人,导致产品体验时常被忽略,最关键的还是要说服决策者。而 Sealos 不一样,我们坚信产品体验高于一切,如果我们在产品上花费大量精力最终导致失败,那也死而无憾。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-v1fPyx.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-v1fPyx.jpg) 这种黑白灰的设计风格会让你使用产品时**感觉像在喝白开水,而不是在喝饮料,更不是在喝洗脚水** (某些产品使用起来想死的心都有)。开发者已经够痛苦了,我希望你们在使用 Sealos 时心情美好。 @@ -73,7 +73,7 @@ Sealos 能一针见血地戳中应用的痛点,比如这个应用管理器 App 我在 Sealos 上运行了 10 多个应用,包括三个数据库,还有博客,低代码平台,测试平台等,每天只花 4 块钱 : -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-X4FAjB.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-X4FAjB.jpg) 为什么能这么便宜? @@ -91,7 +91,7 @@ Sealos 可以帮助 80% 的企业降低 80% 的资源使用成本。 与其他管理平台或 PaaS 平台不同,Sealos 的核心设计理念是“一切皆应用”。不同的开发者,不同的角色使用不同的应用,这让每个用户在使用时都没有心智负担。就像安卓生态中有几十上百万个应用,你只关心自己使用的那几款应用,不用关心其他应用在做什么。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-OsRpZy.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-17-59-OsRpZy.jpg) 这样的设计有两个主要优势: @@ -109,7 +109,7 @@ Sealos 采取了不同的做法。在这个平台上,不同的人可以使用 Sealos 非常关注应用间的相互配合。例如,你在 Sealos 上使用函数计算,默认数据库可能是 MongoDB,但如果你想用 PostgreSQL 怎么办?这时就可以在 Sealos 上安装一个 PostgreSQL 应用,然后通过服务发现直接在函数计算里面访问。因为在同一个集群内,可以直接通过内网 DNS 相互配合。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-18-00-HEtGtd.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-18-00-HEtGtd.jpg) Sealos 精简而不简单,所有组件都可以卸载,这让云恰好满足你的需求——多一分则嫌多,少一分则嫌少。这也意味着无论是一台服务器还是上百台数据中心,都可以通过一条命令构建成一朵云。 @@ -127,7 +127,7 @@ Sealos 精简而不简单,所有组件都可以卸载,这让云恰好满足 更进一步发现:原来**有个 AI 在帮你自动做故障诊断,自动上线业务,甚至帮你写代码并自动测试上线**。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-18-01-t4W7LN.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-18-01-t4W7LN.jpg) 然后你会发现普通人也能用 Sealos: @@ -141,7 +141,7 @@ Sealos 精简而不简单,所有组件都可以卸载,这让云恰好满足 当然有,Sealos 社区用户 10 万+,不乏各种大企业。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-18-01-ZOZ4Ud.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-16-18-01-ZOZ4Ud.jpg) 上线两个月时间注册用户已经破万,云服务共计运行 **7000+ 应用**。 diff --git a/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/feature.jpg b/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/feature.jpg new file mode 100644 index 00000000000..47e90ce0728 Binary files /dev/null and b/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/feature.jpg differ diff --git a/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/sealos-database.png b/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/sealos-database.png new file mode 100644 index 00000000000..96cc662cc03 Binary files /dev/null and b/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/images/sealos-database.png differ diff --git a/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/index.md b/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/index.md new file mode 100644 index 00000000000..aca69bc5f9d --- /dev/null +++ b/docs/blog/zh-Hans/2023/to-run-or-not-to-run-a-database-on-kubernetes/index.md @@ -0,0 +1,144 @@ +--- +slug: to-run-or-not-to-run-a-database-on-kubernetes +title: 在 K8s 上跑数据库,到底有没有意义? +description: 本文深入分析了 K8s 在数据库管理上的优势,包括稳定性、性能和运维效率。了解为什么将数据库集成到 K8s 是当今技术趋势的一部分,并探讨这一选择对企业和开发团队的意义。 +authors: [fanux] +tags: [Kubernetes, Sealos, 数据库] +keywords: [云操作系统, Sealos, K8s, 云原生, 数据库, 容器,] +image: images/feature.jpg +date: 2023-12-06T10:00 +--- + +昨天冯老板发了一篇文章探讨了[为什么将数据库放入 K8S 中不是一个明智的选择](https://mp.weixin.qq.com/s/4a8Qy4O80xqsnytC4l9lRg)。 + +如果是四年前有人质疑容器化数据库我觉得还可以 battle 一下,都 2023 年了还有人不能认清这个大势,我就有必要来谈谈我的看法了。 + + + +我从 K8s 0.9 版本时就开始做这件事,当时确实略早,CSI 都不成熟,到 1.0 才稍微稳定点,当时我在科大讯飞工作,负责的项目是建设和维护一整套系统,这套系统最终支撑了公司内部的 PaaS 服务。 + +我们构建了一个 30 台物理机的集群,别看这个集群很小,但是非常有技术含量,里面跑了近 3000 个应用,而且是各种类型的,包括但不限于微服务,数据库,消息队列,缓存等等。**这个集群被公司内部几百名开发人员同时使用,但是整个集群的运维工作只需不到半个人力就能完成,如果没有 K8s 这一切绝对不可能。** + +我们还在不影响上层应用的情况下,无感知地升级了 Linux 内核。这种无感知升级如果没有 K8s 的支持是无法想象的,光是和各个业务线沟通可能都需要半年。 + +我见过另外一个集群,跑了 400 个数据库而已,堆了 400 台服务器和 40 个人的运维团队,集群的整体利用率却不到 10%。整个集群无人敢动,只能一直堆人,人肉运维。这种情况虽然可以归咎于组织的不专业,但实际上,很多团队都面临着类似的挑战,无法有效地管理和优化他们的基础设施。 + +后来我去了阿里,所有的交付类场景数据库全部是跑在 K8s 上。迄今为止我们在容器里跑数据库五年有余,0 故障。 + +## 数据库 on K8s:专业能力的普及化 + +绝大多数做业务的公司对数据库的处理通常存在两个问题:要么是数据库管理水平一般,无法充分发挥数据库的潜能;要么是每年需要在数据库管理上花费大量成本。[数据库 on K8s](https://sealos.run/docs/platform-components/dbprovider/) 可以让这一切标准化,有了标准,人与人之间才可以协作,生产力改变生产关系,从而大幅提效,让绝大多数不具备专业能力的团队享受到专业能力,本质上分工更明确了,就像农业和畜牧业分离一样,各自专注于自己的领域,从而提高整体的效率和产出。 + +以 KubeBlocks 团队为例,我相信绝大多数公司在数据库层面的积累和专业能力都没有他们强。而且他们将这些实践经验转化为代码,写成了控制器,以极其简单的方式赋能给其他企业。K8s 让这一切成为可能。 + +你可能会问:为什么不用 Ansible?运维人员可能很推崇 Ansible,因为和他们手头上的工具很匹配,用起来很顺手。Ansible 的核心思想是帮助用户部署和执行运维操作,而 K8s 的控制器则是基于另一种思路:**机器能做的事就不应该由人来做**。通过 Operator,可以实现 **24 小时不间断地同步期望状态和实际状态**,而这是用 Ansible 很难实现的,你用 Ansible 实现是想写个定时任务嘛? + +这就像在操作系统诞生之前,程序员需要手动给纸带穿孔来运行程序。有人可能会说,用纸带也能运行程序,甚至可以把程序刻录在光盘上运行,为什么还需要操作系统呢? + +这其实是同样的道理:Ansible 对运维人员来说是一款好工具,但 K8s 的目标是消除低端运维工作 (即编写和执行 Ansible 脚本的工作)。通过 K8s,我们可以实现更高效、更自动化的数据库管理,从而让那些不具备专业数据库管理能力的团队也能享受到专业级的服务。 + +## 数据库 on K8s 的优势 + +大部分人对于在 K8s 上运行数据库的担忧无非就集中在这几个问题上: + +**稳定性不知道怎么样?** + +**出了问题我没法排查?** + +**性能是不是不够好?** + +### 复杂度 + +在 K8s 上运行数据库,复杂度主要分为两个方面: + +1. 建设这套系统的复杂度 +2. 使用上的复杂度 + +**第一:建设这套系统的复杂度** + +如果直接基于原生的 K8s (裸 K8s) 去构建数据库系统,成本会相对较高,而且对于新手来说,这样的操作并不友好,你需要自己建设 K8s 存储驱动、数据库控制器等多个组件,没有深厚的专业知识和实践经验是搞不定的。 + +这个时候发行版的优势就体现出来了,类似于 Linux 系统中,大多数人更倾向于使用 CentOS、Ubuntu 等发行版,而不是直接操作内核。我们也可以将 K8s 视为一种 “云内核”,如果你只是直接使用内核而不进行适当的定制和优化,可能会觉得它不够好用。因为内核本身只是提供了一个框架,很多功能和优化需要用户自己去实现。而 K8s 发行版则帮助用户解决了这一问题。例如,[Sealos 可以帮你一键](https://sealos.run/docs/self-hosting/lifecycle-management/quick-start/deploy-kubernetes)构建**包括高可用性集群、存储插件和数据库在内的完整系统**。这一切只需要简单的两条命令: + +```bash +$ sealos run labring/kubernetes:v1.27.7 labring/helm:v3.9.4 labring/cilium:v1.13.4 \ + --masters 192.168.64.2,192.168.64.22,192.168.64.20 \ + --nodes 192.168.64.21,192.168.64.19 -p [your-ssh-passwd] +$ sealos run labring/openebs:v3.9.0 labring/mysql:8.0 +``` + +然后就没有然后了,一个包含高可用集群、存储插件和数据库的系统就诞生了。虽然 Ansible 可以帮助你解决安装问题,但它**无法处理运行时的自愈、多租户等问题**,而 on K8s 可以让数据库 as a Service。 + +**第二:使用上的复杂度** + +通过云操作系统发行版和控制器,用户可以实现产品化的数据库服务,而不是靠脚本解决问题。 + +![](images/sealos-database.png) + +这个页面我相信没有人不会使用吧?即使是菜鸡如我,都有能力建设起一个具有 3 副本的 PostgreSQL 集群,并且包含备份、恢复和监控等功能。这种能力不仅可以赋予企业中的所有开发者,也**展示了 “云计算思维” 与 “脚本思维” 的根本区别**。**云计算让每个人都能够提供服务 (as a Service),而传统的脚本方法只是运维人员的一种便捷工具。** + +### 稳定性 + +我们团队在数据库领域谈不上专业,都能建立起相当稳定的数据库系统,更别说专门研究这个领域的顶尖专家了。这个事情使用者不用操心,扔给专业的人去做就可以了。 + +举个例子,[Sealos 公有云](https://cloud.sealos.io)目前运行了数千个应用,这些应用的数据库都是完全容器化的,由 KubeBlocks 团队提供支持。一旦数据库出现任何问题,我们只需将问题扔给他们即可。从成本角度来看,随便招聘一个 DBA 的成本都远高于我们支付 KubeBlocks 商业版的费用了,而且 Sealos 还是平台的建设方,对于使用数据库的最终用户来说就更不用关心了。从目前的运行情况来看,我们的稳定性已经远超许多非专业团队的运维水平。 + +而且基本上数据库的生命周期管理就那么多事,稳定性问题是会随着时间的推移被收敛的,这些问题不断在代码层面被解决掉,最终用户关心的越来越少。这一点类似于 Linux 系统的稳定性,随着技术的不断成熟和优化,其稳定性已经达到了非常高的水平。**一个良好的软件架构会不断提升和收敛其鲁棒性,并逐渐减少对人的依赖,比如使用 Oracle 的人喝茶时间一定比用开源 MySQL 的人喝茶时间多。** + +所以无论从现实情况还是理论分析来看,稳定性都不应该成为用户在 K8s 上运行数据库的障碍。**将数据库运行在 k8s 上,实际上是在利用几十名顶尖数据库专家的经验,他们将自己的知识和技能沉淀到代码中,以标准化的方式为用户服务。单靠脚本很难将这些经验沉淀得如此彻底和高效。**。单靠脚本很难将这些经验沉淀得如此彻底和高效。 + +### 性能 + +说数据库跑容器性能不好的大概率都是不会玩的,KubeBlocks 团队做过深入的测试与调优,并撰写了很详细的分析文章,很多人觉得真复杂,但是其实这个复杂的事又不需要用户去做。**这些复杂性已经被内嵌在控制器的代码中,对于最终用户来说,这一过程并不复杂**。而且,容器对数据库性能的影响几乎可以忽略不计,真正重要的是磁盘 IO 和网络带宽时延等因素。 + +OpenEBS 裸盘+数据库控制器的方案就可以有效解决性能问题。有了数据库控制器,就无需依赖于分布式存储。控制器能够保证数据库多副本的高性能和高可用性,无论是有状态服务还是无状态服务,对于用户来说都感觉不到差异。如果实例发生故障,控制器会自动进行调整。这才是一种极致的数据库使用体验。 + +[Sealos](https://sealos.run) 目前已经采用了这种解决方案,在保证高可用性的同时,又不牺牲性能。它可以直接对接裸盘,进行自动扩容、备份和恢复。如果节点发生故障,控制器会自动启动新节点,同步数据并将其加入集群。这些高级功能只能在云操作系统中实现,传统的脚本方法只能望尘莫及,而且后者通常还需要人工介入,比如半夜挂了就只能 on call 了。 + +所以**在 K8s 上运行数据库不仅没有性能问题,其稳定性甚至都超过了大多数运维人员的能力**。而且,这种方式已经做到了简单易用和自助操作,你要不要用? + +## 不脱离实际场景去否定和肯定 + +在讨论数据库是否应该容器化时,我们必须考虑不同的实际应用场景。 + +有些公司的数据库已经非常稳定的以非容器化的方式在运行了,也不差钱养着一群数据库专家,这样的情况当然没有动力把数据库搬到 K8s 上,搬出问题谁来背锅?例如,银行通常使用专门的 Oracle 一体机,只需支付订阅费用即可,这样的系统很难有迁移的动力。 + +然而,对于许多业务开发团队和组织来说,他们现在面临着一个新的选择:**以极低的成本获得高度专业的数据库能力,从而将核心团队的精力全部集中在业务开发上。** + +要达到这一效果,他们可以选择直接使用 RDS (关系数据库服务) 这样的数据库云服务,或者采用基于 K8s 的数据库解决方案。这种方法需要一个长时间运行的管理进程来替代人工角色,以赋予那些不懂数据库的团队相应的能力。这就是一个大的趋势,固定成本 (例如开发控制器的成本) 提升了,但是边际成本 (每个使用数据库的团队的成本) 会大幅降低。 + +当前有很多方案可以做到这一点,比如基于虚拟机或基于 Ansible,但毋庸置疑基于 K8s 的控制器在当前看来是最优解。即便是提供类似 RDS 这种能力的服务,底层使用 k8s 技术栈也是最优解。相比之下,虚拟机就不太行了,重,成本自然高,而且有更多的性能消耗。而像 Ansible 这类工具想要实现自助服务和多租户支持,更是异想天开。 + +## 总结 + +### K8s 的重要性 + +K8s 是个大杀器,像是无崖子一甲子的功力你能发挥几成,如果 K8s 不跑数据库,你大概只能发挥 1 成功力。用好 K8s 能够极大地增强数据库运维的效能。 + +### 技术进步带来的分工变革 + +随着技术的不断进步,数据库的管理者和使用者会逐渐分离,传统的人工操作正在逐步被自动化程序所取代。在这个过程中,标准化就成了有效协作的基石。目前没有看到比容器技术和 K8s 更强的事实标准诞生,因此,将数据库跑到 K8s 上是大势所趋。 + +### 实践案例和效益 + +目前已经有很多团队在成本、易用性、稳定性和性能等多个维度上成功实践了 K8s,取得了显著的成果,也尝到了这样做的甜头。由奢入俭难,一旦企业体验到了 K8s 带来的好处,很难再回到传统的运维方式。以 Sealos 为例,从 v2 使用 ansible,到 v3 完全转向 golang,[现在已经发展到 v4 和 v5](https://github.com/labring/sealos),这种技术的演进正是基于 “云计算” 和 “云操作系统” 的思维,而不是传统的 “运维脚本” 思维。脚本连个 API 都实现不了你我谈先进生产力?设计一个系统优先考虑的不一定是给人用的,而是给别的系统调用的,这样整个自动化才能起飞,这就是为什么 API > CLI > GUI 的原因。 + +### 运维角色的转变 + +目前还是有很多存量市场的 DBA 运维人员想保住自己的饭碗在唱衰这个方向,但是英明的决策者迟早会发现采用 K8s 可以大幅降低人力成本,提高效率和系统稳定性。**良禽择木而栖,希望很多运维同学能意识到你们在逐渐被取代是事实,当年我们做讯飞云的时候有近 40 人的运维团队,做完之后连运维这个组都没了**。在阿里云的时候我们团队也是 0 运维人员。 + +### K8s 的快速成熟和生态发展 + +K8s 在以极快的速度走向更成熟,生态在蓬勃发展,诞生了短期的乱象,让落地实践变得无所适从。但是不要担心,优秀的发行版一定会出现,发行版就在做 “熵减” 的事情,简化用户的使用体验,就像 Linux 内核到 Linux 发行版的演进一样,Sealos 就是其中一款基于 K8s 的云操作系统发行版。我最近一段时间回访了将近 200 名 Sealos 的付费用户,没有一个用户反馈上面的数据库不会用的,有反馈不稳定的,几个原因,磁盘满了,升级导致的问题等,这几个问题都被收敛掉了,最终趋近于 0,至少可以说是比用户自己搭建的稳定性高出好几个 9。 + +### 企业的选择 + +企业选不选这样的方案还是根据自己实际情况来判断,但是聪明的企业在尝试数据库 on K8s 之后会带来极大的好处,例如选择了 Sealos + KubeBlocks 的组合,就相当于拥有了: + +1. 一个拥有8年以上经验的专业 K8s 团队。 +2. 一个 P10 带了一帮 P8-9 的顶尖专业数据库团队。 +3. 一个极友好的产品体验,鲁棒性极高,性能极高的数据库系统。 + +连招聘一个专家的成本都不到。当然这种选择一定有阻力,阻力大部分来自于企业内部那些想保住自己饭碗其实可以不太需要的人。 + +我本可以对冯老板的论调逐条反击,但是边看文章边写还是太累了,碎碎念这些,希望看看到底有多少人能有更高级点的认知,希望能听到更多支持 OR 反对我们的声音,一起探索真理~ \ No newline at end of file diff --git a/docs/blog/zh-Hans/2023/what-is-sealos.md b/docs/blog/zh-Hans/2023/what-is-sealos.md index f0502192fe8..09a81bd3cc7 100644 --- a/docs/blog/zh-Hans/2023/what-is-sealos.md +++ b/docs/blog/zh-Hans/2023/what-is-sealos.md @@ -5,7 +5,7 @@ description: 深入探讨 Sealos 的核心功能、技术特点、设计理念 authors: [fanux] tags: [Kubernetes, Sealos] keywords: [云操作系统, Sealos, K8s, 云原生, 云计算, 分布式, PaaS, Rancher, KubeSphere, 云服务] -image: https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-15-50-TKK1Ol.webp +image: https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-15-50-TKK1Ol.webp date: 2023-07-10T10:00 --- @@ -19,7 +19,7 @@ date: 2023-07-10T10:00 Sealos 在概念上类似于如 Windows 这样的操作系统,但有两个关键的不同点。首先,Sealos 不是在单个服务器上运行,它的核心理念是**将整个数据中心或跨多服务器的资源视为一个统一的整体**。这种方法突破了传统操作系统只在单一机器上运行的局限,将资源和应用管理扩展到了更大规模,能够**在整个数据中心范围内运行和管理应用**,从而大幅提升云资源的利用效率和运维能力。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-13-46-9Nel1a.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-13-46-9Nel1a.png) 与普通操作系统支持的 QQ、微信等日常应用不同,Sealos 专注于为开发者提供所需的分布式应用环境。在 Sealos 的世界里,**复杂的云计算任务变得像使用个人电脑一样简单直观**。无论是运行常见的 Web 服务如 Nginx,还是部署和管理各种编程语言编写的分布式应用,Sealos 都能一键完成,极大地减少了配置和管理的复杂性。它的设计哲学强调用户友好性和简洁性,致力于消除使用云服务时的技术壁垒,让每个用户都能轻松享受到云计算的强大能力。 @@ -45,7 +45,7 @@ Sealos 平台则完全遵循了操作系统的理念。它专注于用户所需 许多人对产品的理解仅限于其 GUI,但实际上,一个没有 API 的云服务产品对企业而言几乎无用。企业为了提高效率,需要打通和对接各种系统,这时 API 的重要性就显现出来了。云服务的设计往往不仅仅是为了人类用户,更多的是为了其他程序或系统,以实现企业操作的高度自动化。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-14-36-qnQmDa.jpg) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-14-36-qnQmDa.jpg) 具体来说,Sealos 提供的 API 与 K8s 的 CRD (Custom Resource Definitions,自定义资源定义) 设计完全兼容。用户可以通过 Sealos 的 API,以与操作 K8s 环境相同的方式来管理和控制他们的云资源。为了安全性,Sealos 为每个租户分配了权限受限的 kubeconfig 认证文件。这些文件允许租户在保证安全的前提下,灵活地对接和管理不同的系统和资源。 @@ -67,7 +67,7 @@ Sealos 平台则完全遵循了操作系统的理念。它专注于用户所需 Sealos 并不自己去设定标准,而是严格遵循成熟的体系和事实标准,这一策略确保了我们的服务与整个云原生生态系统的高度兼容。所有云原生应用均可在 Sealos 上安全运行,即便没有产品化的一些应用也可以通过 Sealos 的终端来运行。我们的兼容性建立在全面支持 K8s 的基础上,同时在安全性方面进行了加强。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-14-48-vbJezM.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-14-48-vbJezM.png) 在 Sealos 中,为了避免不当操作或不适当的镜像下载对整个系统造成灾难性影响,每位用户的权限被限制在其自身的命名空间内。这种权限管理机制加强了企业级[云操作系统](https://sealos.run)的安全性与稳定性。 @@ -81,13 +81,13 @@ Sealos 并不自己去设定标准,而是严格遵循成熟的体系和事实 为何选择放弃这一经典架构?原因在于,传统的分层模式已不再符合当前的技术发展和市场需求。以 IaaS 为例,它通过软件模拟数据中心中的路由器、交换机和虚拟机等硬件,虽然提高了调度的灵活性,但同时也导致软件成本急剧增加。以 OpenStack 为例,没有数十人的团队是难以维护其稳定性的,这直接导致了高昂的软件成本。过去,这种方式似乎是提高资源利用率的必要手段,但现在从应用的角度看,许多应用在运行时并不关心它们是否运行在独立的 VPC 中。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-15-00-2jC2C8.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-15-00-2jC2C8.png) 以上是我五年前画的一张图,现在逐渐变成了现实,这与单机操作系统的发展历程类似:最初是分层的,后来逐渐发展成为更高效的内核架构。云计算的分层架构同样携带着历史的包袱。一旦企业摒弃了 IaaS,它们就可以节省大量成本,并享受到更高的性能。 从这个新的视角出发,我们发现,实际上并不需要 IaaS。同时,从技术角度来看,PaaS 和 SaaS 本质上是相同的,它们都是应用层面的服务,因此也无需进行过度区分。在新的云内核架构中,我们只需要有效地实现多租户之间的隔离。这并不需要复杂重量级的解决方案。例如,Sealos 提供了一种在不可信公网环境中实现多租户共享一个 K8s 集群的方式。我们利用强隔离容器 (如 Firecracker)、网络策略 (如 Cilium) 以及存储块设备隔离 (如 OpenEBS) 来实现这一目标,不仅成本更低,效果也更好。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-15-02-6N4ygp.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-15-02-6N4ygp.png) #### 提高应用密度和调度效率 @@ -101,7 +101,7 @@ Sealos 并不自己去设定标准,而是严格遵循成熟的体系和事实 夜间企业的不活跃应用应该都去睡觉休息,把资源留给离线计算或者训练任务,这点其实用公有云更有优势,因为可以直接释放资源,节省大量成本。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-18-LIZ6Yt.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-18-LIZ6Yt.png) Sealos 直接把这一重要特性内置。如果企业所有应用都以这样的方式运行,可以节省巨量的成本。 @@ -115,7 +115,7 @@ Sealos 直接把这一重要特性内置。如果企业所有应用都以这样 要想杜绝资源浪费就需要这样精细化运营,Sealos 以极低的成本达到这个目的,企业管理者唯一要做的事就是给每个子账户分钱即可。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-18-ijXZ4y.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-18-ijXZ4y.png) 这样你可以精细化的控制到每个部门每个人用多少钱,从而进一步分析 ROI。 @@ -133,7 +133,7 @@ Sealos 的开发者花了不到一半精力维护整个云,8000 个应用时 我是一个研发,我至少 50% 以上的精力花在了研发之外的事上,那些杂事加起来可能有 20% 但是其影响可能是 80% 。它会割裂我正在做的事,比如你写完代码想着还要卖服务器,配置证书,打包,上线一想到这些我敢打赌没有哪个开发者喜欢做这些事,除非他是个变态。开发者是群懒人,为了偷懒开发出一大堆工具,这是偷懒者的胜利,sealos 也是一群偷懒者创造的,所以能自动绝不手动,能 AI 绝不人工。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-18-as6HSI.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-18-as6HSI.png) 自己分析问题多累,AI 比人还专业。 @@ -153,7 +153,7 @@ Sealos 对云计算的理解是深刻的: Sealos 设计之初就考虑到这一点,其实公有云与私有云本质是一样的,都是链接计算资源。很多人可能觉得不一样啊,公有云还有充值计费什么的,其实只需要把这些功能放到一个单独的应用中即可,这样在不需要的场景直接不安装这个应用。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-18-vMGZyu.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-18-vMGZyu.png) 但其实大一点的企业即便做私有云它的形态也应该和公有云一样,计量计费是非常重要的一个功能,企业超过 10 个人都需要精细化运营云资源,就更别说成千上万人的企业用私有云了,各部门的成本分摊等。 @@ -172,7 +172,7 @@ Sealos 选择一条非常有挑战的场景:在公网不可信的环境中让 我们解决了这个技术挑战,那不仅在公有云上为客户提供很大价值,在私有云场景就更轻松拿捏了。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-19-sJYA9X.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-19-sJYA9X.png) 从这张图中拆解 Sealos 的技术体系: @@ -192,7 +192,7 @@ Sealos 选择一条非常有挑战的场景:在公网不可信的环境中让 网络我们对计量和隔离的要求极高,而 calico 这些你懂的,隔离会使用大量的 iptables 规则,规模一大基本网络就不可用了,我们测试过 5000 条规则时压力测试一下就有 30% 的失败率。网络这块我们就引入了 cilium,通过 ebpf 来解决这这些问题,还有多租户的网络计量。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-19-REW9Fy.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-19-REW9Fy.png) 存储我们使用 openebs + lvm,为每个用户挂载独立隔离的卷,这样用户可以享受到本地磁盘的性能。而文件存储又变成一个大问题,nfs 这些几乎只是玩具,根本无法生产。所以我们世界冠军同学带队基于 rust 完全自研 sealfs 文件系统,架构超级精简,主打高性能,支持 RDMA。 @@ -249,7 +249,7 @@ Laf 直接集成 GPT4,大部分代码就不用你自己写了,我们训练 Laf AI 写代码,sealos 故障自动诊断,AI 自动上线应用,自动构建 Docker 镜像,这些统统靠 fastGPT 这个项目,自动帮你构建知识库。 -![](https://jsd.onmicrosoft.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-19-cCinq3.png) +![](https://jsd.cdn.zzko.cn/gh/yangchuansheng/imghosting-test@main/uPic/2023-11-17-16-19-cCinq3.png) ### 数据库/消息队列等应用