#DaemonSet 实现 pod 的滚动更新
#查看 daemonset 的滚动更新策略
[root@k8smaster ds]# kubectl explain ds.spec.updateStrategy
KIND: DaemonSet
VERSION: apps/v1
RESOURCE: updateStrategy
DESCRIPTION:
An update strategy to replace existing DaemonSet pods with new pods.
DaemonSetUpdateStrategy is a struct used to control the update strategy for
a DaemonSet.
FIELDS:
rollingUpdate
Rolling update config params. Present only if type = "RollingUpdate".
type
Type of daemon set update. Can be "RollingUpdate" or "OnDelete". Default is
RollingUpdate.
#查看 rollingUpdate 支持的更新策略
[root@k8smaster ds]# kubectl explain ds.spec.updateStrategy.rollingUpdate
KIND: DaemonSet
VERSION: apps/v1
RESOURCE: rollingUpdate
DESCRIPTION:
Rolling update config params. Present only if type = "RollingUpdate".
Spec to control the desired behavior of daemon set rolling update.
FIELDS:
maxUnavailable
#上面表示 rollingUpdate 更新策略只支持 maxUnavailabe,先删除在更新;因为我们不支持一个节点运行两个 pod,因此需要先删除一个,在更新一个。
#更新镜像版本,可以按照如下方法:
[root@k8smaster ds]# kubectl set image daemonsets fluentd-elasticsearch fluentd-elasticsearch=nginx -n kube-system
daemonset.apps/fluentd-elasticsearch image updated
#这个镜像启动 pod 会有问题,主要是演示 daemonset 如何在命令行更新 pod 平时不用 都是改yaml
[root@k8smaster ds]# kubectl set image daemonsets fluentd-elasticsearch fluentd-elasticsearch=fluentd -n kube-system
daemonset.apps/fluentd-elasticsearch image updated
#改回来
[root@k8smaster ds]# kubectl get pods -n kube-system
NAME READY STATUS RESTARTS AGE
fluentd-elasticsearch-874qw 1/1 Running 0 23s
fluentd-elasticsearch-lmvjq 1/1 Running 0 26s
fluentd-elasticsearch-qxgmc 1/1 Running 0 8m29s
作者:谢文欣(风敬) 为什么要做流量隔离 源于一个 EDAS 客户遇到的棘手情况:他们线上的一个 Pod CPU 指标异常,为了进一步诊断问题,客户希望在不重建此 Pod 的情况下保留现场,但诊断期间流量还会经过这个异常 Pod,导致影响服务质量,于是询问我们有没有办法可以把流入异常节点的流量摘除掉,形成一个隔离的诊断环境。经诊断后,如果异常可以修复,待修复完成后,再解除流量隔离,节点恢复正常工作
在系统升级、迁移的过程中,如何验证系统逻辑、性能正确无误,是一个很大的挑战。这一系列介绍了Netflix通过重放流量测试解决这一挑战的实践。原文: Migrating Critical Traffic At Scale with No Downtime — Part 2 想象一下,你被心爱的Netflix电视剧的最新一集迷住了,享受着不间断的高清流媒体体验。在这些完美的娱乐时刻背后是一个复杂的机制