Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 目前使用pod patch会有问题 #1

Open
googs1025 opened this issue Apr 25, 2023 · 1 comment
Open

fix: 目前使用pod patch会有问题 #1

googs1025 opened this issue Apr 25, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@googs1025
Copy link
Member

本来设计方案想预先启动一个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

@googs1025
Copy link
Member Author

已经使用patch deployment 修改

@googs1025 googs1025 added the bug Something isn't working label Apr 27, 2023
@googs1025 googs1025 self-assigned this Apr 27, 2023
@googs1025 googs1025 removed their assignment Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant