华为云对Kubernetes在Serverless Container产品落地中的实践经验

华为云容器实例服务,它基于 Kubernetes 打造,对最终用户直接提供 K8S 的 API。正如前面所说,它最大的优点是用户可以围绕 K8S 直接定义运行应用。

这里值得一提是,我们采用了全物理机的方案,对于端到端资源利用率有一个很大的提升。而在 K8S 之上我们通过一层封装实现了超规模资源池。大家知道 K8S 现开源的版本最大只能支持到5000节点,并且这是在 Google 云上的验证结果,而在很多其他的云平台往往达不到。主要是受限于底层网络和存储系统。

所以在华为云,我们的做法是通过一层封装和引入Federation来获得整体服务的超大规模。同时因为 K8S 原生多租能力非常有限,所以我们选择将额外基于租户的验证、多租限流等工作放在这一层封装中实现。但对于应用定义等接口,则是直接透传 K8S原生的API数据,只是在调用过程中增加如请求合法性等的校验。图中右侧的容器网络、容器存储,现有的开源方案是无法满足的,所以华为云采用自研的策略。

租户概念和网络隔离

前面已经讲过,K8S 原生并没有租户概念,只有一层以 Namespace 为边界的隔离。在 Namespace 这一层,除了API对象的可见性隔离,K8S 还提供了 Resource Quota(资源总和限制)以及 Limit Range(定义每个Pod、Container能使用的资源范围)等精细的配额管理能力。而在华为云上,我们设计的租户模型是:租户(用户)、项目、Namespace 三层模型,方便用户管理多个项目的开发、测试、生产等不同阶段。

网络隔离方面,采用多网络模型,一个项目中可以定义多个VPC,VPC 和 Namespace 是一对多的关系。用户可以结合实际需要将开发、测试阶段的应用部署在同个 VPC 的不同 Namespace 中便于调试和问题定位,生产环境部署在拥有单独 VPC 的 Namespace 保证不受其他活动干扰。

Runtime安全与隔离

再看 Runtime,由于是全物理机的模式,节点被不同的租户共享,普通docker容器无法满足Pod间的隔离性要求,Runtime采用的是安全容器(即早期的run

Packt.Kubernetes.for.Serverless.Applications.1788620372.PDF Chapter 1, The Serverless Landscape, explains what is meant by serverless. Also, we will get some practical experience of running serverless functions on public clouds using AWS Lambda and Azure Functions. Chapter 2, An Introduction to Kubernetes, discusses what Kubernetes is, what problems it solves, and also takes a look at its backstory, from internal engineering tool at Google to an open source powerhouse. Chapter 3, Installing Kubernetes Locally, explains how to get hands-on experience with Kubernetes. We will install a local single node Kubernetes cluster using Minikube and interact with it using the command-line client. Chapter 4, Introducing Kubeless Functioning, explains how to launch your first serverless function using Kubeless once the Kubernetes is up and running locally. Chapter 5, Using Funktion for Serverless Applications, explains the use of Funktion for a slightly different take on calling serverless functions. Chapter 6, Installing Kubernetes in the Cloud, covers launching a cluster in DigitalOcean, AWS, Google Cloud, and Microsoft Azure after getting some hands-on experience using Kubernetes locally. Chapter 7, Apache OpenWhisk and Kubernetes, explains how to launch, configure, and use Apache OpenWhisk, the serverless platform originally developed by IBM, using our newly launched cloud Kubernetes cluster. Chapter 8, Launching Applications Using Fission, covers the deploying of Fission, the popular serverless framework for Kubernetes, along with a few example functions. Chapter 9, Looking at OpenFaaS, covers OpenFaaS. While it's, first and foremost, a Functions as a Service framework for Docker, it is also possible to deploy it on top of Kubernetes. Chapter 10, Serverless Considerations, discusses security best practices along with how you can monitor your Kubernetes cluster. Chapter 11, Running Serverless Workloads, explains how quickly the Kubernetes ecosystem is evolving and how you can keep up. We also discuss which tools you should use, and why you would want your serverless functions on Kubernetes.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值