-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathenv.sh
73 lines (54 loc) · 2.49 KB
/
env.sh
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
67
68
69
70
71
72
73
#!/usr/bin/bash
# 生成 EncryptionConfig 所需的加密 key
ENCRYPTION_KEY=$(head -c 32 /dev/urandom | base64)
# 最好使用 当前未用的网段 来定义服务网段和 Pod 网段
# 服务网段,部署前路由不可达,部署后集群内路由可达(kube-proxy 和 ipvs 保证)
SERVICE_CIDR="10.254.0.0/16"
# Pod 网段,建议 /16 段地址,部署前路由不可达,部署后集群内路由可达(flanneld 保证)
CLUSTER_CIDR="172.30.0.0/16"
# 服务端口范围 (NodePort Range)
export NODE_PORT_RANGE="8400-9000"
# 集群master IP 数组
export MASTER_IPS=(192.168.0.11 192.168.0.12 192.168.0.13)
# 集群master 对应的 主机名数组
export MASTER_NAMES=(kube-master1 kube-master2 kube-master3)
# 集群node IP 数组
export NODE_IPS=(192.168.0.21 192.168.0.22 192.168.0.23)
# 集群node IP 对应的 主机名数组
export NODE_NAMES=(kube-node1 kube-node2 kube-node3)
# 集群master_node IP 数组(方便分发)
export MASTER_NODE_IPS=(192.168.0.11 192.168.0.12 192.168.0.13 192.168.0.21 192.168.0.22 192.168.0.23)
# kube-apiserver 的 VIP(HA 组件 keepalived 发布的 IP)
export MASTER_VIP=192.168.0.10
# kube-apiserver VIP 地址(HA 组件 haproxy 监听 8443 端口)
export KUBE_APISERVER="https://${MASTER_VIP}:8443"
# HA 节点,配置 VIP 的网络接口名称(ens33或者eth0)
export VIP_IF="eth1"
# etcd名字
export ETCD_NAMES=(etcd1 etcd2 etcd3)
# etcd集群服务地址列表
export ETCD_ENDPOINTS="https://192.168.0.11:2379,https://192.168.0.12:2379,https://192.168.0.13:2379"
# etcd集群间通信的 IP 和端口
export ETCD_NODES="etcd1=https://192.168.0.11:2380,etcd2=https://192.168.0.12:2380,etcd3=https://192.168.0.13:2380"
# flanneld 网络配置前缀
export FLANNEL_ETCD_PREFIX="/kubernetes/network"
# kubernetes 服务 IP (一般是 SERVICE_CIDR 中第一个IP)
export CLUSTER_KUBERNETES_SVC_IP="10.254.0.1"
# 集群 DNS 服务 IP (从 SERVICE_CIDR 中预分配)
export CLUSTER_DNS_SVC_IP="10.254.0.2"
# 集群 DNS 域名
export CLUSTER_DNS_DOMAIN="cluster.local"
# build path
export KEEPALIVED_PATH=build/keepalived
export HAPROXY_PATH=build/haproxy
export CA_PATH=build/ca
export ETCD_PATH=build/etcd
export FLANNEL_PATH=build/flannel
export DOCKER_PATH=build/docker
export KUBECTL_PATH=build/k8s/kubectl
export APISERVER_PATH=build/k8s/apiserver
export CONTROLLER_MANAGER_PATH=build/k8s/controller-manager
export SCHEDULER_PATH=build/k8s/scheduler
export KUBELET_PATH=build/k8s/kubelet
export KUBEPROXY_PATH=build/k8s/kubeproxy
export TESTGIN_PATH=build/testgin