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一键安装包>.这个脚本可以单独使用 ...
随机推荐
- 题解 Equation
传送门 考场上打了两个小时树剖,结果还是没搞出来 发现对于两个确定的点,它们一定可以列出一个方程来 其中系数的大小和正负只与这两点间距离的奇偶性有关 所以可以加一堆分情况讨论然后树剖 至于正解: 考虑 ...
- @CreatedDate@CreatedBy@LastModifiedBy@LastModifiedDate
启动类上加上@EnableJpaAuditing 实体类,注意需要加上@EntityListeners(AuditingEntityListener.class)这个注解才能使@CreatedDate ...
- 实现动态加载一个 JavaScript 资源
var script = document.createElement("script"); var head = document.getElementsByTagName(&q ...
- SQL Server中的group by(分组)
参考网址: https://blog.csdn.net/tswc_byy/article/details/81909052 sql 查询不必需和聚合函数一起使用 ,通常来说一般是要和聚合函数一起使用来 ...
- 【mysql】关联查询_子查询_排序分组优化
1. 关联查询优化 1.1 left join 结论: ①在优化关联查询时,只有在被驱动表上建立索引才有效! ②left join 时,左侧的为驱动表,右侧为被驱动表! 1.2 inner join ...
- LeetCode42. 接雨水(java)
42.接雨水 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水. 上面是由数组 [0,1,0,2,1,0,1,3,2,1,2,1] 表示的高度图,在这种 ...
- SpringCloud之网关zuul
1.微服务网关介绍和使用场景 1)什么是网关 API Gateway,是系统的唯一对外的入口,介于客户端和服务器端之间的中间层,处理非业务功能 提供路由请求.鉴权.监控.缓存.限流等功能 统一接入 智 ...
- Map 综述(二):彻头彻尾理解 LinkedHashMap
摘要: HashMap和双向链表合二为一即是LinkedHashMap.所谓LinkedHashMap,其落脚点在HashMap,因此更准确地说,它是一个将所有Entry节点链入一个双向链表的Hash ...
- JDBC中的元数据——3.结果集元数据
package metadata; import java.sql.Connection; import java.sql.ParameterMetaData; import java.sql.Pre ...
- Lyndon 相关的炫酷字符串科技
浅谈从 Lyndon Words 到 Three Squares Lemma By zghtyarecrenj 本文包括:Lyndon Words & Significant Suffixes ...