- 快召唤伙伴们来围观吧
- 微博 QQ QQ空间 贴吧
- 文档嵌入链接
- 复制
- 微信扫一扫分享
- 已成功复制到剪贴板
用于 Kubernetes 迭代开发的 Rust 和 Skaffold
展开查看详情
1 .Rust and Skaffold for Iterative Development on Kubernetes
2 .宋子豪 Gilbert Song Staff Software Engineer ● Apache Mesos PMC/Committer ● Leading Containerization at Mesosphere ● Twitter: @gilbert_songs
3 .Gastón Kleiman Staff Software Engineer ● Apache Mesos PMC/Committer ● Resource Management Tech Lead at Mesosphere ● Previously at AWS OpsWorks ● Twitter: @kleimang
4 .Outline Modern development techniques Iterative Development CI/CD Immutable infrastructure + Containers Challenges Tools Rust, Kubernetes, Skaffold Demo 4
5 .Continuous/Iterative Development • Design, develop, and test in repeated cycles • Testing a new iteration must be quick & cheap 5
6 .Continuous Integration/Continuous Deployment • Automated testing as well as deployment of a web application • Containers make it possible to replicate the same environment during development and in production 6
7 .Pets -> Cattle -> Immutable Infrastructure 7
8 .Challenges • Building, pushing, and deploying isn’t easy • Giant binaries/containers • Applications need to be safe (concurrency + memory safety) 8
9 .Rust • Created at Mozilla as a “safe, concurrent, practical language” • Low-level (static) language, performance similar to C++ • Strong emphasis on safety, control of the memory layout, concurrency • Great & friendly community 9
10 .Challenges with Rust • Relatively young language • Brings extra safety, but you have to pay some upfront price • Many engineers are new to it; successfully integrating it into your stack can cost significant engineering time 10
11 .Kubernetes • Orchestrates containers across many different machines… or on your local dev machine • Enables you to use immutable infrastructure • Useful abstractions/tools to easily deploy or scale services • DC/OS Multi-Kubernetes-Engine 11
12 .Skaffold • CLI tool that facilitates iterative development for Kubernetes applications • Handles the workflow for building, pushing, and deploying an application • Can be used to iterate on an application source code locally then deploy to local or remote Kubernetes clusters 12
13 .Skaffold Build Push Deploy
14 .Skaffold (Local) Build Push Deploy Local Docker None Minikube Daemon 14
15 .Skaffold (Remote) Build Push Deploy Google Docker Registry Container MKE on DC/OS on DC/OS Builder 15
16 .Using Skaffold No need to have each new developer spend days setting up a new dev environment 1. Create k8s manifests (pod specs, ingress settings, etc) 2. Tell skaffold via skaffold.yaml how to build and deploy the application 3. Use “skaffold dev” on your local machine to deploy to a minikube cluster 4. Make your CI/CD pipeline run “skaffold run” when new code is checked-in 16
17 .Demo Flow Skaffold Save Trigger Build Push Deploy Push 17
18 .Demo 18
19 .Future Work • Make the service highly-available: • Use an HA posgres setup • Zero-downtime deployments • Utilize more of the dependencies’ capabilities and increase efficiency: • Use connection pools for Diesel • Use Rocket managed state 19
20 .Resources • Mesosphere Kubernetes Engine (MKE) - https://mesosphere.com/product/kubernetes-engine/ • https://github.com/shaneutt/dcos-k8s-rust-skaffold-demo 20
21 .Special Thanks Shane Utt Jörg Schad 21
22 . THANK YOU! ANY QUESTIONS? https://mesosphere.com/resources/running-kubernet es-oreilly-ebook/ © 2018 Mesosphere, Inc. All Rights Reserved. 22
23 . Make it insanely easy to build and scale world-changing technology CONFIDENTIAL