您现在的位置是:热点 >>正文
Kubernetes配置热更新的两种方式
热点449人已围观
简介...
背景
任何应用都需要一些特定的配置项,用来自定义应用的特性。这些配置通常可以分为两类:
一类是诸如运行环境和外部依赖等非敏感配置 一类是诸如密钥和SSH证书等敏感配置。
这些配置不应该直接放到容器镜像中,而是应该配配置与容器分离,通过数据卷、环境变量等方式在运Ku行时动态挂载。
在我们使用Kubernetes的过程中,通常都会将应用的配置文件放到ConfigMap或/和Secret中,但是也经常碰到配置文件更新后如何让其生效的问题。
用户定义Kubernetes的资源对象(例如Deployment、DaemonSet等be),配置文件以ConfigMap定义,通过Volumemounts进行挂载到Pod里,配置文件修改以后,服务可以自动reload加载更新配置。
解决方案 Reloader 限制条件:Kubernetes版本在1.9以及以上 集群安装reloader 通过添加注解rnannotation的方式实现 kubectl apply -f https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetetes/reloader.yaml 全局ConfigMap触发更新 apiVersion: apps/v1 kind: DaemonSet metadata: name: filebeat&nbsesp;namespace: log labels: k8s-app: filebeat annotations: reloader.stakater.com/auto: "t配置rue" 按照指定的ConfigMap变更自动触发资源对象的配置更新
单ConfigMap更新:
apiVersion: apps/v1 kind: DaemonSet metadata: name:热更 filebeat namespace: log labels: k8s-app: filebeat annotations: configmap.reload新的er.stakater.com/reload: "filebeat-config"
多ConfigMap,以逗号对多个ConfigMap进行隔离:
apiVersion: apps/v1 kind: Daemon两种Set metadata: name: filebeat namespace: log labels: k8s-app: filebeat annot方式ations: configmap.reloader.stakater.com/reload: "filebeat-config,foo-config" checksum注解
checksum注解是Helm Charts中最常用的Ku滚动更新方法,即在Deployment的annotations中加上Secret或者ConfigMap的sha256sum,这样已有的Pod就会随着Secret或者ConfigMap的变更而更新。
kind: Deployment spbeec: template: metadata: annotations: checksum/config: {{rn include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} [...]&nbsetp;
添加这一节的效果就是,在/configmap.yaml中有任何内容改变,都会导致Deployment的sepc下的annotation被更新,进而驱动重建Pod,达到我们想要的效果。
Tags:
相关文章
云安全日报220628:Ubuntu Linux内核发现系统崩溃漏洞,需要尽快升级
热点Ubuntu是一个以桌面应用为主的Linux操作系统。它是一个开放源代码的自由软件,提供了一个健壮、功能丰富的计算环境,既适合家庭使用又适用于商业环境。Ubuntu为全球数百个公司提供商业支持。 6月...
【热点】
阅读更多Claude 现已在 Slack 中上线,助力团队协作
热点AI 助手 Claude 正式在 Slack 平台上推出,用户可以通过私信与 Claude 进行对话,或在讨论中标记 @Claude,利用 AI 助手面板进行互动。这一功能不仅为用户提供了网络搜索和文...
【热点】
阅读更多亚马逊云科技Marketplace大幅下调上架费用
热点2月27日消息,亚马逊云科技Marketplace正在不断简化上架费体系,降低上架费用,为合作伙伴提供更具吸引力的激励措施,帮助其更好地销售软件。 据介绍,自2024年1月起,亚马逊云科技Market...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.parriscues.com/catalogsearch/result/?q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,g28
- https://www.teamlab.art/fr/?submit=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,Wpn
- https://www.vocabulary.com/dictionary/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,dAp
- https://www.losgatoschamber.com/list/search?action=SEARCH&q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,6xY
- https://www.skicheck.at/en/?action=CHECK&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,7TI
- https://www.navylookout.com/?ID=nSBR6Ivdu6lZg1yr2SDs30Lo5sTs76yJ&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,kHf
- https://www.teamlab.art/it/?submit=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,EZy
- https://www.nytimes.com/search?dropmab=true&query=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,PAc
- https://www.lauben.com/en/?action=SEARCH&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,TX5
- https://www.nyif.com/catalogsearch/result/?q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,ga8
- https://www.lgnewsroom.com/search/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,FYy
- https://www.metaltix.com/?view=tours&filter=search&q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,QrC
- https://www.metalmensales.com/?action=QUERY&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,YXS
- https://www.tahiti-infos.com/search/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,UAw
- https://www2.ual.es/ProyectoLates/?s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,Rsb
- https://www.kaskus.co.id/search?q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,GJb
- https://www.yidian51.com/taobao/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,CFB
- https://www.ncetm.org.uk/search?action=CHECK&q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,sHX
- https://www.revere.org/search?action=SEARCH&q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,SfE
- https://www.tarleton.edu/?s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,i9Q
- https://www.rollingstone.it/?ID=DVMeu3AlmzZE1cuJ2FmgmO5TSCQRb3yh&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,SqU
- https://www.remit.co.jp/pt/?action=CHECK&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,BVQ
- https://www.madebyoranges.com/nl/search/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,8Ay
- https://www.abbreviations.com/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】IoW
- https://www.londontheatredirect.com/search/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,kID
- https://www.laoairlines.com/?action=QUERY&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,RnY
- https://www.impactpool.org/search/?type=79&q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】CKw
- https://www.takachi-enclosure.com/search?eqYB=gnI31Ou&text=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,DI2
- https://www.scq.ubc.ca/?page=2&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,ODD
- https://www.lenovo.com/gb/en/search?action=SEARCH&text=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,UJ1
- https://www.olx.ba/pretraga?trazilica=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,zON
- https://www.mi.com/search?keyword=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,R1e
- https://www.teamlab.art/pt/?submit=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,xld
- https://www.smarty.net/search?q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,0kv
- https://www.safetv.go.kr/base/search/view?searchWord=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】JSS
- https://www.signingsavvy.com/sentence/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,7T8
- https://www.temu.com/search_result.html?search_key=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】dSp
- https://www.paxnet.co.kr/search/jongmok?kwd=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】pJj
- https://www.nuovabai.it/catalogsearch/result/?action=SEARCH&q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,hKn
- https://www.varian.com/en-au/search?cat=113&search=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,Z6o
- https://www.mingwai.edu.hk/?langzh-hant&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,zNK
- https://www.localfootdoc.com/?s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,6M2
- https://www.lssystems.co.uk/search?page=0&per_page=24&term=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,FW3
- https://www.synonyms.com/antonyms/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,SnI
- https://www.rookwinkel.nl/catalogsearch/result/index/?q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,nSn
- https://www.rotherham.gov.uk/site-search/results/?q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,i9U
- https://www.tmtpost.com/search?q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,ANK
- https://www.normani.de/search?q=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,Egn
- https://www.xvideos.com/tags/谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,OXT
- https://www.lneg.pt/?cat=140&s=谷歌霸屏24小时见效-实现思路【tg:seogoogle987】,49Y