如何将 kubernetes 从 v1.10.0 升级到 v1.10.11
how to upgrade kubernetes from v1.10.0 to v1.10.11
我在 1.9 下通过 kubeadm 安装了 kubernetes,不久前使用 kubeadm upgrade
将其升级到 1.10.0。我对 1 很满意。10.x 并且不想处理升级到任何更新的潜在问题。
所以我想升级到 1.10.11。
我试过了
$ kubeadm upgrade plan v1.10.11
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[upgrade/plan] computing upgrade possibilities
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.10.0
[upgrade/versions] kubeadm version: v1.10.11
[upgrade/versions] Latest stable version: v1.13.1
[upgrade/versions] Latest version in the v1.1 series: v1.1.8
[upgrade/versions] WARNING: No recommended etcd for requested kubernetes version (v1.13.1)
Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT CURRENT AVAILABLE
Kubelet 5 x v1.10.0 v1.13.1
2 x v1.10.3 v1.13.1
1 x v1.10.5 v1.13.1
2 x v1.9.6 v1.13.1
Upgrade to the latest stable version:
COMPONENT CURRENT AVAILABLE
API Server v1.10.0 v1.13.1
Controller Manager v1.10.0 v1.13.1
Scheduler v1.10.0 v1.13.1
Kube Proxy v1.10.0 v1.13.1
Kube DNS 1.14.8 1.14.8
Etcd 3.1.12 N/A
You can now apply the upgrade by executing the following command:
kubeadm upgrade apply v1.13.1
Note: Before you can perform this upgrade, you have to update kubeadm to v1.13.1.
_____________________________________________________________________
好像要我升级到1.13!
我如何/只是/从我的 v1.10.0 设置升级到 v1.10.11?
我可以将我的 kubernetes 集群从 1.10.0 升级到 1.10.11。
[root@ centos]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-.ec2.internal Ready master 2m v1.10.0
以下是分步说明:
export VERSION="1.10.11"
export ARCH=amd64
wget https://storage.googleapis.com/kubernetes-release/release/v1.10.11/bin/linux/amd64/kubeadm > /usr/bin/kubeadm
chmod a+rx /usr/bin/kubeadm
现在查看kubeadm升级计划
[root@ centos]# kubeadm upgrade plan
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[upgrade/plan] computing upgrade possibilities
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.10.11
[upgrade/versions] kubeadm version: v1.10.11
[upgrade/versions] Latest stable version: v1.13.1
[upgrade/versions] Latest version in the v1.1 series: v1.1.8
[upgrade/versions] WARNING: No recommended etcd for requested kubernetes version (v1.13.1)
Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT CURRENT AVAILABLE
Kubelet 1 x v1.10.0 v1.13.1
Upgrade to the latest stable version:
COMPONENT CURRENT AVAILABLE
API Server v1.10.11 v1.13.1
Controller Manager v1.10.11 v1.13.1
Scheduler v1.10.11 v1.13.1
Kube Proxy v1.10.11 v1.13.1
Kube DNS 1.14.8 1.14.8
Etcd 3.1.12 N/A
You can now apply the upgrade by executing the following command:
kubeadm upgrade apply v1.13.1
Note: Before you can perform this upgrade, you have to update kubeadm to v1.13.1.
现在,您应该使用:
,而不是升级到 v1.13.1
kubeadm upgrade apply 1.10.11
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[upgrade/version] You have chosen to change the cluster version to "v1.10.11"
[upgrade/versions] Cluster version: v1.10.11
[upgrade/versions] kubeadm version: v1.10.11
[upgrade/confirm] Are you sure you want to proceed with the upgrade? [y/N]: y
.......
[bootstraptoken] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstraptoken] Configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[addons] Applied essential addon: kube-dns
[addons] Applied essential addon: kube-proxy
[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.10.11". Enjoy!
现在按照官方文档升级here就可以把系统搞起来运行:
使用以下方法耗尽主节点:
kubectl drain ip-.ec2.internal --ignore-daemonsets
升级 kubelet 和 kubeadm 包使用:
yum upgrade kubelet-1.10.11 kubeadm-1.10.11 --disableexcludes=kubernetes
重启 kubelet 并解除对主机的封锁:
systemctl restart kubelet
kubectl uncordon $HOST
现在您将能够启动系统 运行:
[root@ip- centos]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-.ec2.internal Ready master 32m v1.10.11
[root@ip- centos]# kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-deployment-75675f5897-pmmkc 1/1 Running 0 9m
nginx-deployment-75675f5897-wshgz 1/1 Running 0 9m
我在 1.9 下通过 kubeadm 安装了 kubernetes,不久前使用 kubeadm upgrade
将其升级到 1.10.0。我对 1 很满意。10.x 并且不想处理升级到任何更新的潜在问题。
所以我想升级到 1.10.11。
我试过了
$ kubeadm upgrade plan v1.10.11
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[upgrade/plan] computing upgrade possibilities
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.10.0
[upgrade/versions] kubeadm version: v1.10.11
[upgrade/versions] Latest stable version: v1.13.1
[upgrade/versions] Latest version in the v1.1 series: v1.1.8
[upgrade/versions] WARNING: No recommended etcd for requested kubernetes version (v1.13.1)
Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT CURRENT AVAILABLE
Kubelet 5 x v1.10.0 v1.13.1
2 x v1.10.3 v1.13.1
1 x v1.10.5 v1.13.1
2 x v1.9.6 v1.13.1
Upgrade to the latest stable version:
COMPONENT CURRENT AVAILABLE
API Server v1.10.0 v1.13.1
Controller Manager v1.10.0 v1.13.1
Scheduler v1.10.0 v1.13.1
Kube Proxy v1.10.0 v1.13.1
Kube DNS 1.14.8 1.14.8
Etcd 3.1.12 N/A
You can now apply the upgrade by executing the following command:
kubeadm upgrade apply v1.13.1
Note: Before you can perform this upgrade, you have to update kubeadm to v1.13.1.
_____________________________________________________________________
好像要我升级到1.13!
我如何/只是/从我的 v1.10.0 设置升级到 v1.10.11?
我可以将我的 kubernetes 集群从 1.10.0 升级到 1.10.11。
[root@ centos]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-.ec2.internal Ready master 2m v1.10.0
以下是分步说明:
export VERSION="1.10.11"
export ARCH=amd64
wget https://storage.googleapis.com/kubernetes-release/release/v1.10.11/bin/linux/amd64/kubeadm > /usr/bin/kubeadm
chmod a+rx /usr/bin/kubeadm
现在查看kubeadm升级计划
[root@ centos]# kubeadm upgrade plan
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[upgrade/plan] computing upgrade possibilities
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.10.11
[upgrade/versions] kubeadm version: v1.10.11
[upgrade/versions] Latest stable version: v1.13.1
[upgrade/versions] Latest version in the v1.1 series: v1.1.8
[upgrade/versions] WARNING: No recommended etcd for requested kubernetes version (v1.13.1)
Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT CURRENT AVAILABLE
Kubelet 1 x v1.10.0 v1.13.1
Upgrade to the latest stable version:
COMPONENT CURRENT AVAILABLE
API Server v1.10.11 v1.13.1
Controller Manager v1.10.11 v1.13.1
Scheduler v1.10.11 v1.13.1
Kube Proxy v1.10.11 v1.13.1
Kube DNS 1.14.8 1.14.8
Etcd 3.1.12 N/A
You can now apply the upgrade by executing the following command:
kubeadm upgrade apply v1.13.1
Note: Before you can perform this upgrade, you have to update kubeadm to v1.13.1.
现在,您应该使用:
,而不是升级到 v1.13.1kubeadm upgrade apply 1.10.11
[preflight] Running pre-flight checks.
[upgrade] Making sure the cluster is healthy:
[upgrade/config] Making sure the configuration is correct:
[upgrade/config] Reading configuration from the cluster...
[upgrade/config] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[upgrade/version] You have chosen to change the cluster version to "v1.10.11"
[upgrade/versions] Cluster version: v1.10.11
[upgrade/versions] kubeadm version: v1.10.11
[upgrade/confirm] Are you sure you want to proceed with the upgrade? [y/N]: y
.......
[bootstraptoken] Configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstraptoken] Configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[addons] Applied essential addon: kube-dns
[addons] Applied essential addon: kube-proxy
[upgrade/successful] SUCCESS! Your cluster was upgraded to "v1.10.11". Enjoy!
现在按照官方文档升级here就可以把系统搞起来运行:
使用以下方法耗尽主节点:
kubectl drain ip-.ec2.internal --ignore-daemonsets
升级 kubelet 和 kubeadm 包使用:
yum upgrade kubelet-1.10.11 kubeadm-1.10.11 --disableexcludes=kubernetes
重启 kubelet 并解除对主机的封锁:
systemctl restart kubelet
kubectl uncordon $HOST
现在您将能够启动系统 运行:
[root@ip- centos]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-.ec2.internal Ready master 32m v1.10.11
[root@ip- centos]# kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-deployment-75675f5897-pmmkc 1/1 Running 0 9m
nginx-deployment-75675f5897-wshgz 1/1 Running 0 9m