Git Product home page Git Product logo

ansible-k8s's Introduction

简介

本文是通过ansible-playbook的roles功能实现二进制批量自动安装部署Kubernetes集群服务。本想做成离线版本,但由于coredns,ingress,dashboard插件需要拉取镜像,(这里把flannel做成非容器安装版)如需容器版去https://github.com/flannel-io/flannel中获取yaml文件

部署思路

系统初始化

  1. 关闭selinux,firewalld
  2. 关闭swap
  3. 时间同步
  4. 写hosts

Etcd集群部署

  1. 生成etcd证书
  2. 部署三个etcd集群
  3. 查看集群状态

部署Master

  1. 生成apiserver证书
  2. 部署apiserver、controller-manager和scheduler组件
  3. 启动TLS Bootstrapping

部署Node

  1. 安装Docker
  2. 部署kubelet和kube-proxy
  3. 在Master上允许为新Node颁发证书
  4. 授权apiserver访问kubelet

部署插件(准备好镜像)

  1. Web UI
  2. CoreDNS
  3. Ingress Controller

一键部署角色

Ansible安装

Ansible自动化批量管理入门

Ansible之角色详解

目录结构:

[root@ceph01 ~]$tree -L 2 k8s/
k8s/
├── ansible.cfg
├── group_vars
│   └── all.yml
├── hosts
├── roles
│   ├── addons              # 部署k8s插件目录
│   ├── common              # 系统初始化目录
│   ├── docker              # docker安装
│   ├── etcd                # etcd安装
│   ├── master              # master节点
│   ├── nginx               # ingrees代理Nginx
│   ├── node                # node节点
│   └── tls                 # 证书生成
└── single.yml

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.