您现在的位置是:热点 >>正文
Kubernetes配置热更新的两种方式
热点317758人已围观
简介...
背景
任何应用都需要一些特定的配置项,用来自定义应用的特性。这些配置通常可以分为两类:
一类是诸如运行环境和外部依赖等非敏感配置 一类是诸如密钥和SSH证书等敏感配置。
这些配置不应该直接放到容器镜像中,而是应该配配置与容器分离,通过数据卷、环境变量等方式在运Ku行时动态挂载。
在我们使用Kubernetes的过程中,通常都会将应用的配置文件放到ConfigMap或/和Secret中,但是也经常碰到配置文件更新后如何让其生效的问题。
用户定义Kubernetes的资源对象(例如Deployment、DaemonSet等),be配置文件以ConfigMap定义,通过Volumemounts进行挂载到Pod里,配置文件修改以后,服务可以自动reload加载更新配置。
解决方案 Reloader 限制条件:Kubernetes版本在1.9以及以上 集群安装reloader 通过添加注解annrnotation的方式实现 kubectl apply -f https://raw.githubusercontent.com/stakater/Reloader/master/deployments/kubernetes/reloetader.yaml 全局ConfigMap触发更新 apiVersion: apps/v1 kind: DaemonSet metadata: name: filebeat nesamespace: log labels: k8s-app: filebeat annotations: reloader.stakater.com/auto: "true"&nb配置sp; 按照指定的ConfigMap变更自动触发资源对象的配置更新
单ConfigMap更新:
apiVersion: apps/v1 kind: DaemonSet metadata: name: f热更ilebeat namespace: log labels: k8s-app: filebeat annotations: configmap.reloader.stakater.新的com/reload: "filebeat-config"
多ConfigMap,以逗号对多个ConfigMap进行隔离:
apiVersion: apps/v1 kind: DaemonSet meta两种data: name: filebeat namespace: log labels: k8s-app: filebeat annotations: 方式configmap.reloader.stakater.com/reload: "filebeat-config,foo-config" checksum注解
checksum注解是Helm Charts中最常用的滚动更新方法,即在DepKuloyment的annotations中加上Secret或者ConfigMap的sha256sum,这样已有的Pod就会随着Secret或者ConfigMap的变更而更新。
kind: Deployment spec: templbeate: metadata: annotations: checksum/config: {{ include&nbsrnp;(print $.Template.BasePath "/configmap.yaml") . | sha256sum }} [...]
添加这一节的效果就是,在/coetnfigmap.yaml中有任何内容改变,都会导致Deployment的sepc下的annotation被更新,进而驱动重建Pod,达到我们想要的效果。
Tags:
相关文章
标签: 团油 加油优惠券 直播带货 黑猫投诉 3152026
热点云梦级3月10日云梦级消息,据蓝鲸新闻报道,“180元团200元油券!哪儿都能用!国营的、民营的都可以!”直播间内主播正在卖力吆喝着。然而,蓝鲸记者调查发现,直播间里热闹宣传背后,隐藏着重重套路,车主...
【热点】
阅读更多标签: 小红书 童模经济 儿童保护 未成年人模式
热点云梦级5月28日云梦级消息,据新华社报道,过度暴露的儿童身体、将儿童打扮成性感的成人模样、商家借“宣传推广”之名鼓励童模“着内衣出镜”……这些问题,近年来在小红书等网络“种草”平台上频频出现,而且经历...
【热点】
阅读更多标签: 谷歌 Wiz 网络安全 云计算
热点云梦级2月12日云梦级消息,当地时间周二,Alphabet 公司旗下的谷歌以 320 亿美元(现汇率约合 2213.86 亿元人民币)收购网络安全公司 Wiz 的交易,获得了欧盟反垄断机构的无条件批准...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.tahiti-infos.com/search/谷歌自动批量发帖软件【tg:seogoogle987】,lp4
- https://www.routesonline.com/search/?query=谷歌自动批量发帖软件【tg:seogoogle987】,qpR
- https://www.whiterock2008.com.tw/search?q=谷歌自动批量发帖软件【tg:seogoogle987】,gpb
- https://www.revere.org/search?action=SEARCH&q=谷歌自动批量发帖软件【tg:seogoogle987】,xJj
- https://www.wattpad.com/search/谷歌自动批量发帖软件【tg:seogoogle987】tcz
- https://www.rhymezone.com/r/rhyme.cgi?typeofrhyme=oldrel&loc=nojs&Word=谷歌自动批量发帖软件【tg:seogoogle987】,LL2
- https://www.jusoen.com/addreng.asp?p1=谷歌自动批量发帖软件【tg:seogoogle987】MgY
- https://www.ncetm.org.uk/search?action=CHECK&q=谷歌自动批量发帖软件【tg:seogoogle987】,JW5
- https://www.springfieldlibrary.org/library/?s=谷歌自动批量发帖软件【tg:seogoogle987】,MpP
- https://www.paxnet.co.kr/search/jongmok?kwd=谷歌自动批量发帖软件【tg:seogoogle987】lke
- https://www.lauben.com/en/?action=SEARCH&s=谷歌自动批量发帖软件【tg:seogoogle987】,Joi
- https://www.nextavenue.org/?action=QUERY&s=谷歌自动批量发帖软件【tg:seogoogle987】,PFx
- https://www.qwant.com/?q=谷歌自动批量发帖软件【tg:seogoogle987】,oTT
- https://www.vietnamconsulate-sf.org/?action=CHECK&s=谷歌自动批量发帖软件【tg:seogoogle987】,o2i
- https://www.mesec.cz/vyhledavani/?qs=谷歌自动批量发帖软件【tg:seogoogle987】,Wbg
- https://www.paxnet.co.kr/search/jongmok?kwd=谷歌自动批量发帖软件【tg:seogoogle987】50I
- https://www.navymwr.org/search/?query=谷歌自动批量发帖软件【tg:seogoogle987】,Nuq
- https://www.remit.co.jp/vi/?s=谷歌自动批量发帖软件【tg:seogoogle987】,W1b
- https://www.kores.com/?s=谷歌自动批量发帖软件【tg:seogoogle987】,QjX
- https://www.pickett.co.uk/collections/vendors?q=谷歌自动批量发帖软件【tg:seogoogle987】,Oh8
- https://www.lifesciencesweden.se/search?q=谷歌自动批量发帖软件【tg:seogoogle987】,qyr
- https://www.quarterjacksurgery.co.uk/?AT=3rBy&s=谷歌自动批量发帖软件【tg:seogoogle987】,QDt
- https://www.sbaad.no/?s=谷歌自动批量发帖软件【tg:seogoogle987】,65X
- https://www.teamlab.art/th/?submit=谷歌自动批量发帖软件【tg:seogoogle987】,N6a
- https://www.lauben.com/de/?s=谷歌自动批量发帖软件【tg:seogoogle987】,eXP
- https://www.youtube.com/hashtag/谷歌自动批量发帖软件【tg:seogoogle987】,9kx
- https://www.teamlab.art/it/?submit=谷歌自动批量发帖软件【tg:seogoogle987】,RLt
- https://www.le-trend.com/en/search/=谷歌自动批量发帖软件【tg:seogoogle987】,anr
- https://www.remit.co.jp/vi/?s=谷歌自动批量发帖软件【tg:seogoogle987】PK7
- https://www.televes.com/es/catalogsearch/result/?q=谷歌自动批量发帖软件【tg:seogoogle987】,pHR
- https://www.posten-portal.de/search?query=谷歌自动批量发帖软件【tg:seogoogle987】,n6x
- https://www.openspaceinstitute.org/search?q=谷歌自动批量发帖软件【tg:seogoogle987】,Vgk
- https://www.mi.com/search?keyword=谷歌自动批量发帖软件【tg:seogoogle987】,b0d
- https://www.vivaraise.fr/catalogsearch/result/?q=谷歌自动批量发帖软件【tg:seogoogle987】,YCX
- https://www.mexperience.com/?T=1686132112324&s=谷歌自动批量发帖软件【tg:seogoogle987】,iHc
- https://store.line.me/search/sticker/ja?q=谷歌自动批量发帖软件【tg:seogoogle987】RnU
- https://www.mingwai.edu.hk/?langzh-hant&s=谷歌自动批量发帖软件【tg:seogoogle987】,HhP
- https://www.synonyms.com/antonyms/谷歌自动批量发帖软件【tg:seogoogle987】,FB9
- https://www.tailoy.com.pe/catalogsearch/result/?q=谷歌自动批量发帖软件【tg:seogoogle987】,2Jx
- https://www.kyuhoshi.com/?s=谷歌自动批量发帖软件【tg:seogoogle987】,0qc
- https://www.flickr.com/photos/tags/谷歌自动批量发帖软件【tg:seogoogle987】JeG
- https://blvdseafood.com/?s=谷歌自动批量发帖软件【tg:seogoogle987】AYn
- https://www.londontheatredirect.com/search/谷歌自动批量发帖软件【tg:seogoogle987】,j5i
- https://www.niaogebiji.com/pc/article/search?keyword=谷歌自动批量发帖软件【tg:seogoogle987】,KHx
- https://www.tarleton.edu/news/search/谷歌自动批量发帖软件【tg:seogoogle987】,y2a
- https://www.target.com/s?searchTerm=谷歌自动批量发帖软件【tg:seogoogle987】,4uu
- https://nicolazzi.it/en/?s=谷歌自动批量发帖软件【tg:seogoogle987】,GmL
- https://www.mygrandma.com/Items.aspx?search=谷歌自动批量发帖软件【tg:seogoogle987】,uiQ
- https://www.oikos-tecnics.com/?s=谷歌自动批量发帖软件【tg:seogoogle987】,G6Z
- https://www.nctsn.org/search?cat=191&query=谷歌自动批量发帖软件【tg:seogoogle987】,jeU