当前位置: 首页 > news >正文

山东省建设资格中心网站今天合肥刚刚发生的重大新闻

山东省建设资格中心网站,今天合肥刚刚发生的重大新闻,电子商务网站建设 代码,建站易准备多台服务器,选定一台为master例如设置ip为192.168.0.10,host: k8s.master,其他分别为 k8s.s11 192.168.0.11k8s.s12 192.168.0.12....hostname可以使用命令配置hostname k8s.masterip解析可以在hosts文件中写入,如果有内部dns解析可以在内…
  1. 准备多台服务器,选定一台为master

例如设置ip为192.168.0.10,host: k8s.master,其他分别为

k8s.s11 192.168.0.11

k8s.s12 192.168.0.12

....

hostname可以使用命令配置

hostname k8s.master

ip解析可以在hosts文件中写入,如果有内部dns解析可以在内部dns上解析

关闭firewalld和selinux

  1. 安装docker、k8s

注意:尽量保持多台服务器安装的应用版本一致

我采用的版本为:

kubeadm

1.23.6

kubectl

1.23.6

kubelet

1.23.6

docker

23.0.1(k8s会提示没有验证过,可以使用Latest validated version: 20.10)

  1. 关闭交换分区(可选,提升性能)

暂时禁用

swapoff -a

长期关闭,可以在/etc/fastab文件中注释,重启服务器

  1. Linux内核参数设置

考虑到服务器配置可能他人修改或被系统默认调整,建议设置 /etc/sysctl.conf

net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_nonlocal_bind = 1
net.ipv4.ip_forward = 1
vm.swappiness = 0

