首 页 >Docker>DockerFile> 使用kubeadm将Kubernetes集群从1.6版本升级到1

使用kubeadm将Kubernetes集群从1.6版本升级到1

本指南用于kubeadm将集群从1.6.x版本升级到1.7.x版本。低于1.6的群集不支持升级,如果使用kubeadm Beta版本时,也不支持升级。

 

警告:本次升级将覆盖由kubeadm管理的所有资源(静态pod manifest文件,kube-system namespace中的service accounts和RBAC规则等),集群安装后对资源的任何设置都可以在升级后重新复用,以确保升级不会影响kube-system namespace之外的其他静态pod manifest文件或对象 。

 

开始升级前 

需要运行的Kubernetes集群版本是1.6.x

 

在Master上

  1. 升级system packages

 

升级OS packages : kubectl,kubeadm,kubelet和kubernetes-cni。

在Debian上,可以通过以下方法实现:

 

sudo apt-get update

sudo apt-get upgrade

 

在CentOS/Fedora上,可以运行:

 

sudo yum update

 

  1. 重新启动kubelet:

 

sudo systemctl restart kubelet

 

  1. 删除kube-proxy DaemonSet。

 

虽然大部分组件会在下一步自动升级,但 kube-proxy目前需要手动删除,以便在正确的版本中重新创建:

sudo KUBECONFIG=/etc/kubernetes/admin.conf kubectl delete daemonset kube-proxy -n kube-system

 

4、执行kubeadm升级。

 

警告:当启动集群时,传递给第一个kubeadm init的所有参数必须在升级-kubeadm init-command中指定。这个问题计划在v1.8版本中解决。

 

sudo kubeadm init --skip-preflight-checks --kubernetes-version

 

例如,如果要升级到1.7.0,将运行:

 

sudo kubeadm init --skip-preflight-checks --kubernetes-version v1.7.0

 

5、升级CNI提供商

 

您的CNI提供商可能有自己的升级说明。查看附件页面查找你的CNI提供商,并查看是否需要额外的升级步骤。

 

在每个node上

  1. 升级system packages

 

升级OS packages : kubectl,kubeadm,kubelet和kubernetes-cni。

在Debian上,可以通过以下方式实现:

 

sudo apt-get update

sudo apt-get upgrade

 

在CentOS/Fedora上,可以运行:

 

sudo yum update

 

2、重新启动kubelet。

 

sudo systemctl restart kubelet

 

 

原文英文:

Upgrading kubeadm clusters from 1.6 to 1.7

This guide is for upgrading kubeadm clusters from version 1.6.x to 1.7.x. Upgrades are not supported for clusters lower than 1.6, which is when kubeadm became Beta.

WARNING: These instructions will overwrite all of the resources managed by kubeadm (static pod manifest files, service accounts and RBAC rules in the kube-system namespace, etc.), so any customizations you may have made to these resources after cluster setup will need to be reapplied after the upgrade. The upgrade will not disturb other static pod manifest files or objects outside the kube-system namespace.

 

Before you begin

You need to have a Kubernetes cluster running version 1.6.x.

 

On the master

  1. Upgrade system packages.

Upgrade your OS packages for kubectl, kubeadm, kubelet, and kubernetes-cni.

a. On Debian, this can be accomplished with:

sudo apt-get update
sudo apt-get upgrade

b. On CentOS/Fedora, you would instead run:


sudo yum update
  1. Restart kubelet.

<>3.Delete the kube-proxy DaemonSet.

Although most components are automatically upgraded by the next step, kube-proxy currently needs to be manually deleted so it can be recreated at the correct version:

sudo KUBECONFIG=/etc/kubernetes/admin.conf kubectl delete daemonset kube-proxy -n kube-system

 

  1. Perform kubeadm upgrade.

WARNING: All parameters you passed to the first kubeadm init when you bootstrapped your cluster MUST be specified here in the upgrade-kubeadm init-command. This is a limitation we plan to address in v1.8.

sudo kubeadm init --skip-preflight-checks --kubernetes-version 

For instance, if you want to upgrade to 1.7.0, you would run:

sudo kubeadm init --skip-preflight-checks --kubernetes-version v1.7.0

 

  1. Upgrade CNI provider.

Your CNI provider might have its own upgrade instructions to follow now. Check the addons page to find your CNI provider and see if there are additional upgrade steps necessary.

 

On each node

  1. Upgrade system packages.

Upgrade your OS packages for kubectl, kubeadm, kubelet, and kubernetes-cni.

a. On Debian, this can be accomplished with:

sudo apt-get update
sudo apt-get upgrade

b. On CentOS/Fedora, you would instead run:

sudo yum update

 

  1. Restart kubelet.
sudo systemctl restart kubelet

 

 

本文链接:使用kubeadm将Kubernetes集群从1.6版本升级到1

有容云-构筑企业容器云 www.youruncloud.com

温馨提示

对Docker容器技术或容器生产实施感兴趣的朋友欢迎加群讨论。我们汇集了Docker容器技术落地实施团队精英及业内技术派高人,在线为您分享Docker技术干货。我们的宗旨是为了大家拥有更专业的平台交流Docker实战技术,我们将定期邀请嘉宾做各类话题分享及回顾,共同实践研究Docker容器生态圈。

加微信群方法:

1.关注【有容云】公众号

2.留言”我要加群”

QQ群号:454565480

有容云微信二维码
评论
登录

全部评论