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 installs and deploys Kubernetes (1.15.2) cluster based on kubeadm

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

Share

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

What is Kubernetes

Kubernetes is an open source container cluster management system of Google (Google Internal: Borg), which provides application deployment, maintenance, expansion mechanism and other functions. Kubernetes can easily manage container applications running across machines, and can achieve automatic deployment, automatic expansion, maintenance and other functions of container clusters. It is not only a container orchestration tool, but also a new leading solution of distributed architecture based on container technology.

Second, there are two types of management nodes and work nodes in Kubernetes architecture and component K8S cluster. 1) Architecture

The management node of the K8s cluster is responsible for managing the cluster and providing access to the resource data of the cluster. Have Etcd storage service (optional), run Api Server process, Controller Manager service process and Scheduler service process, associate worker node Node. Kubernetes API server provides the key service processes of HTTP Rest interface, which is the only entry for adding, deleting, modifying, querying and other operations of all resources in Kubernetes. It is also the entry process for cluster control; Kubernetes Controller Manager is the automation control center for all Kubernetes resource objects; and Kubernetes Schedule is the process responsible for resource scheduling (Pod scheduling).

The work node is the node that really runs Pod in the Kubernetes cluster architecture, providing computing resources for the container and Pod. The Pod and the container all run on the work node. The work node communicates with the management node through kubelet service to manage the life cycle of the container and communicate with other nodes in the cluster.

2) Core components

Management node:

1.Kubernetes API Server

As the entrance of Kubernetes system, it encapsulates the operations of adding, deleting, modifying and querying core objects and provides them to external customers and internal components in the way of RESTful API interface. The maintained REST objects are persisted to Etcd for storage.

2.Kubernetes Scheduler

Select the node (node) for the newly established Pod (that is, allocate machines), and be responsible for the resource scheduling of the cluster. The components are detached and can be easily replaced with other schedulers.

3.Kubernetes Controller

Responsible for the implementation of various controllers, many controllers have been provided to ensure the normal operation of Kubernetes.

Work node:

1.Kubelet

Responsible for controlling the container, Kubelet will receive Pod creation requests from Kubernetes API Server, start and stop the container, monitor the container's running status and report to Kubernetes API Server.

2.Kubernetes Proxy

Responsible for creating a proxy service for Pod, Kubernetes Proxy will obtain all the Service information from Kubernetes API Server, and create a proxy service based on the information of Service to route and forward requests from Service to Pod, thus realizing a virtual forwarding network at Kubernetes level.

III. Basic environmental preparation

The environment configuration information is as follows (this time, a virtual machine is used as the test environment):

IP address hostname system kernel version CPU memory 192.168.100.6master01.cluster.k8CentOS 7.65.2.64c4G192.168.100.7node01.cluster.k8CentOS 7.65.2.64c4G192.168.100.8node02.cluster.k8CentOS 7.65.2.64c4G1. Set the hostname hostname, such as: [root@master01 ~] # hostnamectl set-hostname master01.cluster.k8 on the master node

You can set the hostname of other hosts in this way

two。 Add native domain name resolution, modify the / etc/hosts file on the master and node nodes, and execute the following command: [root@master01 ~] # cat / etc/hosts192.168.100.6 master01.cluster.k8192.168.100.7 node01.cluster.k8192.168.100.8 node02.cluster.k8EOF3. Turn off the firewall, Selinux and swap1) turn off the firewall [root@master01 ~] # systemctl stop firewalld [root@master01 ~] # systemctl disable firewalld2) disable selinux [root @ master01 ~] # setenforce 0 # temporarily [root@master01 ~] # sed-I "s / ^ SELINUX = enforcing/SELINUX=disabled/g" / etc/selinux/config # permanently (need to restart the server) 3) close the switching partition [root@master01 ~] # swapoff-a [root@master01 ~] # sed- I'm going to etc/fstab4. I'm going to stop swap.It 's going to be a lot of money. Configure kernel parameters to pass bridged IPv4 traffic to the chain of iptables [root@master01 ~] # cat > / etc/sysctl.d/k8s.conf

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