kubernetes 升级到1.18.0

头两天kubernetes发布了1.18.0版本,各种商业互捧的推送已经轰炸了我的手机,索性进行就直接升级上来看看到底什么个情况

# yum update kube* -y # 升级kubernetes版本到1.18

# kubeadm upgrade plan # 检查集群是否处于可升级状态,并以用户友好的方式获取可升级的版本。

[root@master ~]# kubeadm upgrade plan
[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’
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.17.4
[upgrade/versions] kubeadm version: v1.18.0
[upgrade/versions] Latest stable version: v1.18.0
[upgrade/versions] Latest stable version: v1.18.0
[upgrade/versions] Latest version in the v1.17 series: v1.17.4
[upgrade/versions] Latest version in the v1.17 series: v1.17.4

Components that must be upgraded manually after you have upgraded the control plane with ‘kubeadm upgrade apply’:
COMPONENT CURRENT AVAILABLE
Kubelet 1 x v1.17.4 v1.18.0

Upgrade to the latest stable version:

COMPONENT CURRENT AVAILABLE
API Server v1.17.4 v1.18.0
Controller Manager v1.17.4 v1.18.0
Scheduler v1.17.4 v1.18.0
Kube Proxy v1.17.4 v1.18.0
CoreDNS 1.6.5 1.6.7
Etcd 3.4.3 3.4.3-0

You can now apply the upgrade by executing the following command:

kubeadm upgrade apply v1.18.0

_____________________________________________________________________

# kubeadm upgrade apply v1.18.0 # 根据要求直接升级

[root@master ~]# time kubeadm upgrade apply v1.18.0
[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’
[preflight] Running pre-flight checks.
[upgrade] Running cluster health checks
[upgrade/version] You have chosen to change the cluster version to “v1.18.0”
[upgrade/versions] Cluster version: v1.17.4
[upgrade/versions] kubeadm version: v1.18.0
[upgrade/confirm] Are you sure you want to proceed with the upgrade? [y/N]:

这里直接输入“y”然后等待

[apiclient] Found 1 Pods for label selector component=kube-scheduler
[upgrade/staticpods] Component “kube-scheduler” upgraded successfully!
[upload-config] Storing the configuration used in ConfigMap “kubeadm-config” in the “kube-system” Namespace
[kubelet] Creating a ConfigMap “kubelet-config-1.18” in namespace kube-system with the configuration for the kubelets in the cluster
[kubelet-start] Downloading configuration for the kubelet from the “kubelet-config-1.18” ConfigMap in the kube-system namespace
[kubelet-start] Writing kubelet configuration to file “/var/lib/kubelet/config.yaml”
[bootstrap-token] configured RBAC rules to allow Node Bootstrap tokens to post CSRs in order for nodes to get long term certificate credentials
[bootstrap-token] configured RBAC rules to allow the csrapprover controller automatically approve CSRs from a Node Bootstrap Token
[bootstrap-token] configured RBAC rules to allow certificate rotation for all node client certificates in the cluster
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy

[upgrade/successful] SUCCESS! Your cluster was upgraded to “v1.18.0”. Enjoy!

[upgrade/kubelet] Now that your control plane is upgraded, please proceed with upgrading your kubelets if you haven’t already done so.

# kubectl get nodes # 看一下版本

搞定

一个小插曲:

上传图片的时候发现上传不了,提示:The uploaded file could not be moved to wp-content/uploads/,我这是从别的机器的LNMPR环境迁移到的这个kubernetes环境,感觉是权限问题,于是就查了下代码的权限和容器里面的权限,最后使用chown -R xxx:xxx 代码目录,搞定

一条评论

留下评论

error: Content is protected !!