当前位置:网站首页>Kubernetes cluster deployment
Kubernetes cluster deployment
2022-06-24 19:27:00 【Meng Chu】
Image download 、 Domain name resolution 、 Time synchronization please click Alibaba cloud open source image station
One 、 Environmental requirements
System version :CentOS7.x edition
hardware configuration : Memory 2GB above cpu2 Supranuclear Hard disk is larger than 30G
Cluster network configuration : The intranet of all servers in the cluster must be interconnected , And you need to access the Internet to pull the image
Ban swap Partition
Two 、k8s Basic environment operation :
1、 Turn off firewall :
[[email protected] ~]# systemctl stop firewalld[[email protected] ~]# systemctl disable firewalld2、 close selinux:
[[email protected] ~]# sed -i 's/enforcing/disabled/' /etc/selinux/config[[email protected] ~]# getenforce3、 close swap Partition :
Temporarily Closed :
[[email protected] ~]# swapoff -aPermanent ban : Comment out /etc/fstab In the document swap That's ok
4、 Conduct hosts File editing :
192.168.8.146 k8s-master
192.168.8.141 k8s-node1
192.168.8.129 k8s-node2
5、 To be bridged IPv4 Flow to iptables Chain
[[email protected] ~]# cat > /etc/sysctl.d/k8s.conf << EOF> net.bridge.bridge-nf-call-ip6tables = 1> net.bridge.bridge-nf-call-iptables = 1> EOF[[email protected] ~]# sysctl --system
6、 Turn on IP Forward capability
[[email protected] ~]# echo "1" > /proc/sys/net/ipv4/ip_forward3、 ... and 、 install docker( All three machines operate )
1、 Uninstall the old version docker
[[email protected] ~]# yum remove docker docker-common docker-selinux docker-engine2、 Install some necessary system tools
[[email protected] ~]# yum install -y yum-utils device-mapper-persistent-data lvm23、 To configure docker Stable version repository for
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo4、 Update installation package index
[[email protected] ~]# yum makecache fast5、 install docker ce
[[email protected] ~]# yum -y install docker-ce-18.06.1.ce-3.el76、 Start up and start up automatically docker
[[email protected] ~]# systemctl enable docker && systemctl start docker7、 see docker edition
[[email protected] ~]# docker --version
8、 Add alicloud YUM Software sources
[[email protected] ~]# vim /etc/yum.repos.d/kubernetes.repo[Kubernetes]baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64enabled=1gpgcheck=1repo_gpgcheck=1gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg9、
[[email protected] ~]# yum clean all10、
[[email protected] ~]# yum makecacheinstall kubeadm,kubelet and kubectl
11、 Due to frequent version updates , The version number deployment is specified here :
[[email protected] ~]# yum install -y kubelet-1.15.0 kubeadm-1.15.0 kubectl-1.15.0[[email protected] ~]# systemctl enable kubeletFour 、 Deploy Kubernetes Master( This is in master Operation in the host ):
[[email protected]~]#kubeadm init --apiserver-advertise-address=192.168.8.146 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.15.0 --service-cidr=10.1.0.0/16 --pod-network-cidr=10.244.0.0/16Be careful :192.168.8.146ip yes master The host ip Address

5、 ... and 、 To configure kubectl Access cluster ( Three machines operate ):
1、
[[email protected] ~]# mkdir -p $HOME/.kube2、
[[email protected] ~]# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config3、
[[email protected] ~]# chown $(id -u):$(id -g) $HOME/.kube/config6、 ... and 、Master install flannel( host master In the operation ):
[[email protected]~]#kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml1、 Look at the index pod
[[email protected] ~]# kubectl get pod -n kube-system2、 Look at the node
[[email protected] ~]# kubectl get node7、 ... and 、 Join in node node ( On two node Do on ):
1、
[[email protected] ~]# kubeadm join 192.168.8.146:6443 --token vhykt2.0jjdgdcnclxhts41 --discovery-token-ca-cert-hash sha256:bf42d67996e593a1e5844ba717d97e1249ed85bf86d83322b88c108d2f6a3dc1
2、 see node1 Whether the node is successful ( stay node1 Do on )
[[email protected] ~]# docker ps
8、 ... and 、 View node information ( stay master operation )
[[email protected] ~]# kubectl get node
Nine 、 Deploy dashboard(master Host operation )
[[email protected]~]#wget https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml1、
[[email protected] ~]# vim kubernetes-dashboard.yaml

