-
Notifications
You must be signed in to change notification settings - Fork 1
/
master_start.py
66 lines (51 loc) · 1.56 KB
/
master_start.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
"""
时间:2020/6/17
作者:lurui
功能:master统一入口
时间:2020/6/24
作者:lurui
功能:master各模块启动顺序,优先生成master_hosts
时间:2020/7/23
作者:lurui
功能:master添加非高可用模式
"""
# -*- coding: utf-8 -*-
from runs.kubernetes.start_haproxy_cfg import start_haproxy_cfg
from runs.kubernetes.start_haproxy import start_haproxy
from runs.kubernetes.start_keepalived_cfg import start_keepalived_cfg
from runs.kubernetes.start_keepalived import start_keepalived
from runs.kubernetes.start_ansible import start_ansible
from runs.kubernetes.start_ansible_hosts import start_ansible_hosts
from runs.kubernetes.start_cert import start_cert
from runs.certs.gencerts import gencerts
from runs.init.initenv import initenv
from runs.certs.copycerts import copycerts
from runs.kubernetes.start_master import start_master
import configparser
import os
basedir = os.path.abspath('.')
def start():
config = configparser.ConfigParser()
config.read(basedir + '/cfg/config.ini')
master_nums = int(config['MASTER']['nums'])
if master_nums == 1:
start_ansible()
start_ansible_hosts()
start_cert()
gencerts('master')
initenv('master')
copycerts('master')
start_master()
else:
start_ansible()
start_ansible_hosts()
start_cert()
gencerts('master')
start_haproxy_cfg()
start_haproxy()
start_keepalived_cfg()
start_keepalived()
initenv('master')
copycerts('master')
start_master()
start()