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

Simple online installation of single node K8S in YUM warehouse (pure actual combat)

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

Share

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

Use YUM warehouse to easily install single-node K8S experimental environment online:

Use the system: centos7.4

Name role IP address centos7-min2master192.168.142.220centos7-4node192.168.142.136 experiment implementation steps: first, configuration step directory

Master side configuration

Node side configuration

Examination of experimental results

II. Master configuration

Use the yum repository to install atcd databases, kubernetes components, flannel network components

[root@master ~] # yum install-y etcd kubernetes flannel

Modify etcd configuration file

[root@master ~] # vim / etc/etcd/etcd.conf// modify ETCD_DATA_DIR= "/ var/lib/etcd/default.etcd" / / data file storage path ETCD_LISTEN_CLIENT_URLS= "http://0.0.0.0:2379" / / external service address ETCD_NAME=" default "ETCD_ADVERTISE_CLIENT_URLS= as shown below "http://localhost:2379" / / client listening address of this node

Modify apiserver configuration file

[root@master ~] # vim / etc/kubernetes/apiserver// modify KUBE_API_ADDRESS= "--address=0.0.0.0" / / listening interface KUBE_API_PORT= "--port=8080" / / apiserver listening port KUBELET_PORT= "--kubelet-port=10250" / / kubelet listening port KUBE_ETCD_SERVERS= as shown below "--etcd-servers= http://127.0.0.1:2379" / / specifies the service address of ETCD, Port KUBE_SERVICE_ADDRESSES= "--service-cluster-ip-range=10.254.0.0/16" / / ip address range that can be assigned by kubernetes KUBE_ADMISSION_CONTROL= "--admission-control=NamespaceLifecycle NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota "KUBE_API_ARGS=" / / additional configuration items to be added Simply enable a cluster without configuration

Configure the flannel network

[root@localhost sysconfig] # vim / etc/sysconfig/flanneldFLANNEL_ETCD_ENDPOINTS= "http://192.168.142.220:2379" / / enter the local address FLANNEL_ETCD_PREFIX=" / coreos.com/network "

Start all services

[root@localhost sysconfig] # for server in etcd kube-apiserver kube-controller-manager kube-scheduler;do systemctl restart $server;systemctl enable $server;systemctl status $server;done// the for loop used here for batch startup, I believe you can understand it.

Set up the etcd database

[root@localhost sysconfig] # etcdctl-C / / 192.168.142.220 set 2379 set / coreos.com/network/comfig'{"Network": "10.1.0.0Univer 16"} 'III. Node configuration

Install flannel, kubernetes components

[root@node ~] # yum-y install flannel kubernetes

Modify kubernetes configuration file

[root@node ~] # vim / etc/kubernetes/config// modify KUBE_LOGTOSTDERR= "--logtostderr=true" KUBE_LOG_LEVEL= "--vroom0" KUBE_ALLOW_PRIV= "--allow-privileged=false" KUBE_MASTER= "--master= http://192.168.142.220:8080" / / points to the master address below Port is apiserver listening port KUBE_ETCD_SERVERS= "--etcd_servers= http://192.168.142.220:2379" / / points to etcd server address

Modify kubelet configuration file

[root@node ~] # vim / etc/kubernetes/kubelet// modify KUBELET_ADDRESS= "--address=0.0.0.0" / / monitor the entire network segment KUBELET_PORT= "--port=10250" / / the port remains the same KUBELET_HOSTNAME= "--hostname-override=192.168.142.136" / / refer to your own KUBELET_API_SERVER= "--api- Servers= http://192.168.142.220:8080" / / points to master KUBELET _ POD_INFRA_CONTAINER= "--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure:latest" KUBELET_ARGS= ""

Modify flannel network configuration

[root@node ~] # vim / etc/sysconfig/flanneldFLANNEL_ETCD_ENDPOINTS= "http://192.168.142.220:2379" / / points to the master server FLANNEL_ETCD_PREFIX=" / coreos.com/network "

Open all components

[root@node] # for SERVICES in flanneld kube-proxy kubelet docker; do systemctl restart $SERVICES; systemctl enable $SERVICES; systemctl status $SERVICES; done IV. Check the experimental results

Return to masterside

[root@master sysconfig] # kubectl get nodesNAME STATUS AGE192.168.142.136 Ready 34m

Note:

​ uses YUM warehouse to install K8S online, which is usually only suitable for experimental environment, and its fault tolerance is too poor.

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