OpenShift 4 之集群是如何通过Cluster Version Operator升级的?

OpenShift 4 的升级服务提供了"over-the-air"特性来对OpenShift集群以及底层的Linux进行升级,这其中最关键的是使用了CVO(Cluster Version Operator)实现对自动对集群环境进行升级。 CVO会首先根据当前环境查看是否有合法的升级版本,以及基于当前版本的升级路径,当CVO发现新版本后会将升级配置传递给Machine Config Operator,MCO主要负责对节点主机进行管理,主机环境(包括CoreOS和OCP)的升级只能是通过MCO完成。
OpenShift 4 之集群是如何通过Cluster Version Operator升级的?_第1张图片
为了不影响业务连续运行,MCO是通过滚动的方式让每个节点升级。每个节点的升级过程是由Machine Config Daemons完成的,它首先下载升级介质,然后再进行节点升级操作。
OpenShift 4 之集群是如何通过Cluster Version Operator升级的?_第2张图片
我们可以通过以下方式查看CVO的运行状态。当关闭了CVO的时候,数量全部为“0”,此时OpenShift集群就无法升级了。

$ oc get deployments -n openshift-cluster-version
NAME                       DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
cluster-version-operator   1         1         1            1           2h

可以通过以下方式查看CVO的运行日志,其中包括了“Started”,“Desired”,“Finished”等不同状态。

$ oc logs deployments/cluster-version-operator -n openshift-cluster-version > operatorlog.txt
$ tail operatorlog.txt
。。。
I0514 20:48:20.887420       1 cvo.go:336] Started syncing cluster version "openshift-cluster-version/version" (2019-05-14 20:48:20.88740786 +0000 UTC m=+87191.276686302)
I0514 20:48:20.887478       1 cvo.go:364] Desired version from operator is v1.Update{
     Version:"4.1.0-rc.3", Image:"quay.io/openshift-release-dev/ocp-release@sha256:713aae8687cf8a3cb5c2c504f655
32dfe11e1b3534448ea9eeef5b0931d3e208", Force:false}
I0514 20:48:20.887574       1 cvo.go:338] Finished syncing cluster version "openshift-cluster-version/version" (162.252µs)
I0514 20:48:35.887466       1 cvo.go:336] Started syncing cluster version "openshift-cluster-version/version" (2019-05-14 20:48:35.887452731 +0000 UTC m=+87206.276731165)
I0514 20:48:35.887651       1 cvo.go:364] Desired version from operator is v1.Update{
     Version:"4.1.0-rc.3", Image:"quay.io/openshift-release-dev/ocp-release@sha256:713aae8687cf8a3cb5c2c504f655
32dfe11e1b3534448ea9eeef5b0931d3e208", Force:false}
I0514 20:48:35.887738       1 cvo.go:338] Finished syncing cluster version "openshift-cluster-version/version" (280.777µs)
I0514 20:48:50.887443       1 cvo.go:336] Started syncing cluster version "openshift-cluster-version/version" (2019-05-14 20:48:50.887431061 +0000 UTC m=+87221.276709496)
I0514 20:48:50.887516       1 cvo.go:364] Desired version from operator is v1.Update{
     Version:"4.1.0-rc.3", Image:"quay.io/openshift-release-dev/ocp-release@sha256:713aae8687cf8a3cb5c2c504f655
32dfe11e1b3534448ea9eeef5b0931d3e208", Force:false}
I0514 20:48:50.887675       1 cvo.go:338] Finished syncing cluster version "openshift-cluster-version/version" (239.797µs)
。。。

你可能感兴趣的:(OpenShift,4,Ops,升级,openshift,kubernetes)