kubernetes bis --- based kubeadm upgraded version K8S

Kubernetes upgrade to version designated combat

1. Check that the kubernetes on the master node version

Because it is yum install kubernetes, need to look at this time version, then go to the official website to see the latest version 1.14.1 is the number

[root@master ~]# rpm -qi  kubeadm
Name        : kubeadm
Version     : 1.14.1
Release     : 0
Architecture: x86_64
Install Date: Mon 13 Jan 2020 02:41:35 PM CST
Group       : Unspecified
Size        : 39588940
License     : ASL 2.0
Signature   : RSA/SHA512, Tue 09 Apr 2019 05:09:51 AM CST, Key ID f09c394c3e1ba8d5
Source RPM  : kubelet-1.14.1-0.src.rpm
Build Date  : Tue 09 Apr 2019 05:02:41 AM CST
Build Host  : bf8516edf970
Relocations : (not relocatable)
URL         : https://kubernetes.io
Summary     : Command-line utility for administering a Kubernetes cluster.
Description :
Command-line utility for administering a Kubernetes cluster.

github official website: https: //github.com/kubernetes/kubernetes/tags 

2, upgrade kubeadm to specify the version on the master

1. Check that the latest version is 1.14.10 version 1.14 of the official website, so installation 1.14.3 version of kubeadm directly in the master

[root@master ~]# yum -y install kubeadm-1.14.3

2, see kubeadm help master

[root@master ~]# kubeadm upgrade --help
Upgrade your cluster smoothly to a newer version with this command.

Usage:
  kubeadm upgrade [flags]
  kubeadm upgrade [command]

Available Commands:
  apply       Upgrade your Kubernetes cluster to the specified version.
  diff        Show what differences would be applied to existing static pod manifests. See also: kubeadm upgrade apply --dry-run
  node        Upgrade commands for a node in the cluster. Currently only supports upgrading the configuration, not the kubelet itself.
  plan        Check which versions are available to upgrade to and validate whether your current cluster is upgradeable. To skip the internet check, pass in the optional [version] parameter.

Flags:
  -h, --help   help for upgrade

Global Flags:
      --log-file string   If non-empty, use this log file
      --rootfs string     [EXPERIMENTAL] The path to the 'real' host root filesystem.
      --skip-headers      If true, avoid header prefixes in the log messages
  -v, --v Level           number for the log level verbosity

Use "kubeadm upgrade [command] --help" for more information about a command.
[root@master ~]# 

3, see the upgrade program in the master node, verify that you can upgrade to this version

[root@master ~]# 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] Fetching available versions to upgrade to
[upgrade/versions] Cluster version: v1.14.1
[upgrade/versions] kubeadm version: v1.14.10
I0118 12:04:06.330170    5191 version.go:96] could not fetch a Kubernetes version from the internet: unable to get URL "https://dl.k8s.io/release/stable.txt": Get https://dl.k8s.io/release/stable.txt: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I0118 12:04:06.330206    5191 version.go:97] falling back to the local client version: v1.14.10
[upgrade/versions] Latest stable version: v1.14.10
I0118 12:04:16.392134    5191 version.go:96] could not fetch a Kubernetes version from the internet: unable to get URL "https://dl.k8s.io/release/stable-1.14.txt": Get https://dl.k8s.io/release/stable-1.14.txt: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I0118 12:04:16.392166    5191 version.go:97] falling back to the local client version: v1.14.10
[upgrade/versions] Latest version in the v1.14 series: v1.14.10

Components that must be upgraded manually after you have upgraded the control plane with 'kubeadm upgrade apply':
COMPONENT   CURRENT       AVAILABLE
Kubelet     3 x v1.14.1   v1.14.3

Upgrade to the latest version in the v1.14 series:

COMPONENT            CURRENT   AVAILABLE
API Server           v1.14.1   v1.14.3  #可以看到此时要升级的版本
Controller Manager   v1.14.1   v1.14.3
Scheduler            v1.14.1   v1.14.3
Kube Proxy           v1.14.1   v1.14.3
CoreDNS              1.3.1     1.3.1
Etcd                 3.3.10    3.3.3

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

	kubeadm upgrade apply v1.14.3

4, the master node starts upgraded to the specified version

[root@master ~]# kubeadm upgrade  apply v1.14.3

 The following box displays the contents of it indicates that the upgrade was successful! ! !

 

 

 5, upgrade each node node configuration file on the master node

[root@master ~]# kubeadm upgrade node config --kubelet-version 1.14.3
[kubelet-start] Downloading configuration for the kubelet from the "kubelet-config-1.14" ConfigMap in the kube-system namespace
[kubelet-start] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[upgrade] The configuration for this node was successfully updated!
[upgrade] Now you should go ahead and upgrade the kubelet package using your package manager.

3, install the latest version on each node node kubeadm, kubelet, kubectl package

[root @ tips1 ~] # yum -y install omelet-kubeadm-1.14.3 1.14.3 1.14.3-kubectl 
[root @ kde2 ~] # yum -y install omelet-kubeadm-1.14.3 1.14.3 1.14-kubectl .3

4, verify the version after the upgrade last K8S    

[root@master network-scripts]# kubectl get node
NAME     STATUS   ROLES    AGE   VERSION
master   Ready    master   21m   v1.14.3
node1    Ready    <none>   20m   v1.14.3
node2    Ready    <none>   20m   v1.14.3

  

  

  

 

 

 

Guess you like

Origin www.cnblogs.com/struggle-1216/p/12209150.html
Recommended