K8s一键安装
安装案例:
系统:Centos
可以多台Master(Master不能低于3台)多台Node
此案例使用三台Master两台Node,用户名root,密码均为123456
master 192.168.20.183
master 192.168.20.96
master 192.168.20.171
node 192.168.20.172
node 192.168.20.54
安装Master集群
下载项目:
git clone https://github.com/zdwork/k8s-install.git
cd k8s-install
修改 conf/master-install.conf
内容如下:
#!/bin/bash
#User-defined information
export node=3 #集群数量
export node_ip="192.168.20.183 192.168.20.96 192.168.20.171" #服务器的ip,以空格分割
export node_name="master-01 master-02 master-03" #主机名 自定义,以空格分割
export node_pass="123456 123456 123456" #每台服务器的root密码,以空格分割
export apiserver_vip="192.168.20.240"#高可用IP 注意此ip要没有被占用
export apiserver_vip_port="4443"
export flaneld_interface="ens33" #你的网卡
export vip_interface="ens33" #你的网卡
export haproxy_name="admin"
export haproxy_pass="123456"
export haproxy_status_port="8000"
安装:
./install.sh
脚本执行完后会打打印出如下信息:
---------------- etcd --------------------------------
192.168.20.183::master-01
Active: active (running) since 三 2018-11-28 16:03:46 CST; 1h 44min ago
192.168.20.96::master-02
Active: active (running) since 三 2018-11-28 16:03:47 CST; 1h 44min ago
192.168.20.171::master-03
Active: active (running) since 三 2018-11-28 16:04:07 CST; 1h 43min ago
---------------- kube-apiserver -----------------------
192.168.20.183::master-01
Active: active (running) since 三 2018-11-28 16:07:07 CST; 1h 40min ago
192.168.20.96::master-02
Active: active (running) since 三 2018-11-28 16:07:20 CST; 1h 40min ago
192.168.20.171::master-03
Active: active (running) since 三 2018-11-28 16:07:32 CST; 1h 40min ago
---------------- kube-scheduler ------------------------
192.168.20.183::master-01
Active: active (running) since 三 2018-11-28 16:08:26 CST; 1h 39min ago
192.168.20.96::master-02
Active: active (running) since 三 2018-11-28 16:08:26 CST; 1h 39min ago
192.168.20.171::master-03
Active: active (running) since 三 2018-11-28 16:08:26 CST; 1h 39min ago
---------------- kube-controller_manager ----------------
192.168.20.183::master-01
Active: active (running) since 三 2018-11-28 16:07:59 CST; 1h 40min ago
192.168.20.96::master-02
Active: active (running) since 三 2018-11-28 16:09:08 CST; 1h 38min ago
192.168.20.171::master-03
Active: active (running) since 三 2018-11-28 16:08:02 CST; 1h 40min ago
---------------- keepalived ------------------------------
192.168.20.183::master-01
Active: active (running) since 三 2018-11-28 16:06:31 CST; 1h 41min ago
192.168.20.96::master-02
Active: active (running) since 三 2018-11-28 16:06:33 CST; 1h 41min ago
192.168.20.171::master-03
Active: active (running) since 三 2018-11-28 16:06:34 CST; 1h 41min ago
---------------- haproxy ---------------------------------
192.168.20.183::master-01
Active: active (running) since 三 2018-11-28 16:05:03 CST; 1h 43min ago
192.168.20.96::master-02
Active: active (running) since 三 2018-11-28 16:05:20 CST; 1h 42min ago
192.168.20.171::master-03
Active: active (running) since 三 2018-11-28 16:05:34 CST; 1h 42min ago
---------------- flanneld --------------------------------
192.168.20.183::master-01
Active: active (running) since 三 2018-11-28 16:04:39 CST; 1h 43min ago
192.168.20.96::master-02
Active: active (running) since 三 2018-11-28 16:04:41 CST; 1h 43min ago
192.168.20.171::master-03
Active: active (running) since 三 2018-11-28 16:04:43 CST; 1h 43min ago
################ Current cluster state ####################
NAME STATUS MESSAGE ERROR
scheduler Healthy ok
controller-manager Healthy ok
etcd-1 Healthy {"health":"true"}
etcd-2 Healthy {"health":"true"}
etcd-0 Healthy {"health":"true"}
安装Node
修改 conf/node-install.conf
内容如下:
#!/bin/bash
#User-defined information
export node=2
export node_ip="192.168.20.172 192.168.20.54"
export node_name="node-1 node-2"
export node_pass="123456 123456"
export flaneld_interface="ens33"
安装:
./install.sh
脚本执行完后会打打印出如下信息:
---------------- flanneld --------------------------------
192.168.20.172::node-1
Active: active (running) since 三 2018-11-28 18:28:34 CST; 26s ago
192.168.20.54::node-2
Active: active (running) since 三 2018-11-28 18:28:37 CST; 25s ago
---------------- docker --------------------------------
192.168.20.172::node-1
Active: active (running) since 三 2018-11-28 18:28:38 CST; 24s ago
192.168.20.54::node-2
Active: active (running) since 三 2018-11-28 18:28:42 CST; 21s ago
---------------- kubelet --------------------------------
192.168.20.172::node-1
Active: active (running) since 三 2018-11-28 18:28:52 CST; 11s ago
192.168.20.54::node-2
Active: active (running) since 三 2018-11-28 18:28:54 CST; 10s ago
---------------- kube-proxy --------------------------------
192.168.20.172::node-1
Active: active (running) since 三 2018-11-28 18:28:59 CST; 5s ago
192.168.20.54::node-2
Active: active (running) since 三 2018-11-28 18:29:00 CST; 5s ago
测试:
[root@localhost k8s-install]# bash
[root@master-01 k8s-install]# source /etc/profile
[root@master-01 k8s-install]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
node-1 Ready <none> 35s v1.10.4
node-2 Ready <none> 34s v1.10.4
[root@master-01 k8s-install]#
K8s一键安装的更多相关文章
- kubespray 一键安装k8s集群
1. clone代码 git clone https://github.com/kubernetes-incubator/kubespray.git 2. 添加inventory/inventory ...
- 用 edgeadm 一键安装边缘 K8s 集群和原生 K8s 集群
背景 目前,很多边缘计算容器开源项目在使用上均存在一个默认的前提:用户需要提前准备一个标准的或者特定工具搭建的 Kubernetes 集群,然后再通过特定工具或者其他方式在集群中部署相应组件来体验边缘 ...
- kubernetes实战(二十):k8s一键部署高可用Prometheus并实现邮件告警
1.基本概念 本次部署使用的是CoreOS的prometheus-operator. 本次部署包含监控etcd集群. 本次部署适用于二进制和kubeadm安装方式. 本次部署适用于k8s v1.10版 ...
- k3s单机版安装部署 附一键安装脚本
作者:SRE运维博客 博客地址: https://www.cnsre.cn/ 文章地址:https://www.cnsre.cn/posts/211109907029/ 相关话题:https://ww ...
- CentOS6.x生产环境下一键安装mono+jexus的脚本,自启动,带服务,版本号自控
转自: http://linuxdot.net/bbsfile-3784 1.支持哪些个平台?答:暂时仅支持CentOS6.x平台,7.x未测试,欢迎测试并到群里反馈给我(昵称:无聊人士) 2.一键安 ...
- 在centos 7.0上利用yum一键安装mono
首先我们需要先配置一下yum源中mono的引用说明: 第一步: vi /etc/yum.repos.d/mono.repo 第二步:在刚打开的文件中编辑如下内容 [mono]name=monobase ...
- 转:CentOS/Debian/Ubuntu一键安装LAMP(Apache/MySQL/PHP)环境
CentOS/Debian/Ubuntu一键安装LAMP(Apache/MySQL/PHP) 今天遇到一个网友提到需要在Linux VPS服务器中安装LAMP(Apache/MySQL/PHP)网站环 ...
- 使用 shell 脚本实现 LANMP 一键安装
使用 shell 脚本来实现 LANMP 系统的一键安装.使用的操作系统是 CentOS 6 ,不区分 32 位和 64 位,要求机器可以连通互联网.支持 LAMP 和 LNMP ,MySQL 支持 ...
- CentOS 6、7下pptp vpn一键安装脚本
之前有折腾过<CentOS 6.7下IPSEC/L2TP VPN一键安装脚本>,不稳定.不支持IOS,因此换成pptp,并已经添加到<lnmp一键安装包>.这个脚本可以单独使用 ...
随机推荐
- iNeuOS工业互联平台,聚合和变化率计算、设备IO和通讯状态、组态快捷键、创建文件夹、选择应用图标等,发布:v3.6版本
目 录 1. 概述... 2 2. 平台演示... 2 3. 聚合和变化率计算... 2 4. 设备IO和通讯状态监测... 3 5. 组 ...
- SpringBoot和mybatis整合报错:Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 152; columnNumber: 10; 元素类型为 "mapper"
很明显,报错是xml有问题,于是去检查,发现: 由于粗心,保存的时候,按的太频繁,多按了个s在里面,导致启动报错!
- C# 获取计算机的硬件、操作系统信息
C# 获取计算机的硬件.操作系统信息 获得信息的命名空间是:System.Management 创建ManagementObjectSearcher对象获取相关信息 eg: using Syste ...
- log4j.properties配置文件及详解
log4j配置文件有三个主要的组件:Logger,Appender和Layout,分别为日志类型,日志输出目的地,日志输出格式. 1. 配置日志级别及appenderName log4j.rootLo ...
- C#多线程---Mutex类实现线程同步
一.例子 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 ...
- 深入浅出Mybatis系列(三)---配置简介(mybatis源码篇)
上篇文章<深入浅出Mybatis系列(二)---Mybatis入门>写了一个Demo简单体现了一下Mybatis的流程.本次,将简单介绍一下Mybatis的配置文件: 上次例子中,我们以 ...
- [SWMM]出现问题及解决
1,节点顺序 [错误]:如下图,在SWMM软件中普通节点到出水口的连接线不能正常连接,提示找不到出水口节点,但在inp文件中是存在的! [解决]:需要先写入点节点再写入线节点,即先写入[JUNCTIO ...
- Hibernate的一级缓存和二级缓存
Fist level cache: This is enabled by default and works in session scope. Read more about hibernate f ...
- Promise.resolve( data)与Promise.reject( data )
Promise.resolve( data)与Promise.reject( data ) 常用来生成已经决议失败或成功的promise实例: 1.Promise.reject(data)不管传递的是 ...
- 一、docker部署Jenkins
1.部署启动脚本: [root@node10 docker-data]# cat start.sh docker run -d \ --restart=unless-stopped \ -v /opt ...