forked from barak/tarpoon
Add glide.yaml and vendor deps
This commit is contained in:
parent
db918f12ad
commit
5b3d5e81bd
18880 changed files with 5166045 additions and 1 deletions
67
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/flannel.sh
generated
vendored
Executable file
67
vendor/k8s.io/kubernetes/cluster/centos/node/scripts/flannel.sh
generated
vendored
Executable file
|
|
@ -0,0 +1,67 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
ETCD_SERVERS=${1:-"http://8.8.8.18:2379"}
|
||||
FLANNEL_NET=${2:-"172.16.0.0/16"}
|
||||
|
||||
|
||||
cat <<EOF >/opt/kubernetes/cfg/flannel
|
||||
FLANNEL_ETCD="-etcd-endpoints=${ETCD_SERVERS}"
|
||||
FLANNEL_ETCD_KEY="-etcd-prefix=/coreos.com/network"
|
||||
EOF
|
||||
|
||||
cat <<EOF >/usr/lib/systemd/system/flannel.service
|
||||
[Unit]
|
||||
Description=Flanneld overlay address etcd agent
|
||||
After=network.target
|
||||
Before=docker.service
|
||||
|
||||
[Service]
|
||||
EnvironmentFile=-/opt/kubernetes/cfg/flannel
|
||||
ExecStartPre=/opt/kubernetes/bin/remove-docker0.sh
|
||||
ExecStart=/opt/kubernetes/bin/flanneld --ip-masq \${FLANNEL_ETCD} \${FLANNEL_ETCD_KEY}
|
||||
ExecStartPost=/opt/kubernetes/bin/mk-docker-opts.sh -d /run/flannel/docker
|
||||
|
||||
Type=notify
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
RequiredBy=docker.service
|
||||
EOF
|
||||
|
||||
# Store FLANNEL_NET to etcd.
|
||||
attempt=0
|
||||
while true; do
|
||||
/opt/kubernetes/bin/etcdctl --no-sync -C ${ETCD_SERVERS} \
|
||||
get /coreos.com/network/config >/dev/null 2>&1
|
||||
if [[ "$?" == 0 ]]; then
|
||||
break
|
||||
else
|
||||
if (( attempt > 600 )); then
|
||||
echo "timeout for waiting network config" > ~/kube/err.log
|
||||
exit 2
|
||||
fi
|
||||
|
||||
/opt/kubernetes/bin/etcdctl --no-sync -C ${ETCD_SERVERS} \
|
||||
mk /coreos.com/network/config "{\"Network\":\"${FLANNEL_NET}\"}" >/dev/null 2>&1
|
||||
attempt=$((attempt+1))
|
||||
sleep 3
|
||||
fi
|
||||
done
|
||||
wait
|
||||
|
||||
systemctl daemon-reload
|
||||
Loading…
Add table
Add a link
Reference in a new issue