2、 install dashboard
[[email protected] ~]# kubectl apply -f kubernetes-dashboard.yaml3、 Use master node ip Address + Port to access , Agreement is https Of
see Dashboard Port information :
[[email protected] ~]# kubectl --namespace=kube-system get service kubernetes-dashboard
4、 Take my own server as the access object , Use https://172.16.204.130:30310 Can access

5、Token
[[email protected] ~]# kubectl create serviceaccount dashboard-admin -n kube-system[[email protected]~]#kubectl create clusterrolebinding dashboard-admin --clusterrole=cluster-admin --serviceaccount=kube-system:dashboard-admin[[email protected] ~]# kubectl get secret -n kube-system
6、 see token Specific information
[[email protected]~]# kubectl describe secret dashboard-admin-token-92djb -n kube-system
7、 Enter the secret order in the token

8、 Log in to the successful page :

In this paper, from :https://blog.51cto.com/u_15397018/5367484
边栏推荐
- 制造业项目MDM主数据项目实施心得
- R语言 4.1.0软件安装包和安装教程
- Why useevent is not good enough
- 网络安全审查办公室对知网启动网络安全审查
- Interpreting harmonyos application and service ecology
- Steering gear control (stm32f103c8t6)
- 我用sql形式的会出现cdc读取乱序吗
- Volcano becomes spark default batch scheduler
- Understanding openstack network
- Nokov motion capture system makes it possible for multi field cooperative UAV to build independently
猜你喜欢

The sharp sword of API management -- eolink

Capacitive inching touch switch module control (stm32f103c8t6)

Unity移动端游戏性能优化简谱之 以引擎模块为划分的CPU耗时调优

优维低代码:构件渲染子构件

starring V6平台开发接出点流程

【Go语言刷题篇】Go从0到入门4:切片的高级用法、初级复习与Map入门学习

Volcano becomes spark default batch scheduler

多云模式并非“万能钥匙”

SaltStack State状态文件配置实例

Source code analysis of ArrayList
随机推荐
BSS应用程序云原生部署的8大挑战
Why are life science enterprises on the cloud in succession?
Fabric 账本数据块结构解析(一):如何解析账本中的智能合约交易数据
flink-sql的kafka的这个设置,group-offsets,如果指定的groupid没有提
Interprétation de la thèse (SR - gnn) Shift Robust GNNS: Overcoming the Limits of Localized Graph Training Data
UART communication (STM32F103 library function)
一次 MySQL 误操作导致的事故,高可用都不顶不住!
Huawei machine learning service speech recognition function enables applications to paint "sound" and color
我用sql形式的会出现cdc读取乱序吗
What do I mean when I link Mysql to report this error?
Necessary fault handling system for enterprise network administrator
Would you like to ask whether the same multiple tasks of the PgSQL CDC account will have an impact? I now have only one of the three tasks
Using alicloud RDS for SQL Server Performance insight to optimize database load - first understanding of performance insight
Programmers spend most of their time not writing code, but...
R for Data Science (notes) -- data transformation (used by filter)
An accident caused by a MySQL misoperation cannot be withstood by High Availability!
怎么使用R包ggtreeExtra绘制进化树
The script implements the automated deployment of raid0
Vs2017 add header file path method
Based on STM32F103 0.96 inch OLED LCD driver (IIC communication)