K8S滚动更新守护进程集

这篇具有很好参考价值的文章主要介绍了K8S滚动更新守护进程集。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Updating a DaemonSet 更新守护进程集

DaemonSets are great for deploying services across an entire cluster, but what about upgrades? Prior to Kubernetes 1.6, the only way to update Pods managed by a DaemonSet was to update the DaemonSet and then manually delete each Pod that was managed by the DaemonSet so that it would be re-created with the new configuration. With the release of Kubernetes 1.6, DaemonSets gained an equivalent to the Deployment object that manages a DaemonSet rollout inside the cluster.

DaemonSet非常适合在整个集群中部署服务,但升级怎么办?在 Kubernetes 1.6 之前,更新由 DaemonSet 管理的 Pod 的唯一方法是更新 DaemonSet,然后手动删除由 DaemonSet 管理的每个 Pod,以便用新配置重新创建 Pod。随着 Kubernetes 1.6 的发布,DaemonSets 获得了一个与部署对象等价的对象,可以在集群内管理 DaemonSet 的推出。

Rolling Update of a DaemonSet 滚动更新守护进程集

DaemonSets can be rolled out using the same RollingUpdate strategy that deployments use. You can configure the update strategy using the spec.updateStrategy.type field, which should have the value RollingUpdate. When a DaemonSet has an update strategy of RollingUpdate, any change to the spec.template field (or subfields) in the DaemonSet will initiate a rolling update.

可以使用与部署相同的 RollingUpdate 策略推出守护进程集。您可以使用 spec.updateStrategy.type 字段配置更新策略,该字段的值应为 RollingUpdate。当 DaemonSet 的更新策略为 RollingUpdate 时,DaemonSet 中 spec.template 字段(或子字段)的任何更改都将启动滚动更新。

As with rolling updates of deployments (see Chapter 10), the RollingUpdate strategy gradually updates members of a DaemonSet until all of the Pods are running the new configuration.

与部署的滚动更新一样(见第 10 章),RollingUpdate 策略会逐步更新 DaemonSet 的成员,直到所有 Pod 都运行新配置。

There are two parameters that control the rolling update of a DaemonSet:

  • spec.minReadySeconds, which determines how long a Pod must be “ready” before the rolling update proceeds to upgrade subsequent Pods
  • spec.updateStrategy.rollingUpdate.maxUna vailable, which indicates how many Pods may be simultaneously updated by the rolling update

有两个参数可以控制 DaemonSet 的滚动更新:

  • spec.minReadySeconds(最小就绪秒数),用于确定在滚动更新继续升级后续 Pod 之前,Pod 必须 "就绪 "多长时间

  • spec.updateStrategy.rollingUpdate.maxUna vailable,表示滚动更新可同时更新多少个 Pod

You will likely want to set spec.minReadySeconds to a reasonably long value, for example 30–60 seconds, to ensure that your Pod is truly healthy before the rollout proceeds.

您可能希望将 spec.minReadySeconds 设置为一个相当长的值,例如 30-60 秒,以确保 Pod 在启动前真正处于健康状态。

The setting for spec.updateStrategy.rollingUpdate.maxUnavailab le is more likely to be application-dependent. Setting it to 1 is a safe, general-purpose strategy, but it also takes a while to complete the rollout (number of nodes × minReadySeconds). Increasing the maximum unavailability will make your rollout move faster, but increases the “blast radius” of a failed rollout. The characteristics of your application and cluster environment dictate the relative values of speed versus safety. A good approach might be to set maxUnavailable to 1 and only increase it if users or administrators complain about DaemonSet rollout speed.

spec.updateStrategy.rollingUpdate.maxUnavailab le 的设置更可能取决于应用。将其设置为 1 是一种安全的通用策略,但也需要一段时间才能完成滚动(节点数 × minReadySeconds)。增加最大不可用时间会使推出速度更快,但会增加推出失败的 “爆炸半径”。应用程序和群集环境的特性决定了速度与安全的相对值。一个好的方法可能是将 maxUnavailable 设置为 1,只有在用户或管理员抱怨 DaemonSet 推出速度时才增加它。

Once a rolling update has started, you can use the kubectl rollout commands to see the current status of a DaemonSet rollout.

启动滚动更新后,可以使用 kubectl rollout 命令查看 DaemonSet 滚动的当前状态。

For example, kubectl rollout status daemonSets mydaemon-set will show the current rollout status of a DaemonSet named my-daemon-set.

例如,kubectl rollout status daemonSets mydaemon-set 将显示名为 my-daemon-set 的 DaemonSet 的当前启动状态。文章来源地址https://www.toymoban.com/news/detail-810494.html

