Tanzu Kubernetes Cluster 版本升级

本文详细介绍了如何将 Tanzu Kubernetes Cluster 从版本1.16.8升级到1.17.7的过程,包括环境信息确认、当前版本检查、执行升级命令以及监控升级进度等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境信息:

namespace为 tkc-cluster, Tanzu Kubernetes Cluster为:tkc-guest-cluster

第一步:ContentLabrary

在vSphere Web Client中看到为Tanzu Kubernetes Cluster创建的ContentLabrary中已经自动下载了 v1.17.7版本,于是将已部署的Tanzu Kubernetes Cluster进行升级。

第二步:确定当前版本

Tanzu Kubernetes集群当前版本为 1.16.8


$ kubectl config use-context tkc-guest-cluster   # 切换到 tanzu kubernetes cluster
Switched to context "tkc-guest-cluster".
$ kubectl get node
NAME                                               STATUS   ROLES    AGE    VERSION
tkc-guest-cluster-control-plane-6cfsf              Ready    master   10d    v1.16.8+vmware.1
tkc-guest-cluster-control-plane-drlqp              Ready    master   10d    v1.16.8+vmware.1
tkc-guest-cluster-control-plane-wmn2s              Ready    master   10d    v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-rcsvd   Ready    <none>   3d2h   v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-s7hch   Ready    <none>   10d    v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-sb6ss   Ready    <none>   3d2h   v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-tnxn2   Ready    <none>   10d    v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-vxgt9   Ready    <none>   10d    v1.16.8+vmware.1

第三步:执行版本升级

注意需要登录suppervisor cluster才能执行升级命令

$ read -r -d '' PATCH <<'EOF'
spec:
  distribution:
     fullVersion: null
    version: v1.17.7
EOF

 $ kubectl patch --type=merge tanzukubernetescluster tkc-guest-cluster --patch "$PATCH"    # 需要切换到supersivor cluster

  tanzukubernetescluster.run.tanzu.vmware.com/tkc-guest-cluster patched

第四步:查看升级进度

默认以滚动的方式进行升级。

$ kubectl config use-context tkc-guest-cluster   # 切换到 tanzu kubernetes cluster
Switched to context "tkc-guest-cluster".
$ kubectl get node
NAME                                               STATUS     ROLES    AGE     VERSION
tkc-guest-cluster-control-plane-6cfsf-7138032      NotReady   master   8m55s   v1.17.7+vmware.1
tkc-guest-cluster-control-plane-drlqp              Ready      master   10d     v1.16.8+vmware.1
tkc-guest-cluster-control-plane-drlqp-7138032      Ready      master   2m36s   v1.17.7+vmware.1
tkc-guest-cluster-control-plane-wmn2s              Ready      master   10d     v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-rcsvd   Ready      <none>   3d3h    v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-s7hch   Ready      <none>   10d     v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-sb6ss   Ready      <none>   3d3h    v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-tnxn2   Ready      <none>   10d     v1.16.8+vmware.1
tkc-guest-cluster-workers-8k9c8-5576b69b67-vxgt9   NotReady   <none>   10d     v1.16.8+vmware.1
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值