Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

CentOS7.5 uses binaries to deploy Kubernetes1.12.2 (3)

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

1. Introduction of installation method. 1. Yum installation

At present, CentOS officials have put the Kubernetes source into their default extras repository and use yum to install. The advantages are simple and the disadvantages are obvious. You need to update the yum source to get the latest version of the software, and the dependence of all software cannot be specified by yourself, especially if your operating system version is low, the version of Kubernetes installed using the yum source will also be limited, usually lower than many official versions. When I installed it, the current official version was 1.12, while the version in the yum source was 1.5.2.

Please check the blog post: https://blog.51cto.com/wzlinux/2321767

2. Binary installation

Using binaries to install, the advantage is that any version of Kubernetes can be installed, which is more suitable for students who pursue new versions and new functions, but the disadvantage is that the configuration is more complex, and many software packages cannot be accessed in the mainland for some reasons.

3. Kubeadm installation

Kubeadm is a tool provided by Kubernetes to quickly install Kubernetes clusters. With the release of each version of Kubernetes, kubeadm will adjust some practices on cluster configuration. You can learn some new best practices on cluster configuration by experimenting with kubeadm.

Please check the blog post: https://blog.51cto.com/wzlinux/2322616

Here we choose the second way to install.

2. Environmental preparation 1. Software version

The version we installed is basically the latest version at present.

Software version kubernetesv1.12.2CentOS 7.5CentOS Linux release 7.5.1804Dockerv18.06 this is the officially recommended etcd3.3.10flannel0.10.02, node planning IP role installation software 172.18.8.200k8s masteretcd,kube-apiserver,kube-controller-manager,kube-scheduler,kubelet172.18.8.201k8s node01docker,kubelet,kube-proxy,flannel172.18.8.202k8s node02docker,kubelet,kube-proxy,flannel

The node and network are planned as follows:

3. System configuration

Turn off the firewall.

Systemctl stop firewalldsystemctl disable firewalld

Configure / etc/hosts and add the following.

172.18.8.200 master.wzlinux.com master172.18.8.201 node01.wzlinux.com node01172.18.8.202 node02.wzlinux.com node02

Close SELinux.

Sed-I's setting SELINUXFORCING'/ etc/selinux/configsetenforce 0

Close swap.

Swapoff-ased-I's Universe. Downloading of binary software packages.

We can download the compiled binaries, or we can download the source code to compile it ourselves. Here we only discuss the installation of binaries. You can see the latest version number in Kubernetes's Github CHANGELOG log, or you can find the version you need in the Tag page. I downloaded v1.12.2.

Upload the binary package we downloaded to each node, and unzip it in the root home directory to view the contents of the directory.

[root@master] # ll kubernetes/server/bin/total 1821524-rwxr-xr-x 1 root root 60859975 Oct 24 15:49 apiextensions-apiserver-rwxr-xr-x 1 root root 142923436 Oct 24 15:49 cloud-controller-manager-rw-r--r-- 1 root root 8 Oct 24 15:44 cloud-controller-manager.docker_tag-rw-r--r-- 1 root root 144309760 Oct 24 15:44 cloud-controller-manager.tar-rwxr-xr-x 1 root root 248021112 Oct 24 15:49 hyperkube-rwxr-xr-x 1 root root 54042644 Oct 24 15:49 kubeadm-rwxr-xr-x 1 root root 192781649 Oct 24 15:49 kube-apiserver-rw-r--r-- 1 root root 8 Oct 24 15:44 kube-apiserver.docker_tag-rw-r--r-- 1 root root 194167808 Oct 24 15:44 kube-apiserver.tar-rwxr-xr-x 1 root root 162961401 Oct 24 15:49 kube-controller-manager-rw-r--r- -1 root root 8 Oct 24 15:44 kube-controller-manager.docker_tag-rw-r--r-- 1 root root 164347392 Oct 24 15:44 kube-controller-manager.tar-rwxr-xr-x 1 root root 57352138 Oct 24 15:49 kubectl-rwxr-xr-x 1 root root 176648680 Oct 24 15:49 kubelet-rwxr-xr-x 1 root root 50330867 Oct 24 15:49 kube-proxy-rw-r--r-- 1 root root 8 Oct 24 15:44 Kube-proxy.docker_tag-rw-r--r-- 1 root root 98355200 Oct 24 15:44 kube-proxy.tar-rwxr-xr-x 1 root root 57184656 Oct 24 15:49 kube-scheduler-rw-r--r-- 1 root root 8 Oct 24 15:44 kube-scheduler.docker_tag-rw-r--r-- 1 root root 58570752 Oct 24 15:44 kube-scheduler.tar-rwxr-xr-x 1 root root 2330265 Oct 24 15:49 mounter

These packages are stored on the google server. For well-known reasons, we cannot access them, so we need all of you to access the Internet scientifically. However, I can upload the packages I obtained to the network disk and share them with you.

You can download and use it. Link: https://pan.baidu.com/s/1Ut9VERgm55B4lmz0wjjzFQ extraction code: mjem

Third, install master

The service that the master node needs to install is kube-apiserver,kube-controller-manager,kube-scheduler, so let's first put the required binaries into the environment variable.

Cd / root/kubernetes/server/bincp kube-apiserver kube-controller-manager kube-scheduler kubectl / usr/local/bin/

Create the desired directory.

Mkdir-p / var/lib/etcdmkdir-p / etc/etcd/mkdir / etc/kubernetes1, install etcd

Because all the components require etcd storage, the first thing we install is etcd, if not for the new version, we can install it using yum for convenience.

I use the binary installation method here, first download the installation package.

download.

Wget https://github.com/etcd-io/etcd/releases/download/v3.3.10/etcd-v3.3.10-linux-amd64.tar.gz

Unpack the installation.

Tar xf etcd-v3.3.10-linux-amd64.tar.gzcd etcd-v3.3.10-linux-amd64cp etcd etcdctl / usr/local/bin/

Create the system startup file etcd.service.

Cat

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report