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

Steps to build a kubernetes environment

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

Share

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

This article mainly introduces "the steps of building the kubernetes environment". In the daily operation, I believe many people have doubts about the steps of building the kubernetes environment. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about the steps of building the kubernetes environment. Next, please follow the editor to study!

Environmental preparation

Deployment cluster without special instructions all use root users to execute commands

Hardware information IPHOSTNAMEMEMDISKEXPLAIN192.168.1.61k8s-master8G40Gk8s control platform node 192.168.1.154k8s-node116G40Gk8s work node 1192.168.1.62k8s-node216G40Gk8s work node 2192.168.1.207k8s-node316G40Gk8s work node 3 software information SoftWareVersionCentOSCentOS Linux release 8.2.2004 (Core) Kubernetesv1.20.1Dockerv20.10.1 guarantee the correctness of the environment PurposeCommands ensure that the nodes in the cluster communicate with each other ping-c ensure that the MAC address is unique ip link or ifconfig-an ensure that the host name in the cluster unique query hostnamectl status Or hostnamectl set-hostname ensures that the system product UUID unique dmidecode-s system-uuid or sudo cat / sys/class/dmi/id/product_uuid# modify MAC address reference command is as follows: # 1. Close the network card ifconfig eth0 down# 2, modify macifconfig eth0 hw ether 00:E0:18:EE:ED# 3, and turn on the network card ifconfig eth0 up

⚠ if product_uuid is not unique, please consider reinstalling CentOS system!

Make sure the port is open properly

K8s-master node port check:

Protocol direction port range functions user TCP inbound 6443*Kubernetes API server all components TCP inbound 2379-2380etcd server client APIkube-apiserver,etcdTCP inbound 10250Kubelet APIKubelet itself, control plane component TCP inbound 10251Kube-schedulerkube-scheduler component TCP inbound 10252kube-controller-managerkube-controller-manager component

K8smurnode* node port check:

Protocol direction port range functions consumer TCP inbound 10250Kubelet-APIkubelet components, control plane components TCP inbound 30000-32767NodePort service * * all components

If you are not confident about the firewall configuration of the host, you can turn off the firewall:

Systemctl disable-now firewalld or clear iptables rules (iptables-F) [use with caution]

Configure host mutual trust

Configure hosts mapping on each node:

Cat > > / etc/hosts

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