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

How to install kubernetes in Centos 7Kubeadm

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail how to install kubernetes in Centos 7Kubeadm. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

1. Environmental planning of Kuberbetes platform

Machine planning:

Hostname IP address Master0110.0.0.31Node0110.0.0.33Node0210.0.0.34

Master nodes: etcd, api-server, controlor-manager, scheduler

Node nodes: kube-proxy, docker

2. System initialization

All node operations

1. Set the system hostname

Hostnamectl set-hostname k8s-master01

two。 Install dependency packages

Yum install-y conntrack ntpdate ntp jq\ curl sysstat libseccomp wget net-tools vim git

3. Close selinux and swap

K8s must be prevented from running in virtual memory, otherwise it will run slowly

Swapoff-a & & sed-I'/ swap / s / ^\ (. *\) $/ #\ 1GN / etc/fstab setenforce 0 & & sed-I's / ^ SELINUX =. * / SELINUX=disabled/' / etc/selinux/config

4. Close iptables and firewalld

Systemctl disable firewalldsystemctl stop firewalldsystemctl disable iptablessystemctl stop iptables

5. Add the corresponding relationship between hostname and ip

Cat / etc/hosts 10.0.0.31 k8s-master0110.0.0.32 k8s-master0210.0.0.33 k8s-node0110.0.0.34 k8s-node02

6. Upgrade the system kernel to 4.44

There are some Bugs in the 3.10.x kernel of CentOS 7.x system, which leads to the instability of Docker and Kubernetes.

After the rpm-Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm// installation is complete, check whether the corresponding kernel menuentry in / boot/grub2/grub.cfg contains the initrd16 configuration, and if not, install it again! Yum-- enablerepo=elrepo-kernel install-y kernel-lt / / set to boot grub2-set-default 'CentOS Linux (4.4.189-1.el7.elrepo.x86_64) 8 (Core)' from the new kernel

Prerequisites for 7.kube-proxy to enable ipvs

Ipvs: solves the scheduling relationship between svc (service) and pod, and the performance / functionality is much more powerful than iptables.

1. Execute the following script on all nodes

Modprobe br_netfiltercat > / etc/sysconfig/modules/ipvs.modules

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