当前位置:网站首页>Simple integration of client go gin -update
Simple integration of client go gin -update
2022-06-22 17:18:00 【51CTO】
background
It's done client-go gin Simple integration of nine -Create Of namespace deployment pod Of Create operation , Now let's go update Modified operation !
update namespace
With a ns For example, add a label
About namespace, The labels we use most are name and labels( Well, I also did an example of quotas , Here is a simple way to take labels For example )
If you go update modify namespace What we usually use is to modify namespace Of labels, With zhangpeng namespace For example , I want to add one name=abcd The label of
/src/service/Namespace.go
establish updatenamespace Method UpdateNameSpace service
main.go Create route :
function main.go
Postman test
post http://127.0.0.1:8080/namespace/update


modify name Labels are other values
post http://127.0.0.1:8080/namespace/update

Other things you can play : Extend the resourcequotas, You can refer to this quota Configuration of , There is no need to demonstrate it first !
update pod?
pod Whether it can be or not? update Update ?
pod Whether it can be or not? update Update ? The answer is No …
notes :pod It's a container Life cycle , Theoretically, it cannot be renewed , And in general pod Is based on deployment or rs Etc. control management pod Of , Modification means the end of the life cycle and the new pod The birth of , Of course, it can be based on openkruise Other application implementations of pod Upgrade in place !
Draw ladles according to gourds , Experience mistakes
/src/service/Pod.go
notes : imitation deployment create Written … Anyway, the result is failure , Just go through the process ! The following are to be deleted …
main.go Add the following configuration :
function main.go postman test :
Okay That's about it Just to demonstrate , Take a closer look at pod Life cycle , Of course, you can also study the methods of upgrading in place openkruise It's pretty good !
update deployment
initial deployment For the next
The key word is :
Write program files
/src/service/Deployment.go
Be careful : Basically, take the front one deployment create The method of …
Add routing operation main.go
main.go Add routes and run main.go

Postman test
Change the copy to 2
http://127.0.0.1:8080/deployment/update

Modify the mirror tag
I began to think about modifying nginx by nginx:1.18 And it failed …
Estimation is images The problem of data format , Ignore it first … Second, change the image to apache Mirror image ( Note that mirroring is httpd)
http://127.0.0.1:8080/deployment/update

Log in to the server to verify :
summary :
1.Pod Life cycle
2.update And create The comparison was modified update metav1.UpdateOptions{}
3. mirrored tag See how to solve the label problem later
边栏推荐
- [mysql] data synchronization prompt: specified key was too long; max key length is 767 bytes
- 团队管理|如何提高技术 Leader 的思考技巧?
- client-go gin的简单整合十-Update
- Processing source code of spark executor execution results
- High availability ResourceManager
- 社会担当 广汽本田“梦想童行”倡导儿童道路交通安全
- Blazor University (30)表单 —— 从 InputBase 派生
- Scala for derivation: the ability to define a value in the first part of a for expression and use it in subsequent (outer) expressions
- WPF achieves star effect
- Quickly master asp Net authentication framework identity - login and logout
猜你喜欢
数据库mysql 主从方案

NLog自定义Target之MQTT

Hello Playwright:(7)模拟键盘和鼠标

You call this crap high availability?

视频会议时听不到声音该如何处理?

JMeter use case

每秒處理10萬高並發訂單的樂視集團支付系統架構分享

UI automation positioning edge -xpath actual combat

In the era of video explosion, who is supporting the high-speed operation of video ecological network?

WPF effect chapter 190: playing listbox again
随机推荐
Linux system maintenance: mysql8.0.13 source code download and installation "fool" operation steps (Linux centos6.8) test available series
On the closure function of Scala
Partage de l'architecture du système de paiement du Groupe letv pour traiter 100 000 commandes simultanées élevées par seconde
Seeing the big from the small: a simple example of domain modeling, understanding "domain driven".
WPF 实现星空效果
[psychology] emotional psychology - collision between contemporary thoughts and traditional thoughts (this article will be continuously updated from time to time)
Blazor University (30) form - derived from inputbase
Source code analysis of spark cache
网传学习通1.7亿密码泄露!有什么补救措施?
同花顺软件是什么?手机开户安全么?
同花顺是什么?在线开户安全么?
[step 1 of advanced automated testing] 1 minute to introduce you to automated testing
可能是全网最全的Matplotlib可视化教程
Mysql-5.6.21-centos6.5 source code installation configuration
Scala for derivation: the ability to define a value in the first part of a for expression and use it in subsequent (outer) expressions
Analysis of the writer source code of spark shuffle
vs2017 在调试状态不显示QString值的解决方法
数据库mysql 主从方案
Huawei cloud recruits partners in the field of industrial intelligence to provide strong support + commercial realization
Review the executor from the perspective of application submission