到了这里,关于K8S滚动更新守护进程集的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 使用k8s 配置 RollingUpdate 滚动更新实现应用的灰度发布

    方案实现方式: RollingUpdate 滚动更新机制 当某个服务需要升级时,传统的做法是,先将要更新的服务下线,业务停止后再更新版本和配置,然后重新启动服务。 如果业务集群规模较大时,这个工作就变成了一个挑战,而且全部停止了服务,再逐步升级的方式会导致服务较长

    2024年01月24日
    浏览(33)
  • K8s(健康检查+滚动更新+优雅停机+弹性伸缩+Prometheus监控+配置分离)

    前言 快速配置请直接跳转至汇总配置 K8s + SpringBoot实现零宕机发布:健康检查+滚动更新+优雅停机+弹性伸缩+Prometheus监控+配置分离(镜像复用) 配置 健康检查 业务层面 定义访问端口、路径及权限 application.yaml 将暴露/actuator/health/readiness和/actuator/health/liveness两个接口,访问方

    2024年02月14日
    浏览(28)
  • 【k8s】kubernets和docker之间版本的对应关系

    如果查看1.18版本k8s对应的docker支持的最新版本 https://github.com/kubernetes/kubernetes/blob/release-1.18/build/dependencies.yaml 查看最新版本k8s对应的docker支持的最新版本 https://github.com/kubernetes/kubernetes/blob/master/build/dependencies.yaml

    2024年02月11日
    浏览(34)
  • Kubernets(K8S)启动和运行 01-02 Kubernetes的速度非常快

    Velocity is the key component in nearly all software development today. The software industry has evolved from shipping products as boxed CDs or DVDs to software that is delivered over the network via web-based services that are updated hourly. This changing landscape means that the difference between you and your competitors is often the speed with which yo

    2024年02月03日
    浏览(27)
  • CentOS 7/8使用kubeadm部署kubernets(k8s)集群【附阿里云实验室】

    好消息好消息,阿里云全线降价,大量服务提供免费甚至永久的试用,赶紧来薅大厂羊毛吧,坐电梯即可直达! 送福利!阿里云热门产品免费领(含ECS),点击进入 :https://click.aliyun.com/m/1000370359/ 送福利!阿里云热门产品免费领(含ECS),点击进入 :https://click.aliyun.com/m/

    2023年04月22日
    浏览(33)
  • CentOS 7/8使用kubeadm部署kubernets(k8s)集群【附阿里云实验室】内有福利

    好消息好消息,阿里云全线降价,大量服务提供免费甚至永久的试用,赶紧来薅大厂羊毛吧,坐电梯即可直达! 送福利!阿里云热门产品免费领(含ECS),点击进入 :https://click.aliyun.com/m/1000370359/ 送福利!阿里云热门产品免费领(含ECS),点击进入 :https://click.aliyun.com/m/

    2023年04月27日
    浏览(40)
  • k8s集群证书过期后,如何更新k8s证书

    对于版本 1.21.5,这是我的解决方案: ssh 到主节点,然后在步骤 2 中检查证书。 运行这个命令: kubeadm certs check-expiration 并看到昨天所有的都过期了。 所有现有证书的备份: 要全部更新,请运行以下命令: kubeadm certs renew all Done renewing certificates. You must restart the kube-apiserver

    2024年02月11日
    浏览(36)
  • 【aliyun ECS】CentOS 7/8使用kubeadm部署kubernets(k8s)集群【附阿里云实验室】内有福利

    好消息好消息,阿里云全线降价,大量服务提供免费甚至永久的试用,赶紧来薅大厂羊毛吧,坐电梯即可直达! 送福利!阿里云热门产品免费领(含ECS),点击进入 :https://click.aliyun.com/m/1000370359/ 送福利!阿里云热门产品免费领(含ECS),点击进入 :https://click.aliyun.com/m/

    2023年04月27日
    浏览(36)
  • k8s证书更新,kubeadm安装的K8S证书过期后无法使用后证书更新方法

    k8s安装一年后证书显示过期。证书未自动续期。 以下操作需到所有master节点操作 一般情况下,k8s创建的集群节点上的/usr/bin/文件夹下会存在kubeadm二进制文件,如果发现master节点上没有kubeadm,可以从官方下载对应的版本并且安装。

    2024年02月14日
    浏览(37)
  • 【K8S】Kubernetes 中滚动发布由浅入深实战

    Kubernetes及其强大的特点之一就是超大规模集群应用的自动化部署,这其中包括了应用的扩容、缩容及其自适应扩缩容(HPA、VPA)。 在滚动发布的过程中,Kubernetes会对要进行升级的应用所属Pod进行逐个的替换,直至将所有的Pod都替换为新版本的Pod。整个过程中新老版本的Pod都

    2024年01月24日
    浏览(41)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包