-
Notifications
You must be signed in to change notification settings - Fork 6
/
shell
executable file
·56 lines (51 loc) · 1.83 KB
/
shell
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
#!/bin/bash
NODE_NAME="${NODE_NAME:-$(hostname -s)}"
FEATURE_GATES="CustomResourcePublishOpenAPI=true,PodPriority=true,PersistentLocalVolumes=true,TaintNodesByCondition=true,TaintBasedEvictions=true"
LABELS="$LABELS,zone=master,node.kubernetes.io/master=true"
TAINTS="node.kubernetes.io/master=:NoSchedule,CriticalAddonsOnly=:NoSchedule"
echo "KUBERNETES_MASTER=$KUBERNETES_MASTER"
echo "LABELS=$LABELS"
echo "TAINTS=$TAINTS"
if ! grep "/var/lib/kubelet " /proc/self/mountinfo | grep shared; then
echo "Making /var/lib/kubelet shared."
mkdir -p /var/lib/kubelet
mount --bind /var/lib/kubelet /var/lib/kubelet
mount --make-shared /var/lib/kubelet
fi
rpc.statd
swapoff -a
mkdir -p /local-data
docker rm -f kmaster
umount /var/lib/kubelet/volumeplugins
docker run \
--name kmaster \
-e LABELS="$LABELS" \
-e TAINTS="$TAINTS" \
-e KUBERNETES_MASTER="$KUBERNETES_MASTER" \
-e NODE_NAME="$NODE_NAME" \
-e REGION="$REGION" \
-e VPC_ID="$VPC_ID" \
-e FEATURE_GATES="$FEATURE_GATES" \
-e CLUSTER_CIDR="10.0.0.0/16" \
-e ALT_NAMES="$(hostname),$(hostname -I|tr ' ' ','),$ALT_NAMES" \
--net=host \
--pid=host \
--privileged=true \
-p 10250:10250 \
-p 4001:4001 \
-p 8200:8200 \
-v /sys:/sys:rw \
-v /:/rootfs:ro \
-v /dev:/dev:rw \
-v /lib/modules:/lib/modules:ro \
-v /var/run:/var/run:rw \
-v /var/lib/docker/:/var/lib/docker:rw \
-v /var/lib/kubelet/:/var/lib/kubelet:rw,shared \
-v /var/lib/kubelet/volumeplugins:/var/lib/kubelet/volumeplugins:rw \
-v `pwd`/etcd-data:/var/lib/etcd-data \
-v `pwd`/vault-data:/var/lib/vault-data \
-v /var/log:/var/log \
-v /local-data/:/local-data:rw,shared \
-v `pwd`:/docker \
-w /docker \
-it kubernetes-master bash