当前位置: 首页 > Linux

自写二进制安装kubernetes脚本v2.0版

时间:2023-04-06 19:34:32 Linux

一键安装二进制安装Kubernetes(k8s)v2.0手动安装:https://github.com/cby-chen/K...脚本安装:https://github.com/cby-chen/B...使用说明:本脚本示例需要11台服务器,11台服务器其中一台用于执行脚本,另外还有8台k8s服务器,另外两台台作为LB负载均衡服务器。给服务器配置一个静态IP,在下面的变量中修改IP。同时查看服务器中的网卡名称并修改。要执行脚本,您可以使用bash-x来显示执行过程中的详细信息。脚本已经适配centos7和centos8。脚本中有两个host,记得修改。2022-03更新:现在支持centos7和centos8自动适配,支持自定义k8snode节点结构。如果你在变量中需要多少个节点,就写几个节点。注意,对于新节点,需要在脚本中添加。同时建议修改hosts,不建议随意更改。2022-04更新:更新kubernetes独立版本选择优化执行结构适配多版本修复BUG脚本需要在GitHub上下载软件包并提前手动下载wgethttps://github.com/cby-chen/Kubernetes/releases/download/cby/Kubernetes.tarwgethttps://github.com/cby-chen/Kubernetes/releases/download/v1.23.4/kubernetes-v1.23.4.tarwgethttps://github.com/cby-chen/Kubernetes/releases/download/v1.23.5/kubernetes-v1.23.5.tar下载脚本wgethttps://www.oiox.cn/Binary_installation_of_Kubernetes.sh修改参数vimBinary_installation_of_Kubernetes.sh如下:#各节点IP,vipexportk8s_master01="192.168.1.61"exportk8s_master02="192.168.1.61"exportk8s_master03="192.168.1.63"exportk8s_node01="192.168.1.64"exportk8s_node02="192.168.1.65"exportk8s_node03="192.168.1.63"exportk8s_node03="192.168.1.63".1.67"exportk8s_node05="192.168.1.68"exportlb_01="192.168.1.57"exportlb_02="192.168.1.58"exportlb_vip="192.168.1.59"#物理网络ip地址段,注意反斜杠翻译exportip_segment=“192。168.1.0\/24"#k8s自定义域名exportdomain="x.oiox.cn"#server网卡名exporteth="ens18"修改hosts(有两处)cat>/etc/hosts<