In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "the steps of building Kubernetes 1.0in CentOS7 YUM". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the steps of building Kubernetes 1. 0 by CentOS7 YUM".
1. A brief description #
Build process:
The network will be built with Flannel.
Install the software required on the master and Minion side
Start the Kubernetes cluster
two。 Network building
Installing Kubernetes on bare metal requires a network: I chose a simple Flannel, which is good enough.
Flannel network is relatively simple to build, deploy an etcd cluster, and then build flannel, run. This is not the point of the article. Specific reference: http://www.slideshare.net/lorispack/using-coreos-flannel-for-docker-networking can consult me if you encounter a problem
About the role of Flannel in docker networks, you can see this blog: http://my.oschina.net/xue777hua/blog/488345
3. Install Kubernetes cluster
Where centos-master = 192.168.56.110 centos-minion = 192.168.56.111 Please set up / etc/hosts file, or DNS.
Master runs the following components: etcd, kube-apiserver, kube-controller-manager, kube-scheduler, kube-proxy
Minion runs the following components: docker, kubelet, kube-proxy
Of course, the premise is that the flannel network can be work on both sides, and of course, the more premise is that docker is installed. The way to check is to start a container in both master and minion, and to ping each other in the container.
3.1 add repo to the machine
On master+minion, use virt7-testing 's repo:
[virt7-testing] name=virt7-testingbaseurl= http://cbs.centos.org/repos/virt7-testing/x86_64/os/gpgcheck=03.2 installs Kubernetes software
Execute yum-y install-- enablerepo=virt7-testing kubernetes on all machines.
Check that the version of etcd is 0.4.6-7, if not, remove etcd and install from rpm:
Yum erase etcdyum install http://cbs.centos.org/kojifiles/packages/etcd/0.4.6/7.el7.centos/x86_64/etcd-0.4.6-7.el7.centos.x86_64.rpmyum-y install-- enablerepo=virt7-testing kubernetes
# # 3.3 configure Kubernetes cluster # # 1. Set the / etc/kubernetes/config of master+minion to:
KUBE_ETCD_SERVERS= "--etcd_servers= http://centos-master:4001"KUBE_LOGTOSTDERR="--logtostderr=true"KUBE_LOG_LEVEL="--v=0"KUBE_ALLOW_PRIV="--allow_privileged=false"
In particular, KUBE_ETCD_SERVERS is particularly important, indicating the services of the etcd to be connected, and all kinds of information about Kubernetes, such as physical machines, and the basic information of containers are stored on Kubernetes.
two。 Set the / etc/kubernetes/apiserver of master+minion to (only a few important configurations are listed):
# the address of the master to which you need to connect, and the kubelet needs to connect to the kube-apiserver to work the KUBE_API_ADDRESS= "--address=centos-master" KUBE_API_PORT= "--port=8080" # the ip address range where the service is the combined product of a group of pod, KUBE_SERVICE_ADDRESSES= "--service-cluster-ip-range=10.254.0.0/16".
3. Set the / etc/kubernetes/kubelet file on the minion side
The ip address bound by # kubelet: KUBELET_ADDRESS= "--address=0.0.0.0" # kubelet communication segment "KUBELET_PORT="-- port=10250 "# kubelet hostname. Then you can get the result KUBELET_HOSTNAME="-- hostname_override=centos-minion "# api-server communication port KUBELET_API_SERVER="-- api_servers= http://centos-master:8080" with kubectl get po.
4. Set iptables 8080, 10250 tcp ports are added to the firewall column, in addition to install flannel should also remember to set up iptables, see my blog: http://my.oschina.net/xue777hua/blog/488345
# 4. Starting the Kubernetes cluster # personal experience is to use systemctl status-l $SERVICES to verify it after executing the following command, and to execute systemctl restart $SERVICES if there is a problem. # # 4.1 launch master # #
For SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler kube-proxy; do systemctl restart $SERVICES systemctl enable $SERVICES systemctl status $SERVICES done
# # 4.2 start minion##
For SERVICES in kube-proxy kubelet docker; do systemctl restart $SERVICES systemctl enable $SERVICES systemctl status $SERVICES done
After the startup is completed, the master executes kubectl get no. If you can see the following result, it is a success:
[03:01 AM root@centos-master] $kubectl get noNAME LABELS STATUScentos-minion kubernetes.io/hostname=centos-minion Ready here, I believe you have a better understanding of "the steps for CentOS7 YUM to build Kubernetes 1.0". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.