Skip to Content
在 Kubernetes 上管理云原生数据
book

在 Kubernetes 上管理云原生数据

by Jeff Carpenter, Patrick McFadin
May 2025
Beginner to intermediate
332 pages
4h 22m
Chinese
O'Reilly Media, Inc.
Content preview from 在 Kubernetes 上管理云原生数据

第 3 章:Kubernetes 上的数据库 Kubernetes 上数据库的艰难之路

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

正如我们在第 1 章中所讨论的,Kubernetes 是为无状态工作负载而设计的。由此推论,无状态工作负载是 Kubernetes 的强项。正因为如此,有些人认为,你不应该尝试在 Kubernetes 上运行有状态的工作负载,你可能会听到各种建议,告诉你应该怎么做:"使用托管服务",或者 "将数据留在企业内部数据中心的传统数据库中",甚至可能是 "在云中运行你的数据库,但用传统的虚拟机而不是容器"。

虽然这些建议仍然是可行的选择,但我们在本书中的主要目标之一是证明,在 Kubernetes 中运行数据基础架构已不仅是可行的选择,而且还是首选。克里斯托弗-布拉德福德(Christopher Bradford)在他的文章《一个曾经的怀疑论者Kubernetes 上数据库的论证》(A Case for Databases on Kubernetes from a Former Skeptic)中,描述了他从对在 Kubernetes 上运行任何有状态工作负载持怀疑态度,到勉强接受在 Kubernetes 上为开发和测试工作负载运行数据基础架构,再到在生产中围绕在 Kubernetes 上部署数据库热情布道的心路历程。这一历程是 Kubernetes 数据社区(DoKC)中许多人的典型经历。到 2020 年年中,Boris Kurktchiev 在他的文章《将有状态应用引入 Kubernetes 的3 个理由》中提到,越来越多的人认为在Kubernetes 上管理有状态工作负载已经达到了可行甚至成熟的程度

这种变化是如何产生的?在过去几年中,Kubernetes 社区已将重点转向添加支持在 Cloud 上以云原生方式管理状态的功能。存储元素代表了我们在上一章介绍的这种转变的一大部分,包括 Kubernetes PersistentVolume 子系统和 CSI 的采用。在本章中,我们将通过研究在此存储基础之上构建有状态应用的 Kubernetes 资源来完成这部分内容。我们将特别关注一种特定类型的有状态应用:数据基础架构。

艰难之路

"艰苦奋斗 "这个短语已被人们联想到避免选择简单的方式,而选择投入必要的细致工作,以取得具有持久意义的成果。纵观历史,众所周知,各行各业的先驱们都以牺牲血汗和泪水为荣,他们的牺牲让后人的生活变得更加美好。当他们的后辈无法理解他们所经历的苦难时,人们常常会听到这些长者发出这样的感叹。

在技术领域也不例外。虽然应用程序接口和"无代码 "环境等新的创新技术具有巨大的潜力,可以在全球范围内培养一批新的开发人员,但要在全球范围内管理高度可用和安全的系统,仍然需要对底层技术有更深入的了解。当出现问题时,这些详细的知识才能证明其价值。这就是为什么我们中的许多软件开发人员在日常工作中从未接触过物理服务器,却能通过手工接线芯片和电路板来构建自己的个人电脑,并从中获益良多。这也是我们为亲朋好友担任非正式 IT 顾问的隐性好处之一

当然,对于 Kubernetes 社区来说,"艰苦的方式 "还有更具体的含义。谷歌工程师凯尔西-海托尔(Kelsey Hightower)的"Kubernetes the Hard Way "已经成为那些想深入了解 Kubernetes 集群组成要素的人的必修课程。这本广受欢迎的教程指导你下载、安装和配置构成 Kubernetes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

《使用 Kubernetes 实现云原生 DevOps(第二版)》

《使用 Kubernetes 实现云原生 DevOps(第二版)》

Justin Domingus, John Arundel
生产 Kubernetes

生产 Kubernetes

Josh Rosso, Rich Lander, Alex Brand, John Harris

Publisher Resources

ISBN: 9798341659667