-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathshell
executable file
·60 lines (54 loc) · 1.81 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
57
58
59
60
#!/bin/bash
KUBERNETES_MASTER=$1
NODE_NAME="${NODE_NAME=`hostname -s`}"
FEATURE_GATES="TaintBasedEvictions=true"
if [ -z "$KUBERNETES_MASTER" ]; then
echo "KUBERNETES_MASTER not set"
exit 1
fi
echo "KUBERNETES_MASTER=$KUBERNETES_MASTER"
echo "LABELS=$LABELS"
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 knode
umount /var/lib/kubelet/volumeplugins
sysctl fs.inotify.max_user_watches=524288
docker run \
--name knode \
-e LABELS="$LABELS" \
-e TAINTS="$TAINTS" \
-e KUBERNETES_MASTER="https://$KUBERNETES_MASTER:6443" \
-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" \
-e VAULT_ADDR="http://$KUBERNETES_MASTER:8200" \
-e KUBELET_TOKEN="$KUBELET_TOKEN" \
-e PROXY_TOKEN="$PROXY_TOKEN" \
--net=host \
--pid=host \
--privileged=true \
-p 10250:10250 \
-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 /var/lib/calico/:/var/lib/calico:ro \
-v /etc/cni/net.d:/etc/cni/net.d:ro \
-v `pwd`/pki-data:/srv/kubernetes \
-v /var/log:/var/log \
-v /local-data/:/local-data:rw,shared \
-it kubernetes-node bash