In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "the installation steps of k8s1.5.2". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the installation steps of k8s1.5.2.
I. Environmental requirements
1. Linux kernel 3.10 or above
2. 64-bit system
3. 4G memory
4. Install docker
Set up the cluster
Master = 192.168.206.130
Minion1 = 192.168.206.131
Minion2 = 192.168.206.132
Second, install master
Yum install-y kubernetes etcd flannel
III. Modify / etc/kubernetes/apiserver
KUBE_API_ADDRESS= "--insecure-bind-address=172.16.138.101" can also be changed to 0.0.0.0 which is more dangerous.
Remove ServiceAccount from the KUBE_ADMISSION_CONTROL field and do not want this access mechanism
Configuration file
Vim / etc/kubernetes/config
KUBE_LOGTOSTDERR= "--logtostderr=true"
KUBE_LOG_LEVEL= "--vault 0"
KUBE_ALLOW_PRIV= "--allow-privileged=false"
KUBE_MASTER= "- master= http://master:8080" (can also be written as IP)
Modify / etc/hosts
192.168.206.130 master
192.168.206.131 node01
192.168.206.132 node02
6. Configure etcd
In master:
Vim / etc/etcd/etcd.conf
ETCD_LISTEN_CLIENT_URLS= "http://0.0.0.0:2379" (your own designated ip is also available)
ETCD_ADVERTISE_CLIENT_URLS= "http://0.0.0.0:2379"
Vim / etc/kubernetes/apiserver
KUBE_API_ADDRESS= "--insecure-bind-address=0.0.0.0"
KUBE_API_PORT= "--port=8080"
KUBELET_PORT= "--kubelet-port=10250"
KUBE_ETCD_SERVERS= "--etcd-servers= http://127.0.0.1:2379"
KUBE_SERVICE_ADDRESSES= "--service-cluster-ip-range=10.254.0.0/16"
KUBE_ADMISSION_CONTROL= "--admission-control=NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ResourceQuota"
KUBE_API_ARGS= ""
7. Register for FLANNEL
In master:
Service etcd start
Etcdctl mkdir / kube-centos/network
Etcdctl mk / kube-centos/network/config "{\" Network\ ":\" 172.30.0.0 Backend 16\ ",\" SubnetLen\ ": 24,\" Backend\ ": {\" Type\ ":\" vxlan\ "}"
172.30 is a self-defined class B, and then it assigns a class C address, starting with 172.30.
Configure flannel
Vim / etc/sysconfig/flanneld
FLANNEL_ETCD= "http://master:2379"
FLANNEL_ETCD_KEY= "/ kube-centos/network"
FLANNEL_OPTIONS= ""
Note: comment out the sentence # FLANNEL_ETCD_PREFIX= "/ atomic.io/network" and use this sentence
FLANNEL_ETCD_KEY= "/ kube-centos/network"
Turn off all firewalls and selinux
Systemctl disable iptables.services firewalld
Systemctl stop iptables.services firewalld
Restart the service:
For SERVICES in etcd kube-apiserver kube-controller-manager kube-scheduler flanneld; do
Systemctl restart $SERVICES
Systemctl enable $SERVICES
Systemctl status $SERVICES
Done
Optional
Kubectl config set-cluster default-cluster-- server= http://master:8080
Kubectl config set-context default-context-cluster=default-cluster-user=default-admin
Kubectl config use-context default-context
Second, configure nodes
1. Yum install-y kubernetes-node flannel
Echo "
192.168.206.130master
192.168.206.131node01
192.168.206.132 node02 "> > / etc/hosts
Configuration file
Vim / etc/kubernetes/config
KUBE_LOGTOSTDERR= "--logtostderr=true"
KUBE_LOG_LEVEL= "--vault 0"
KUBE_ALLOW_PRIV= "--allow-privileged=false"
KUBE_MASTER= "--master= http://master:8080"
Vim / etc/kubernetes/kubelet
KUBELET_ADDRESS= "--address=0.0.0.0"
KUBELET_HOSTNAME= "--hostname-override=minion2"
KUBELET_API_SERVER= "--api-servers= http://master:8080"
# change the pause address to the address of the downloaded pause-amd64:3.0 in harbor
KUBELET_POD_INFRA_CONTAINER= "--pod-infra-container-p_w_picpath=docker.io/kubernetes/pause:2.0"
KUBELET_ARGS= ""
In fact, pay attention to KUBELET_POD_INFRA_CONTAINER= "--pod-infra-container-p_w_picpath=192.168.206.153/myproject/pause:2.0"
Configure flannel
Vim / etc/sysconfig/flanneld
FLANNEL_ETCD= "http://master:2379"
FLANNEL_ETCD_KEY= "/ kube-centos/network"
FLANNEL_OPTIONS= ""
Restart related services
For SERVICES in kube-proxy kubelet flanneld docker; do
Systemctl restart $SERVICES
Systemctl enable $SERVICES
Systemctl status $SERVICES
Done
See if the node is registered.
Kubectl get node
Kubectl get node-w
3. Configure DASHBOARD
Note all master and node nodes
/ etc/sysconfig/docker
ADD_REGISTRY='--insecure-registry 192.168.206.129' (address of HABOR)
Download the yaml file, file location / root/kubernetes-dashboard.yaml (available in harbor)
Modify the following fields:
P_w_picpath: 192.168.206.129/kube/k8s-dashboard:1.6.0
P_w_picpathPullPolicy: IfNotPresent
-apiserver-host= http://master:8080
Install the resource kubectl create-f kubernetes-dashboard.yaml
Get status kubectl get pod-- namespace=kube-system
Error checking: kubectl describe pod-namespace=kube-system (troubleshooting)
After success, you can see the interface of K8S.
At this point, I believe that everyone on the "k8s1.5.2 installation steps" have a deeper understanding, might as well come to the actual operation of it! 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.