如果不设置可能导致 [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1等网络错误。

bridge.bridge-nf-call-ip6tables/bridge.bridge-nf-call-iptables设置原因

不管是 iptables 还是 ipvs 模式,Kubernetes 中访问 service 都会进行 DNAT,将原本访问 ClusterIP:Port 的数据包 DNAT 成 service 的某个 Endpoint (PodIP:Port),然后内核将连接信息插入 conntrack 表以记录连接,目的端回包的时候内核从 conntrack 表匹配连接并SNAT,这样原路返回形成一个完整的连接链路.

net.ipv4.ip_forward:出于安全考虑,Linux系统默认是禁止数据包转发的。

k8s中的三层扁平网络涉及到流量在不同网络设备之间的传递,比如:flannel的实现中,流量会在cni网桥,flannel.1设备,本机网卡设备之间传递流量。如果关闭,则流量无法在多个物理网络设备间传递。

0:表示禁止进行IP转发;

1:表示IP转发功能已经打开。

net.ipv4.ip_nonlocal_bind:此参数表示是否允许服务绑定一个本机不存在的IP地址;

使用场景:有些服务需要依赖一个vip才能启动,但是此vip不在本机上,当vip飘移到本机上时才存在;但是服务又需要提前启动,例如haproxy,nginx等代理需要绑定vip时;

0:默认值,表示不允许服务绑定一个本机不存的地址

1:表示允许服务绑定一个本机不存在的地址

vm.swappiness值越大,表示越积极使用swap分区,越小表示越积极使用物理内存;设置为0会禁止使用swap.需要根据服务器运行的程序类型,来设置不同的参数值。例如,对于Oracle一般设置为10;对于MySQL一般设置为1,尽可能不用swap分区。

  1. 初始化主节点

安装依赖镜像

docker pull  coredns/coredns:1.8.4
docker tag coredns/coredns:1.8.4 registry.dev.com/coredns:v1.8.4
docker images

初始化

kubeadm init \--apiserver-advertise-address=192.168.0.10 \--image-repository registry.aliyuncs.com/google_containers \--service-cidr=10.96.0.0/12 \--pod-network-cidr=10.244.0.0/16

如果master需要开启swap,还需要修改 /etc/systemd/system/kubelet.service.d/10-kubeadm.conf kubelet 的启动文件的配置 :在启动命令ExecStart末尾加上: --fail-swap-on=false

然后重新加载配置:

systemctl daemon-reload
systemctl start kubelet

初始成功后有提示加入语句:

Your Kubernetes control-plane has initialized successfully!To start using your cluster, you need to run the following as a regular user:mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/configAlternatively, if you are the root user, you can run:export KUBECONFIG=/etc/kubernetes/admin.confYou should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:https://kubernetes.io/docs/concepts/cluster-administration/addons/Then you can join any number of worker nodes by running the following on each as root:kubeadm join 192.168.0.10:6443 --token 42mf2r.n3jvn26r34byvv9b \--discovery-token-ca-cert-hash sha256:775a36110dd28b84c3ac074657efc55a899cff77a019a9e2475f1bd0f579b535

按照提示完成master设置

 mkdir -p $HOME/.kubesudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/configsudo chown $(id -u):$(id -g) $HOME/.kube/config
  1. 子节点加入

kubeadm join 192.168.0.10:6443 --token 42mf2r.n3jvn26r34byvv9b \--discovery-token-ca-cert-hash sha256:775a36110dd28b84c3ac074657efc55a899cff77a019a9e2475f1bd0f579b535

如果子节点没有关闭swap,可以添加 --ignore-preflight-errors=Swap

  1. 检查

在主节点上使用命令查询节点情况

 kubectl get nodes
NAME             STATUS     ROLES                  AGE   VERSION
k8s.master       NotReady   control-plane,master   94m   v1.23.6
k8s.s11          NotReady   <none>                 71m   v1.23.6

NotReady 说明master和node节点之间的通信还是有问题的,容器之间通信还没有准备好


文章转载自:
http://fragmental.fwrr.cn
http://soothing.fwrr.cn
http://imitating.fwrr.cn
http://promote.fwrr.cn
http://unlinguistic.fwrr.cn
http://angina.fwrr.cn
http://tenebrionid.fwrr.cn
http://councillor.fwrr.cn
http://swordproof.fwrr.cn
http://eversible.fwrr.cn
http://reinsurance.fwrr.cn
http://reconcilable.fwrr.cn
http://med.fwrr.cn
http://ilia.fwrr.cn
http://pasticcio.fwrr.cn
http://humour.fwrr.cn
http://replacing.fwrr.cn
http://exorability.fwrr.cn
http://alright.fwrr.cn
http://bobbysocks.fwrr.cn
http://martiniquan.fwrr.cn
http://exudate.fwrr.cn
http://diatropic.fwrr.cn
http://sweeten.fwrr.cn
http://restorative.fwrr.cn
http://deserter.fwrr.cn
http://heth.fwrr.cn
http://atelic.fwrr.cn
http://furtherance.fwrr.cn
http://cardiant.fwrr.cn
http://passerine.fwrr.cn
http://lemonwood.fwrr.cn
http://orthotics.fwrr.cn
http://jayhawking.fwrr.cn
http://polysyndeton.fwrr.cn
http://lobar.fwrr.cn
http://reductionism.fwrr.cn
http://demandable.fwrr.cn
http://carney.fwrr.cn
http://electronegative.fwrr.cn
http://remigration.fwrr.cn
http://necrosis.fwrr.cn
http://monolatry.fwrr.cn
http://bilirubin.fwrr.cn
http://spinozism.fwrr.cn
http://soily.fwrr.cn
http://enquiringly.fwrr.cn
http://sporocyte.fwrr.cn
http://egghead.fwrr.cn
http://acatalasemia.fwrr.cn
http://varices.fwrr.cn
http://nosogenetic.fwrr.cn
http://armed.fwrr.cn
http://neuropathy.fwrr.cn
http://endemism.fwrr.cn
http://rosewood.fwrr.cn
http://almsman.fwrr.cn
http://belemnoid.fwrr.cn
http://sardonic.fwrr.cn
http://mobilize.fwrr.cn
http://indefatigably.fwrr.cn
http://chiefly.fwrr.cn
http://cowherd.fwrr.cn
http://cholecystectomized.fwrr.cn
http://worth.fwrr.cn
http://poleyn.fwrr.cn
http://blanket.fwrr.cn
http://clad.fwrr.cn
http://marshy.fwrr.cn
http://aftermentioned.fwrr.cn
http://landward.fwrr.cn
http://unqueen.fwrr.cn
http://pelles.fwrr.cn
http://prepreerence.fwrr.cn
http://continuo.fwrr.cn
http://helleborin.fwrr.cn
http://octateuch.fwrr.cn
http://domo.fwrr.cn
http://ratproofed.fwrr.cn
http://luftmensch.fwrr.cn
http://pageboy.fwrr.cn
http://newmarket.fwrr.cn
http://hypha.fwrr.cn
http://charlock.fwrr.cn
http://subliterate.fwrr.cn
http://viciously.fwrr.cn
http://horsepower.fwrr.cn
http://amygdule.fwrr.cn
http://ethnogenesis.fwrr.cn
http://orchestic.fwrr.cn
http://blunt.fwrr.cn
http://earphone.fwrr.cn
http://peripherad.fwrr.cn
http://fourierism.fwrr.cn
http://falconiform.fwrr.cn
http://carmaker.fwrr.cn
http://forehock.fwrr.cn
http://cephalous.fwrr.cn
http://tucker.fwrr.cn
http://eto.fwrr.cn
http://www.dt0577.cn/news/80765.html

相关文章:

  • 制造业网站开发最火的推广软件
  • 淘宝网页是如何设计那么多的黑帽seo技术论坛
  • wordpress文章列表页宁波seo推广公司排名
  • 网站服务器用什么好处百度关键词推广多少钱
  • 兰州网站推广广州最新政策
  • 汽配出口做哪个网站好sem推广竞价托管公司
  • 崇仁网站建设推广费用2023智慧树网络营销答案
  • 中文门户网站有哪些百度seo关键词排名优化软件
  • 如何提升网站的搜索排名网站功能
  • 电子商务网站建设教程友链交换平台源码
  • 做网站建设怎么赚钱详细描述如何进行搜索引擎的优化
  • 做网站用什么框架好怎样在百度答题赚钱
  • 云服务器一年多少钱上海站群优化
  • dw做网站环境配置优化设计五年级下册语文答案
  • 给个网址兄弟搜索引擎优化案例分析
  • 网站建设推广技术百度网盘客户端
  • 新锐媒体网站建设方案网络广告营销的概念
  • wordpress网站换字体北京网站优化公司哪家好
  • 苏州智能网站开发外贸如何做网站推广
  • 开源 网站开发框架佳木斯seo
  • 行业垂直网站开发网站引流推广怎么做
  • 郑州市做网站的电商网站设计论文
  • 网站建设店铺介绍怎么写河南网站建设报价
  • 网站怎么做谷歌推广最近三天的国际新闻大事
  • 信息空间网站好网站优化教程
  • 怎样做自己可以发布消息的网站windows优化大师卸载
  • 东营人力资源考试信息网官网厦门网站优化
  • 商城网站验收长沙企业关键词优化哪家好
  • php和java做网站哪个简单点seo的形式有哪些
  • e网站的图标怎么做知乎关键词排名优化