惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Schneier on Security
A
Arctic Wolf
Scott Helme
Scott Helme
S
Securelist
Schneier on Security
Schneier on Security
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
Security Latest
Security Latest
Project Zero
Project Zero
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Google DeepMind News
Google DeepMind News
P
Proofpoint News Feed
C
Check Point Blog
F
Full Disclosure
Stack Overflow Blog
Stack Overflow Blog
H
Hacker News: Front Page
T
The Blog of Author Tim Ferriss
TaoSecurity Blog
TaoSecurity Blog
Vercel News
Vercel News
A
About on SuperTechFans
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The GitHub Blog
The GitHub Blog
S
Security Affairs
Y
Y Combinator Blog
T
The Exploit Database - CXSecurity.com
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Forbes - Security
Forbes - Security
IT之家
IT之家
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
F
Fortinet All Blogs
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
Jina AI
Jina AI
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
K
Kaspersky official blog
Hacker News: Ask HN
Hacker News: Ask HN
C
Cisco Blogs
MyScale Blog
MyScale Blog
博客园 - 【当耐特】
T
Threat Research - Cisco Blogs
D
Docker
G
GRAHAM CLULEY

博客园 - 散尽浮华

Rancher 证书到期问题处理手册 Rancher部署并导入K8S集群 K8S集群灾备环境部署 K8S容器环境下GitLab-CI和GItLab Runner 部署记录 K8S持久化存储PV、PVC笔记 K8S部署ES集群 - 运维笔记 容器和镜像转化、迁移方式 - 运维小结 K8S部署RabbitMQ集群 (镜像模式) - 部署笔记 Node节点禁止调度(平滑维护)方式- cordon,drain,delete K8S中NodePort端口范围修改 Centos7.4升级到Centos7.7 K8S部署Redis Cluster集群(三主三从模式) - 部署笔记 K8S部署Nacos集群 - 部署笔记 K8S部署Kafka界面管理工具(kafkamanager) K8S部署Kafka集群 - 部署笔记 K8S部署RocketMQ集群(双主双从+同步模式) - 部署笔记 Nginx流量拷贝 - 运维笔记 Nginx基于站点目录和文件的URL访问控制 - 配置笔记 Nginx禁止ip访问或非法域名访问 - 配置笔记
Pod滚动重启方法 - 运维笔记
散尽浮华 · 2021-02-18 · via 博客园 - 散尽浮华

在kubernetes中滚动重启pod常用方法:

一、直接修改pod的yaml部署文件,apply滚动更新(基于yaml文件)
通过 "kubectl apply -f *.yaml" 命令触发pod的滚动更新。前提是pod的yaml部署文件内容必须是有所更新的,否则执行kubectl apply命令不会触发pod的滚动更新。

二、通过set image命令滚动更新(基于image镜像)
如果不想直接修改pod的yaml文件内容,就通过 "kubectl set image deployment deployment_name pod_name=new_image_name" 命令来滚动更新重启pod。

三、rollout restart方式滚动更新
1)在 k8s v1.15 版本之前,通过修改 annotations 的变量值可实现滚动重启 Pod ,当然这个方法其实更改了 yaml 文件,不过是更改的自定义变量字段通过时间戳的方式来设置值,一般不会对 Pod 主要内容有影响:

# kubectl patch deployment web -p \
  "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"date\":\"`date +'%s'`\"}}}}}"

2)在 k8s v1.15 版本之后,通过 kubectl rollout restart 命令来滚动重启pod:

# kubectl rollout restart deployment your_deployment_name