Giter VIP home page Giter VIP logo

k8s-install's Introduction

k8s-install

中文 English

最新版 k8s 快速搭建脚本, 自适应国内外网络环境, 无法连接谷歌源自动切换成国内源(aliyun)来安装
支持 CentOS 7/Debian 9+/Ubuntu 16+

三步即可快速搭建k8s集群

1. master节点初始化

master 节点服务器运行:

# use flannel network
source <(curl -sL https://git.io/fjXVF) --flannel

或者

# use calico network
source <(curl -sL https://git.io/fjXVF) --calico

运行脚本会自动初始化(kubeadm init), 最后生成 'kubeadm join'命令

2. slave节点安装

slave 节点服务器运行:

source <(curl -sL https://git.io/fjXVF)

3. 加入集群

slave 节点运行第一步生成的 'kubeadm join xxx'


可以加入参数'--hostname xxx'来同时设置服务器的hostname, 举个栗子:

source <(curl -sL https://git.io/fjXVF) --flannel --hostname master_test

PS: 所有机器的hostname不一样集群才能搭建成功

验证结果

在master服务器上运行:

  1. kubectl get nodes, 所有节点都是ready
  2. kubectl get pods -n kube-system, 所有Pod READY状态都是1/1

同时符合以上两点即代表k8s集群搭建成功!

命令行参数列表

k8s_install.sh [-h|--help] [options]
    --flannel             使用flannel网络, 同时设置当前服务器为Master节点
    --calico              使用calico网络, 同时设置当前服务器为Master节点
    --hostname [hostname] 设置服务器hostname
    --helm                安装helm, master节点才能生效, 设置安装helm同时会设置master节点可调度部署。如果安装完不想设置master节点可调度, 手动运行"kubectl taint nodes --all node-role.kubernetes.io/master=:NoSchedule"

k8s-install's People

Contributors

jrohy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.