跳至主内容

升级 RabbitMQ Kubernetes Operators

本主题介绍如何升级 RabbitMQ Kubernetes Operators 及其组件。

概述

升级 RabbitMQ Cluster Operator 或 Messaging Topology Operator 会产生以下影响

  1. 更新到新的 Operator Manifest
  2. (对于指定版本) RabbitmqCluster Pod 的滚动重启

更新到新的 Operator Manifest

要升级到 Operator 的新版本,只需应用所需版本的新 Operator Manifest。例如,对于 RabbitMQ Cluster Operator

kubectl apply -f "https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml"
# namespace/rabbitmq-system unchanged
# customresourcedefinition.apiextensions.k8s.io/rabbitmqclusters.rabbitmq.com configured
# serviceaccount/rabbitmq-cluster-operator unchanged
# role.rbac.authorization.k8s.io/rabbitmq-cluster-leader-election-role unchanged
# clusterrole.rbac.authorization.k8s.io/rabbitmq-cluster-operator-role unchanged
# rolebinding.rbac.authorization.k8s.io/rabbitmq-cluster-leader-election-rolebinding unchanged
# clusterrolebinding.rbac.authorization.k8s.io/rabbitmq-cluster-operator-rolebinding unchanged
# deployment.apps/rabbitmq-cluster-operator configured

这将导致 Operator 提供的 Custom Resource Definitions 被更新,并且 Operator Pod 使用更新版本的 Operator 容器镜像。

Cluster Operator 的新版本通常会更改新集群中使用的 RabbitMQ 的默认版本,如果 `RabbitmqCluster` Manifest 的 `spec` 中未指定版本。因此,升级后,如果您不指定版本,新创建的 `RabbitmqClusters` 可能会运行更新版本的 RabbitMQ。请注意,这对现有的 `RabbitmqClusters` 没有影响,它们的 Manifest 已经使用了上一个 Operator 版本的默认值。

RabbitmqCluster Pod 的滚动重启

在某些情况下,升级 RabbitMQ Cluster Operator 的版本(不是 Messaging Topology Operator)将需要重启 `RabbitmqClusters` 的 Pod。这通常是由于 Operator 创建的 `RabbitmqCluster` 的底层 PodSpec 发生了变化。在这种情况下,升级 Cluster Operator 将导致 Kubernetes 分布上的 `RabbitmqClusters` 进行滚动重启。

如果 Cluster Operator 的某个版本会触发 `RabbitmqCluster` Pod 的滚动重启,将在该版本的发布说明中注明。例如,请参阅 https://github.com/rabbitmq/cluster-operator/releases/tag/v1.7.0

© . This site is unofficial and not affiliated with VMware.