operator-learning-playground / poddeployer-operator Goto Github PK
View Code? Open in Web Editor NEW基于k8s-operator实现deployment的容器按照权重顺序启动
基于k8s-operator实现deployment的容器按照权重顺序启动
目前deployment patch 会顺序拉起不同的容器,但是因为是patch操作,如果有四个容器要按照权重执行,就会滚动跟新四次,意味著deploy会重新调度四次,是个烂方法。。。。
本来设计方案想预先启动一个deployment后,对其中的pod 都做原地升级,但是这个会报错,k8s内部原地升级仅支持替换replace,不支持add操作。
I0425 21:31:11.520742 43109 resource.go:67] CreateOrUpdateDeploymentupdated
I0425 21:31:11.520769 43109 controller.go:55] do patch image to pods...
I0425 21:31:41.773783 43109 controller.go:59] 1
I0425 21:31:41.773852 43109 controller.go:60] [{example2 nginx:1.14.2 [] [] [{ 0 80 }] [] [] {map[] map[] []} [] [] nil nil nil nil nil false false false}]
I0425 21:31:41.773945 43109 resource.go:127] do patch....
[{"op":"add","path":"/spec/containers/-","value":{"name":"example2","image":"nginx:1.14.2","ports":[{"containerPort":80}],"resources":{}}}]
E0425 21:31:41.828893 43109 resource.go:162] patch error: Pod "mypoddeployer-57d89dd79-rlblw" is invalid: spec.containers: Forbidden: pod updates may not add or remove containers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.