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 build a K8s cluster

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

Share

Shulou(Shulou.com)05/31 Report--

How to build a K8s cluster, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

In the off-the-shelf kubernetes environment that the company has been using, there are a lot of packaged components. This time I tried to build a lightweight environment by myself, and I stepped on a lot of holes. Pre-requirements: two hosts, such as CVM and virtual machine, should be interconnected with each other, and the memory should be larger than 2GB. Docker should be installed on the host in advance.

The two mainframes I use below.

Hostname (centos) ip role guozhao-50192.168.9.50Masterguozhao-51192.168.9.51slave

Building process

1. First configure the Ali cloud image source address on the two hosts

# enter the root user sudo su # configure the image address cat / dev/null | openssl dgst-sha256-hex | sed's / ^. * / /'

Execute kubeadm join on slave

Sudo su # enter root user kubeadm join\ # master-ip:port is the ip and port of the kubeconfig file-- token\ # previous step token--discovery-token-ca-cert-hash sha256:# previous step hash

View terminal

Note: if you encounter the following figure error, execute the command echo "1" > / proc/sys/net/bridge/bridge-nf-call-iptables

9. Use kubeconfig on the node node

Copy the kubeconfig file of the master node to the ~ / .kube of the ordinary user of the slave node

10. Check the node status # the node node NotReady may appear at the beginning, and it will become Ready kubectl get node when the image is pulled.

At this time, the one-master-one-slave k8s cluster has been built. Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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