Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
e8a3e2d8
Commit
e8a3e2d8
authored
Apr 11, 2017
by
Mike Danese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete ubuntu kube-up
parent
6d8aa2b1
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
0 additions
and
1472 deletions
+0
-1472
.gitignore
cluster/ubuntu/.gitignore
+0
-2
config-default.sh
cluster/ubuntu/config-default.sh
+0
-139
config-test.sh
cluster/ubuntu/config-test.sh
+0
-19
deployAddons.sh
cluster/ubuntu/deployAddons.sh
+0
-93
download-release.sh
cluster/ubuntu/download-release.sh
+0
-98
flanneld.conf
cluster/ubuntu/master-flannel/init_conf/flanneld.conf
+0
-29
flanneld
cluster/ubuntu/master-flannel/init_scripts/flanneld
+0
-99
etcd.conf
cluster/ubuntu/master/init_conf/etcd.conf
+0
-34
kube-apiserver.conf
cluster/ubuntu/master/init_conf/kube-apiserver.conf
+0
-30
kube-controller-manager.conf
cluster/ubuntu/master/init_conf/kube-controller-manager.conf
+0
-30
kube-scheduler.conf
cluster/ubuntu/master/init_conf/kube-scheduler.conf
+0
-30
etcd
cluster/ubuntu/master/init_scripts/etcd
+0
-100
kube-apiserver
cluster/ubuntu/master/init_scripts/kube-apiserver
+0
-99
kube-controller-manager
cluster/ubuntu/master/init_scripts/kube-controller-manager
+0
-99
kube-scheduler
cluster/ubuntu/master/init_scripts/kube-scheduler
+0
-99
flanneld.conf
cluster/ubuntu/minion-flannel/init_conf/flanneld.conf
+0
-28
flanneld
cluster/ubuntu/minion-flannel/init_scripts/flanneld
+0
-99
kube-proxy.conf
cluster/ubuntu/minion/init_conf/kube-proxy.conf
+0
-32
kubelet.conf
cluster/ubuntu/minion/init_conf/kubelet.conf
+0
-30
kube-proxy
cluster/ubuntu/minion/init_scripts/kube-proxy
+0
-99
kubelet
cluster/ubuntu/minion/init_scripts/kubelet
+0
-99
namespace.yaml
cluster/ubuntu/namespace.yaml
+0
-4
reconfDocker.sh
cluster/ubuntu/reconfDocker.sh
+0
-81
util.sh
cluster/ubuntu/util.sh
+0
-0
No files found.
cluster/ubuntu/.gitignore
deleted
100644 → 0
View file @
6d8aa2b1
binaries
kubedns*
cluster/ubuntu/config-default.sh
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/bash
# Copyright 2015 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.
## Contains configuration values for the Ubuntu cluster
# Define all your cluster nodes, MASTER node comes first"
# And separated with blank space like <user_1@ip_1> <user_2@ip_2> <user_3@ip_3>
export
nodes
=
${
nodes
:-
"vcap@10.10.103.250 vcap@10.10.103.162 vcap@10.10.103.223"
}
# Define all your nodes role: a(master) or i(minion) or ai(both master and minion),
# Roles must be the same order with the nodes.
roles
=
${
roles
:-
"ai i i"
}
# If it practically impossible to set an array as an environment variable
# from a script, so assume variable is a string then convert it to an array
export
roles_array
=(
$roles
)
# Define minion numbers
export
NUM_NODES
=
${
NUM_NODES
:-
3
}
# define the IP range used for service cluster IPs.
# according to rfc 1918 ref: https://tools.ietf.org/html/rfc1918 choose a private ip range here.
export
SERVICE_CLUSTER_IP_RANGE
=
${
SERVICE_CLUSTER_IP_RANGE
:-
192
.168.3.0/24
}
# formerly PORTAL_NET
# define the IP range used for flannel overlay network, should not conflict with above SERVICE_CLUSTER_IP_RANGE
# The Ubuntu scripting supports two ways of networking: Flannel and
# CNI. To use CNI: (1) put a CNI configuration file, whose basename
# is the configured network type plus ".conf", somewhere on the driver
# machine (the one running `kube-up.sh`) and set CNI_PLUGIN_CONF to a
# pathname of that file, (2) put one or more executable binaries on
# the driver machine and set CNI_PLUGIN_EXES to a space-separated list
# of their pathnames, and (3) set CNI_KUBELET_TRIGGER to identify an
# appropriate service on which to trigger the start and stop of the
# kubelet on non-master machines. For (1) and (2) the pathnames may
# be relative, in which case they are relative to kubernetes/cluster.
# If either of CNI_PLUGIN_CONF or CNI_PLUGIN_EXES is undefined or has
# a zero length value then Flannel will be used instead of CNI.
export
CNI_PLUGIN_CONF CNI_PLUGIN_EXES CNI_KUBELET_TRIGGER
CNI_PLUGIN_CONF
=
${
CNI_PLUGIN_CONF
:-
""
}
CNI_PLUGIN_EXES
=
${
CNI_PLUGIN_EXES
:-
""
}
CNI_KUBELET_TRIGGER
=
${
CNI_KUBELET_TRIGGER
:-
networking
}
# Flannel networking is used if CNI networking is not. The following
# variable defines the CIDR block from which cluster addresses are
# drawn.
export
FLANNEL_NET
=
${
FLANNEL_NET
:-
172
.16.0.0/16
}
# If Flannel networking is used then the following variable can be
# used to customize the Flannel backend. The variable's value should
# be a JSON object. An empty string means to use the default, which
# is `{"Type": "vxlan"}`. See
# https://github.com/coreos/flannel#configuration for details on
# configuring Flannel.
export
FLANNEL_BACKEND
FLANNEL_BACKEND
=
''
# Optionally add other contents to the Flannel configuration JSON
# object normally stored in etcd as /coreos.com/network/config. Use
# JSON syntax suitable for insertion into a JSON object constructor
# after other field name:value pairs. For example:
# FLANNEL_OTHER_NET_CONFIG=', "SubnetMin": "172.16.10.0", "SubnetMax": "172.16.90.0"'
export
FLANNEL_OTHER_NET_CONFIG
FLANNEL_OTHER_NET_CONFIG
=
${
FLANNEL_OTHER_NET_CONFIG
:-
""
}
# Admission Controllers to invoke prior to persisting objects in
# cluster. If we included ResourceQuota, we should keep it at the end
# of the list to prevent incrementing quota usage prematurely. The
# list below is what
# http://kubernetes.io/docs/admin/admission-controllers/ recommends
# for release >= 1.4.0; see that doc for the recommended settings for
# earlier releases.
export
ADMISSION_CONTROL
=
NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,DefaultTolerationSeconds,ResourceQuota
# Path to the pod manifest file or directory of files of kubelet
export
KUBELET_POD_MANIFEST_PATH
=
${
KUBELET_POD_MANIFEST_PATH
:-
""
}
# A port range to reserve for services with NodePort visibility
SERVICE_NODE_PORT_RANGE
=
${
SERVICE_NODE_PORT_RANGE
:-
"30000-32767"
}
# Optional: Enable node logging.
ENABLE_NODE_LOGGING
=
false
LOGGING_DESTINATION
=
${
LOGGING_DESTINATION
:-
elasticsearch
}
# Optional: When set to true, Elasticsearch and Kibana will be setup as part of the cluster bring up.
ENABLE_CLUSTER_LOGGING
=
false
ELASTICSEARCH_LOGGING_REPLICAS
=
${
ELASTICSEARCH_LOGGING_REPLICAS
:-
1
}
# Optional: When set to true, heapster, Influxdb and Grafana will be setup as part of the cluster bring up.
ENABLE_CLUSTER_MONITORING
=
"
${
KUBE_ENABLE_CLUSTER_MONITORING
:-
true
}
"
# Extra options to set on the Docker command line. This is useful for setting
# --insecure-registry for local registries.
DOCKER_OPTS
=
${
DOCKER_OPTS
:-
""
}
# Extra options to set on the kube-proxy command line. This is useful
# for selecting the iptables proxy-mode, for example.
KUBE_PROXY_EXTRA_OPTS
=
${
KUBE_PROXY_EXTRA_OPTS
:-
""
}
# Optional: Install cluster DNS.
ENABLE_CLUSTER_DNS
=
"
${
KUBE_ENABLE_CLUSTER_DNS
:-
true
}
"
# DNS_SERVER_IP must be a IP in SERVICE_CLUSTER_IP_RANGE
DNS_SERVER_IP
=
${
DNS_SERVER_IP
:-
"192.168.3.10"
}
DNS_DOMAIN
=
${
DNS_DOMAIN
:-
"cluster.local"
}
# Optional: Enable DNS horizontal autoscaler
ENABLE_DNS_HORIZONTAL_AUTOSCALER
=
"
${
KUBE_ENABLE_DNS_HORIZONTAL_AUTOSCALER
:-
false
}
"
# Optional: Install Kubernetes UI
ENABLE_CLUSTER_UI
=
"
${
KUBE_ENABLE_CLUSTER_UI
:-
true
}
"
# Optional: Enable setting flags for kube-apiserver to turn on behavior in active-dev
#RUNTIME_CONFIG=""
# Optional: Add http or https proxy when download easy-rsa.
# Add environment variable separated with blank space like "http_proxy=http://10.x.x.x:8080 https_proxy=https://10.x.x.x:8443"
PROXY_SETTING
=
${
PROXY_SETTING
:-
""
}
# Optional: Allows kubelet/kube-api to be run in privileged mode
ALLOW_PRIVILEGED
=
${
ALLOW_PRIVILEGED
:-
"false"
}
DEBUG
=
${
DEBUG
:-
"false"
}
# Add SSH_OPTS: Add this to config ssh port
SSH_OPTS
=
"-oPort=22 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=ERROR"
cluster/ubuntu/config-test.sh
deleted
100644 → 0
View file @
6d8aa2b1
#!/bin/bash
# Copyright 2015 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.
## Contains configuration values for interacting with the Ubuntu cluster in test mode
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
source
"
${
KUBE_ROOT
}
/cluster/ubuntu/config-default.sh"
cluster/ubuntu/deployAddons.sh
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/bash
# Copyright 2015 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.
# deploy the add-on services after the cluster is available
set
-e
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/../..
source
"config-default.sh"
KUBECTL
=
"
${
KUBE_ROOT
}
/cluster/kubectl.sh"
export
KUBECTL_PATH
=
"
${
KUBE_ROOT
}
/cluster/ubuntu/binaries/kubectl"
export
KUBE_CONFIG_FILE
=
${
KUBE_CONFIG_FILE
:-${
KUBE_ROOT
}
/cluster/ubuntu/config-default.sh
}
function
init
{
echo
"Creating kube-system namespace..."
# use kubectl to create kube-system namespace
NAMESPACE
=
`
eval
"
${
KUBECTL
}
get namespaces | grep kube-system | cat"
`
if
[
!
"
$NAMESPACE
"
]
;
then
${
KUBECTL
}
create
-f
namespace.yaml
echo
"The namespace 'kube-system' is successfully created."
else
echo
"The namespace 'kube-system' is already there. Skipping."
fi
echo
}
function
deploy_dns
{
echo
"Deploying DNS on Kubernetes"
sed
-e
"s/
\\\$
DNS_DOMAIN/
${
DNS_DOMAIN
}
/g"
"
${
KUBE_ROOT
}
/cluster/addons/dns/kubedns-controller.yaml.sed"
>
kubedns-controller.yaml
sed
-e
"s/
\\\$
DNS_SERVER_IP/
${
DNS_SERVER_IP
}
/g"
"
${
KUBE_ROOT
}
/cluster/addons/dns/kubedns-svc.yaml.sed"
>
kubedns-svc.yaml
cp
"
${
KUBE_ROOT
}
/cluster/addons/dns/kubedns-sa.yaml"
kubedns-sa.yaml
cp
"
${
KUBE_ROOT
}
/cluster/addons/dns/kubedns-cm.yaml"
kubedns-cm.yaml
KUBEDNS
=
`
eval
"
${
KUBECTL
}
get services --namespace=kube-system | grep kube-dns | cat"
`
if
[
!
"
$KUBEDNS
"
]
;
then
# use kubectl to create kubedns controller and service
${
KUBECTL
}
--namespace
=
kube-system create
-f
kubedns-sa.yaml
${
KUBECTL
}
--namespace
=
kube-system create
-f
kubedns-cm.yaml
${
KUBECTL
}
--namespace
=
kube-system create
-f
kubedns-controller.yaml
${
KUBECTL
}
--namespace
=
kube-system create
-f
kubedns-svc.yaml
echo
"Kube-dns controller and service are successfully deployed."
else
echo
"Kube-dns controller and service are already deployed. Skipping."
fi
echo
}
function
deploy_dashboard
{
if
${
KUBECTL
}
get deployment
-l
k8s-app
=
kubernetes-dashboard
--namespace
=
kube-system |
grep
kubernetes-dashboard-v &> /dev/null
;
then
echo
"Kubernetes Dashboard controller already exists"
else
echo
"Creating Kubernetes Dashboard controller"
${
KUBECTL
}
create
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-controller.yaml
fi
if
${
KUBECTL
}
get service/kubernetes-dashboard
--namespace
=
kube-system &> /dev/null
;
then
echo
"Kubernetes Dashboard service already exists"
else
echo
"Creating Kubernetes Dashboard service"
${
KUBECTL
}
create
-f
${
KUBE_ROOT
}
/cluster/addons/dashboard/dashboard-service.yaml
fi
echo
}
init
if
[
"
${
ENABLE_CLUSTER_DNS
}
"
==
true
]
;
then
deploy_dns
fi
if
[
"
${
ENABLE_CLUSTER_UI
}
"
==
true
]
;
then
deploy_dashboard
fi
cluster/ubuntu/download-release.sh
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/bash
# Copyright 2015 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.
# Download the etcd, flannel, and K8s binaries automatically and stored in binaries directory
# Run as root only
# author @resouer @WIZARD-CXY
set
-e
function
cleanup
{
# cleanup work
rm
-rf
flannel
*
kubernetes
*
etcd
*
binaries out
}
trap
cleanup SIGHUP SIGINT SIGTERM
pushd
$(
dirname
$0
)
mkdir
-p
binaries/master
mkdir
-p
binaries/minion
mkdir
-p
out
# flannel
FLANNEL_VERSION
=
${
FLANNEL_VERSION
:-
"0.5.5"
}
echo
"Prepare flannel
${
FLANNEL_VERSION
}
release ..."
grep
-q
"^
${
FLANNEL_VERSION
}
\$
"
binaries/.flannel 2>/dev/null
||
{
(
curl
--fail
-L
https://github.com/coreos/flannel/releases/download/v
${
FLANNEL_VERSION
}
/flannel-
${
FLANNEL_VERSION
}
-linux-amd64
.tar.gz
-o
flannel.tar.gz
&&
tar
xzf flannel.tar.gz flannel-
${
FLANNEL_VERSION
}
/flanneld
-O
>
out/flanneld
)
||
(
curl
--fail
-L
https://github.com/coreos/flannel/releases/download/v
${
FLANNEL_VERSION
}
/flannel-v
${
FLANNEL_VERSION
}
-linux-amd64
.tar.gz
-o
flannel.tar.gz
&&
tar
xzf flannel.tar.gz flanneld
-O
>
out/flanneld
)
chmod
0755 out/flanneld
cp
out/flanneld binaries/master
cp
out/flanneld binaries/minion
echo
${
FLANNEL_VERSION
}
>
binaries/.flannel
}
# ectd
ETCD_VERSION
=
${
ETCD_VERSION
:-
"3.0.17"
}
ETCD
=
"etcd-v
${
ETCD_VERSION
}
-linux-amd64"
echo
"Prepare etcd
${
ETCD_VERSION
}
release ..."
grep
-q
"^
${
ETCD_VERSION
}
\$
"
binaries/.etcd 2>/dev/null
||
{
curl
-L
https://github.com/coreos/etcd/releases/download/v
${
ETCD_VERSION
}
/
${
ETCD
}
.tar.gz
-o
etcd.tar.gz
tar
xzf etcd.tar.gz
cp
${
ETCD
}
/etcd
${
ETCD
}
/etcdctl binaries/master
echo
${
ETCD_VERSION
}
>
binaries/.etcd
}
function
get_latest_version_number
{
# TODO(#33726): switch to dl.k8s.io
local
-r
latest_url
=
"https://storage.googleapis.com/kubernetes-release/release/stable.txt"
if
[[
$(
which wget
)
]]
;
then
wget
-qO-
${
latest_url
}
elif
[[
$(
which curl
)
]]
;
then
curl
-Ss
${
latest_url
}
else
echo
"Couldn't find curl or wget. Bailing out."
>
&2
exit
4
fi
}
if
[
-z
"
$KUBE_VERSION
"
]
;
then
KUBE_VERSION
=
$(
get_latest_version_number |
sed
's/^v//'
)
fi
# k8s
echo
"Prepare kubernetes
${
KUBE_VERSION
}
release ..."
grep
-q
"^
${
KUBE_VERSION
}
\$
"
binaries/.kubernetes 2>/dev/null
||
{
# TODO(#33726): switch to dl.k8s.io
curl
-L
https://storage.googleapis.com/kubernetes-release/release/v
${
KUBE_VERSION
}
/kubernetes-client-linux-amd64.tar.gz
-o
kubernetes-client-linux-amd64.tar.gz
curl
-L
https://storage.googleapis.com/kubernetes-release/release/v
${
KUBE_VERSION
}
/kubernetes-server-linux-amd64.tar.gz
-o
kubernetes-server-linux-amd64.tar.gz
tar
xzf kubernetes-client-linux-amd64.tar.gz
tar
xzf kubernetes-server-linux-amd64.tar.gz
cp
kubernetes/client/bin/kubectl binaries/
cp
kubernetes/server/bin/kube-apiserver
\
kubernetes/server/bin/kube-controller-manager
\
kubernetes/server/bin/kube-scheduler binaries/master
cp
kubernetes/server/bin/kubelet
\
kubernetes/server/bin/kube-proxy binaries/minion
echo
${
KUBE_VERSION
}
>
binaries/.kubernetes
}
rm
-rf
flannel
*
kubernetes
*
etcd
*
out
echo
"Done! All your binaries locate in kubernetes/cluster/ubuntu/binaries directory"
popd
cluster/ubuntu/master-flannel/init_conf/flanneld.conf
deleted
100644 → 0
View file @
6d8aa2b1
description
"Flannel service"
author
"@chenxingyu"
respawn
# start in conjunction with etcd
start
on
started
etcd
stop
on
stopping
etcd
pre
-
start
script
FLANNEL
=/
opt
/
bin
/$
UPSTART_JOB
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
if
[ -
f
$
FLANNEL
];
then
exit
0
fi
exit
22
end
script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/flanneld)
FLANNEL
=/
opt
/
bin
/$
UPSTART_JOB
FLANNEL_OPTS
=
""
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
exec
"$FLANNEL"
$
FLANNEL_OPTS
end
script
cluster/ubuntu/master-flannel/init_scripts/flanneld
deleted
100644 → 0
View file @
6d8aa2b1
#!/bin/sh
set
-e
### BEGIN INIT INFO
# Provides: flannel
# Required-Start: $etcd
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start flannel networking service
# Description:
# https://github.com/coreos/flannel
### END INIT INFO
export
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:
BASE
=
$(
basename
$0
)
# modify these in /etc/default/$BASE (/etc/default/flannel)
FLANNEL
=
/opt/bin/
$BASE
# This is the pid file managed by kube-apiserver itself
FLANNEL_PIDFILE
=
/var/run/
$BASE
.pid
FLANNEL_LOGFILE
=
/var/log/
$BASE
.log
FLANNEL_OPTS
=
""
FLANNEL_DESC
=
"Flannel"
# Get lsb functions
.
/lib/lsb/init-functions
if
[
-f
/etc/default/
$BASE
]
;
then
.
/etc/default/
$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if
[
-x
/sbin/initctl
]
&&
/sbin/initctl version 2>/dev/null |
grep
-q
upstart
;
then
log_failure_msg
"
$FLANNEL_DESC
is managed via upstart, try using service
$BASE
$1
"
exit
1
fi
# Check flanneld is present
if
[
!
-x
$FLANNEL
]
;
then
log_failure_msg
"
$FLANNEL
not present or not executable"
exit
1
fi
fail_unless_root
()
{
if
[
"
$(
id
-u
)
"
!=
'0'
]
;
then
log_failure_msg
"
$FLANNEL_DESC
must be run as root"
exit
1
fi
}
FLANNEL_START
=
"start-stop-daemon
\
--start
\
--background
\
--quiet
\
--exec
$FLANNEL
\
--make-pidfile --pidfile
$FLANNEL_PIDFILE
\
--
$FLANNEL_OPTS
\
>>
$FLANNEL_LOGFILE
2>&1"
FLANNEL_STOP
=
"start-stop-daemon
\
--stop
\
--pidfile
$FLANNEL_PIDFILE
"
case
"
$1
"
in
start
)
fail_unless_root
log_begin_msg
"Starting
$FLANNEL_DESC
:
$BASE
"
$FLANNEL_START
log_end_msg
$?
;;
stop
)
fail_unless_root
log_begin_msg
"Stopping
$FLANNEL_DESC
:
$BASE
"
$FLANNEL_STOP
log_end_msg
$?
;;
restart
|
force-reload
)
fail_unless_root
log_begin_msg
"Stopping
$FLANNEL_DESC
:
$BASE
"
$FLANNEL_STOP
$FLANNEL_START
log_end_msg
$?
;;
status
)
status_of_proc
-p
"
$FLANNEL_DESC
"
"
$FLANNEL
"
"
$FLANNEL_DESC
"
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
cluster/ubuntu/master/init_conf/etcd.conf
deleted
100644 → 0
View file @
6d8aa2b1
description
"Etcd service"
author
"@jainvipin"
start
on
(
net
-
device
-
up
and
local
-
filesystems
and
runlevel
[
2345
])
respawn
# set max open files
limit
nofile
2048
4096
pre
-
start
script
# see also https://github.com/jainvipin/kubernetes-ubuntu-start
ETCD
=/
opt
/
bin
/$
UPSTART_JOB
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
if
[ -
f
$
ETCD
];
then
exit
0
fi
echo
"$ETCD binary not found, exiting"
exit
22
end
script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/etcd)
ETCD
=/
opt
/
bin
/$
UPSTART_JOB
ETCD_OPTS
=
""
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
exec
"$ETCD"
$
ETCD_OPTS
end
script
cluster/ubuntu/master/init_conf/kube-apiserver.conf
deleted
100644 → 0
View file @
6d8aa2b1
description
"Kube-Apiserver service"
author
"@jainvipin"
respawn
# start in conjunction with etcd
start
on
started
etcd
stop
on
stopping
etcd
pre
-
start
script
# see also https://github.com/jainvipin/kubernetes-start
KUBE_APISERVER
=/
opt
/
bin
/$
UPSTART_JOB
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
if
[ -
f
$
KUBE_APISERVER
];
then
exit
0
fi
exit
22
end
script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/kube-apiserver)
KUBE_APISERVER
=/
opt
/
bin
/$
UPSTART_JOB
KUBE_APISERVER_OPTS
=
""
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
exec
"$KUBE_APISERVER"
$
KUBE_APISERVER_OPTS
end
script
cluster/ubuntu/master/init_conf/kube-controller-manager.conf
deleted
100644 → 0
View file @
6d8aa2b1
description
"Kube-Controller-Manager service"
author
"@jainvipin"
respawn
# start in conjunction with etcd
start
on
started
etcd
stop
on
stopping
etcd
pre
-
start
script
# see also https://github.com/jainvipin/kubernetes-ubuntu-start
KUBE_CONTROLLER_MANAGER
=/
opt
/
bin
/$
UPSTART_JOB
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
if
[ -
f
$
KUBE_CONTROLLER_MANAGER
];
then
exit
0
fi
exit
22
end
script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/kube-controller-manager)
KUBE_CONTROLLER_MANAGER
=/
opt
/
bin
/$
UPSTART_JOB
KUBE_CONTROLLER_MANAGER_OPTS
=
""
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
exec
"$KUBE_CONTROLLER_MANAGER"
$
KUBE_CONTROLLER_MANAGER_OPTS
end
script
cluster/ubuntu/master/init_conf/kube-scheduler.conf
deleted
100644 → 0
View file @
6d8aa2b1
description
"Kube-Scheduler service"
author
"@jainvipin"
respawn
# start in conjunction with etcd
start
on
started
etcd
stop
on
stopping
etcd
pre
-
start
script
# see also https://github.com/jainvipin/kubernetes-start
KUBE_SCHEDULER
=/
opt
/
bin
/$
UPSTART_JOB
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
if
[ -
f
$
KUBE_SCHEDULER
];
then
exit
0
fi
exit
22
end
script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/kube-scheduler)
KUBE_SCHEDULER
=/
opt
/
bin
/$
UPSTART_JOB
KUBE_SCHEDULER_OPTS
=
""
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
exec
"$KUBE_SCHEDULER"
$
KUBE_SCHEDULER_OPTS
end
script
cluster/ubuntu/master/init_scripts/etcd
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/sh
set
-e
### BEGIN INIT INFO
# Provides: etcd
# Required-Start: $docker
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start distrubted key/value pair service
# Description:
# http://www.github.com/coreos/etcd
### END INIT INFO
export
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:
BASE
=
$(
basename
$0
)
# modify these in /etc/default/$BASE (/etc/default/etcd)
ETCD
=
/opt/bin/
$BASE
# This is the pid file managed by etcd itself
ETCD_PIDFILE
=
/var/run/
$BASE
.pid
ETCD_LOGFILE
=
/var/log/
$BASE
.log
ETCD_OPTS
=
""
ETCD_DESC
=
"Etcd"
# Get lsb functions
.
/lib/lsb/init-functions
if
[
-f
/etc/default/
$BASE
]
;
then
.
/etc/default/
$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if
false
&&
[
-x
/sbin/initctl
]
&&
/sbin/initctl version 2>/dev/null |
grep
-q
upstart
;
then
log_failure_msg
"
$ETCD_DESC
is managed via upstart, try using service
$BASE
$1
"
exit
1
fi
# Check etcd is present
if
[
!
-x
$ETCD
]
;
then
log_failure_msg
"
$ETCD
not present or not executable"
exit
1
fi
fail_unless_root
()
{
if
[
"
$(
id
-u
)
"
!=
'0'
]
;
then
log_failure_msg
"
$ETCD_DESC
must be run as root"
exit
1
fi
}
ETCD_START
=
"start-stop-daemon
\
--start
\
--background
\
--quiet
\
--exec
$ETCD
\
--make-pidfile
\
--pidfile
$ETCD_PIDFILE
\
--
$ETCD_OPTS
\
>>
$ETCD_LOGFILE
2>&1"
ETCD_STOP
=
"start-stop-daemon
\
--stop
\
--pidfile
$ETCD_PIDFILE
"
case
"
$1
"
in
start
)
fail_unless_root
log_begin_msg
"Starting
$ETCD_DESC
:
$BASE
"
$ETCD_START
log_end_msg
$?
;;
stop
)
fail_unless_root
log_begin_msg
"Stopping
$ETCD_DESC
:
$BASE
"
$ETCD_STOP
log_end_msg
$?
;;
restart
|
force-reload
)
fail_unless_root
log_begin_msg
"Restarting
$ETCD_DESC
:
$BASE
"
$ETCD_STOP
$ETCD_START
log_end_msg
$?
;;
status
)
status_of_proc
-p
"
$ETCD_PIDFILE
"
"
$ETCD
"
"
$ETCD_DESC
"
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
cluster/ubuntu/master/init_scripts/kube-apiserver
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/sh
set
-e
### BEGIN INIT INFO
# Provides: kube-apiserver
# Required-Start: $etcd
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start kube-apiserver service
# Description:
# http://www.github.com/GoogleCloudPlatform/Kubernetes
### END INIT INFO
export
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:
BASE
=
$(
basename
$0
)
# modify these in /etc/default/$BASE (/etc/default/kube-apiserver)
KUBE_APISERVER
=
/opt/bin/
$BASE
# This is the pid file managed by kube-apiserver itself
KUBE_APISERVER_PIDFILE
=
/var/run/
$BASE
.pid
KUBE_APISERVER_LOGFILE
=
/var/log/
$BASE
.log
KUBE_APISERVER_OPTS
=
""
KUBE_APISERVER_DESC
=
"Kube-Apiserver"
# Get lsb functions
.
/lib/lsb/init-functions
if
[
-f
/etc/default/
$BASE
]
;
then
.
/etc/default/
$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if
[
-x
/sbin/initctl
]
&&
/sbin/initctl version 2>/dev/null |
grep
-q
upstart
;
then
log_failure_msg
"
$KUBE_APISERVER_DESC
is managed via upstart, try using service
$BASE
$1
"
exit
1
fi
# Check kube-apiserver is present
if
[
!
-x
$KUBE_APISERVER
]
;
then
log_failure_msg
"
$KUBE_APISERVER
not present or not executable"
exit
1
fi
fail_unless_root
()
{
if
[
"
$(
id
-u
)
"
!=
'0'
]
;
then
log_failure_msg
"
$KUBE_APISERVER_DESC
must be run as root"
exit
1
fi
}
KUBE_APISERVER_START
=
"start-stop-daemon
\
--start
\
--background
\
--quiet
\
--exec
$KUBE_APISERVER
\
--make-pidfile --pidfile
$KUBE_APISERVER_PIDFILE
\
--
$KUBE_APISERVER_OPTS
\
>>
$KUBE_APISERVER_LOGFILE
2>&1"
KUBE_APISERVER_STOP
=
"start-stop-daemon
\
--stop
\
--pidfile
$KUBE_APISERVER_PIDFILE
"
case
"
$1
"
in
start
)
fail_unless_root
log_begin_msg
"Starting
$KUBE_APISERVER_DESC
:
$BASE
"
$KUBE_APISERVER_START
log_end_msg
$?
;;
stop
)
fail_unless_root
log_begin_msg
"Stopping
$KUBE_APISERVER_DESC
:
$BASE
"
$KUBE_APISERVER_STOP
log_end_msg
$?
;;
restart
|
force-reload
)
fail_unless_root
log_begin_msg
"Stopping
$KUBE_APISERVER_DESC
:
$BASE
"
$KUBE_APISERVER_STOP
$KUBE_APISERVER_START
log_end_msg
$?
;;
status
)
status_of_proc
-p
"
$KUBE_APISERVER_PIDFILE
"
"
$KUBE_APISERVER
"
"
$KUBE_APISERVER_DESC
"
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
cluster/ubuntu/master/init_scripts/kube-controller-manager
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/sh
set
-e
### BEGIN INIT INFO
# Provides: kube-controller-manager
# Required-Start: $etcd
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start kube-controller-manager service
# Description:
# http://www.github.com/GoogleCloudPlatform/Kubernetes
### END INIT INFO
export
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:
BASE
=
$(
basename
$0
)
# modify these in /etc/default/$BASE (/etc/default/kube-controller-manager)
KUBE_CONTROLLER_MANAGER
=
/opt/bin/
$BASE
# This is the pid file managed by kube-controller-manager itself
KUBE_CONTROLLER_MANAGER_PIDFILE
=
/var/run/
$BASE
.pid
KUBE_CONTROLLER_MANAGER_LOGFILE
=
/var/log/
$BASE
.log
KUBE_CONTROLLER_MANAGER_OPTS
=
""
KUBE_CONTROLLER_MANAGER_DESC
=
"Kube-Controller-Manager"
# Get lsb functions
.
/lib/lsb/init-functions
if
[
-f
/etc/default/
$BASE
]
;
then
.
/etc/default/
$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if
[
-x
/sbin/initctl
]
&&
/sbin/initctl version 2>/dev/null |
grep
-q
upstart
;
then
log_failure_msg
"
$KUBE_CONTROLLER_MANAGER_DESC
is managed via upstart, try using service
$BASE
$1
"
exit
1
fi
# Check kube-controller-manager is present
if
[
!
-x
$KUBE_CONTROLLER_MANAGER
]
;
then
log_failure_msg
"
$KUBE_CONTROLLER_MANAGER
not present or not executable"
exit
1
fi
fail_unless_root
()
{
if
[
"
$(
id
-u
)
"
!=
'0'
]
;
then
log_failure_msg
"
$KUBE_CONTROLLER_MANAGER_DESC
must be run as root"
exit
1
fi
}
KUBE_CONTROLLER_MANAGER_START
=
"start-stop-daemon
--start --background
\
--quiet
\
--exec
$KUBE_CONTROLLER_MANAGER
\
--make-pidfile
\
--pidfile
$KUBE_CONTROLLER_MANAGER_PIDFILE
\
--
$KUBE_CONTROLLER_MANAGER_OPTS
\
>>
$KUBE_CONTROLLER_MANAGER_LOGFILE
2>&1"
KUBE_CONTROLLER_MANAGER_STOP
=
"start-stop-daemon
\
--stop
\
--pidfile
$KUBE_CONTROLLER_MANAGER_PIDFILE
"
case
"
$1
"
in
start
)
fail_unless_root
log_begin_msg
"Starting
$KUBE_CONTROLLER_MANAGER_DESC
:
$BASE
"
$KUBE_CONTROLLER_MANAGER_START
log_end_msg
$?
;;
stop
)
fail_unless_root
log_begin_msg
"Stopping
$KUBE_CONTROLLER_MANAGER_DESC
:
$BASE
"
$KUBE_CONTROLLER_MANAGER_STOP
log_end_msg
$?
;;
restart
|
force-reload
)
fail_unless_root
log_daemon_message
"Restarting
$KUBE_CONTROLLER_MANAGER
"
||
true
$KUBE_CONTROLLER_MANAGER_STOP
$KUBE_CONTROLLER_MANAGER_START
log_end_msg
$?
;;
status
)
status_of_proc
-p
"
$KUBE_CONTROLLER_MANAGER_PIDFILE
"
"
$KUBE_CONTROLLER_MANAGER
"
"
$KUBE_CONTROLLER_MANAGER_DESC
"
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
cluster/ubuntu/master/init_scripts/kube-scheduler
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/sh
set
-e
### BEGIN INIT INFO
# Provides: kube-scheduler
# Required-Start: $etcd
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start kube-scheduler service
# Description:
# http://www.github.com/GoogleCloudPlatform/Kubernetes
### END INIT INFO
export
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:
BASE
=
$(
basename
$0
)
# modify these in /etc/default/$BASE (/etc/default/kube-scheduler)
KUBE_SCHEDULER
=
/opt/bin/
$BASE
# This is the pid file managed by kube-scheduler itself
KUBE_SCHEDULER_PIDFILE
=
/var/run/
$BASE
.pid
KUBE_SCHEDULER_LOGFILE
=
/var/log/
$BASE
.log
KUBE_SCHEDULER_OPTS
=
""
KUBE_SCHEDULER_DESC
=
"Kube-Scheduler"
# Get lsb functions
.
/lib/lsb/init-functions
if
[
-f
/etc/default/
$BASE
]
;
then
.
/etc/default/
$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if
[
-x
/sbin/initctl
]
&&
/sbin/initctl version 2>/dev/null |
grep
-q
upstart
;
then
log_failure_msg
"
$KUBE_SCHEDULER_DESC
is managed via upstart, try using service
$BASE
$1
"
exit
1
fi
# Check kube-scheduler is present
if
[
!
-x
$KUBE_SCHEDULER
]
;
then
log_failure_msg
"
$KUBE_SCHEDULER
not present or not executable"
exit
1
fi
fail_unless_root
()
{
if
[
"
$(
id
-u
)
"
!=
'0'
]
;
then
log_failure_msg
"
$KUBE_SCHEDULER_DESC
must be run as root"
exit
1
fi
}
KUBE_SCHEDULER_START
=
"start-stop-daemon
\
--start
\
--background
\
--quiet
\
--exec
$KUBE_SCHEDULER
\
--make-pidfile --pidfile
$KUBE_SCHEDULER_PIDFILE
\
--
$KUBE_SCHEDULER_OPTS
\
>>
$KUBE_SCHEDULER_LOGFILE
2>&1"
KUBE_SCHEDULER_STOP
=
"start-stop-daemon
\
--stop
\
--pidfile
$KUBE_SCHEDULER_PIDFILE
"
case
"
$1
"
in
start
)
fail_unless_root
log_begin_msg
"Starting
$KUBE_SCHEDULER_DESC
:
$BASE
"
$KUBE_SCHEDULER_START
log_end_msg
$?
;;
stop
)
fail_unless_root
log_begin_msg
"Stopping
$KUBE_SCHEDULER_DESC
:
$BASE
"
$KUBE_SCHEDULER_STOP
log_end_msg
$?
;;
restart
|
force-reload
)
fail_unless_root
log_begin_msg
"Restarting
$KUBE_SCHEDULER_DESC
:
$BASE
"
$KUBE_SCHEDULER_STOP
$KUBE_SCHEDULER_START
log_end_msg
$?
;;
status
)
status_of_proc
-p
"
$KUBE_SCHEDULER_PIDFILE
"
"
$KUBE_SCHEDULER
"
"
$KUBE_SCHEDULER_DESC
"
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
cluster/ubuntu/minion-flannel/init_conf/flanneld.conf
deleted
100644 → 0
View file @
6d8aa2b1
description
"Flannel service"
author
"@chenxingyu"
respawn
start
on
(
net
-
device
-
up
and
local
-
filesystems
and
runlevel
[
2345
])
pre
-
start
script
FLANNEL
=/
opt
/
bin
/$
UPSTART_JOB
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
if
[ -
f
$
FLANNEL
];
then
exit
0
fi
exit
22
end
script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/flanneld)
FLANNEL
=/
opt
/
bin
/$
UPSTART_JOB
FLANNEL_OPTS
=
""
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
exec
"$FLANNEL"
$
FLANNEL_OPTS
end
script
cluster/ubuntu/minion-flannel/init_scripts/flanneld
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/sh
set
-e
### BEGIN INIT INFO
# Provides: flannel
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start flannel networking service
# Description:
# https://github.com/coreos/flannel
### END INIT INFO
export
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:
BASE
=
$(
basename
$0
)
# modify these in /etc/default/$BASE (/etc/default/flannel)
FLANNEL
=
/opt/bin/
$BASE
# This is the pid file managed by kube-apiserver itself
FLANNEL_PIDFILE
=
/var/run/
$BASE
.pid
FLANNEL_LOGFILE
=
/var/log/
$BASE
.log
FLANNEL_OPTS
=
""
FLANNEL_DESC
=
"Flannel"
# Get lsb functions
.
/lib/lsb/init-functions
if
[
-f
/etc/default/
$BASE
]
;
then
.
/etc/default/
$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if
[
-x
/sbin/initctl
]
&&
/sbin/initctl version 2>/dev/null |
grep
-q
upstart
;
then
log_failure_msg
"
$FLANNEL_DESC
is managed via upstart, try using service
$BASE
$1
"
exit
1
fi
# Check flanneld is present
if
[
!
-x
$FLANNEL
]
;
then
log_failure_msg
"
$FLANNEL
not present or not executable"
exit
1
fi
fail_unless_root
()
{
if
[
"
$(
id
-u
)
"
!=
'0'
]
;
then
log_failure_msg
"
$FLANNEL_DESC
must be run as root"
exit
1
fi
}
FLANNEL_START
=
"start-stop-daemon
\
--start
\
--background
\
--quiet
\
--exec
$FLANNEL
\
--make-pidfile --pidfile
$FLANNEL_PIDFILE
\
--
$FLANNEL_OPTS
\
>>
$FLANNEL_LOGFILE
2>&1"
FLANNEL_STOP
=
"start-stop-daemon
\
--stop
\
--pidfile
$FLANNEL_PIDFILE
"
case
"
$1
"
in
start
)
fail_unless_root
log_begin_msg
"Starting
$FLANNEL_DESC
:
$BASE
"
$FLANNEL_START
log_end_msg
$?
;;
stop
)
fail_unless_root
log_begin_msg
"Stopping
$FLANNEL_DESC
:
$BASE
"
$FLANNEL_STOP
log_end_msg
$?
;;
restart
|
force-reload
)
fail_unless_root
log_begin_msg
"Stopping
$FLANNEL_DESC
:
$BASE
"
$FLANNEL_STOP
$FLANNEL_START
log_end_msg
$?
;;
status
)
status_of_proc
-p
"
$FLANNEL_DESC
"
"
$FLANNEL
"
"
$FLANNEL_DESC
"
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
cluster/ubuntu/minion/init_conf/kube-proxy.conf
deleted
100644 → 0
View file @
6d8aa2b1
description
"Kube-Proxy service"
author
"@jainvipin"
respawn
# start in conjunction with flanneld
start
on
started
flanneld
stop
on
stopping
flanneld
limit
nofile
65536
65536
pre
-
start
script
# see also https://github.com/jainvipin/kubernetes-start
KUBE_PROXY
=/
opt
/
bin
/$
UPSTART_JOB
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
if
[ -
f
$
KUBE_PROXY
];
then
exit
0
fi
exit
22
end
script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/kube-proxy)
KUBE_PROXY
=/
opt
/
bin
/$
UPSTART_JOB
KUBE_PROXY_OPTS
=
""
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
exec
"$KUBE_PROXY"
$
KUBE_PROXY_OPTS
end
script
cluster/ubuntu/minion/init_conf/kubelet.conf
deleted
100644 → 0
View file @
6d8aa2b1
description
"Kubelet service"
author
"@jainvipin"
respawn
# start in conjunction with flanneld
start
on
started
flanneld
stop
on
stopping
flanneld
pre
-
start
script
# see also https://github.com/jainvipin/kubernetes-ubuntu-start
KUBELET
=/
opt
/
bin
/$
UPSTART_JOB
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
if
[ -
f
$
KUBELET
];
then
exit
0
fi
exit
22
end
script
script
# modify these in /etc/default/$UPSTART_JOB (/etc/default/kubelet)
KUBELET
=/
opt
/
bin
/$
UPSTART_JOB
KUBELET_OPTS
=
""
if
[ -
f
/
etc
/
default
/$
UPSTART_JOB
];
then
. /
etc
/
default
/$
UPSTART_JOB
fi
exec
"$KUBELET"
$
KUBELET_OPTS
end
script
cluster/ubuntu/minion/init_scripts/kube-proxy
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/sh
set
-e
### BEGIN INIT INFO
# Provides: kube-proxy
# Required-Start: $flannel
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start kube-proxy service
# Description:
# http://www.github.com/GoogleCloudPlatform/Kubernetes
### END INIT INFO
export
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:
BASE
=
$(
basename
$0
)
# modify these in /etc/default/$BASE (/etc/default/kube-proxy)
KUBE_PROXY
=
/opt/bin/
$BASE
# This is the pid file managed by kube-proxy itself
KUBE_PROXY_PIDFILE
=
/var/run/
$BASE
.pid
KUBE_PROXY_LOGFILE
=
/var/log/
$BASE
.log
KUBE_PROXY_OPTS
=
""
KUBE_PROXY_DESC
=
"Kube-Proxy"
# Get lsb functions
.
/lib/lsb/init-functions
if
[
-f
/etc/default/
$BASE
]
;
then
.
/etc/default/
$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if
[
-x
/sbin/initctl
]
&&
/sbin/initctl version 2>/dev/null |
grep
-q
upstart
;
then
log_failure_msg
"
$KUBE_PROXY_DESC
is managed via upstart, try using service
$BASE
$1
"
exit
1
fi
# Check kube-proxy is present
if
[
!
-x
$KUBE_PROXY
]
;
then
log_failure_msg
"
$KUBE_PROXY
not present or not executable"
exit
1
fi
fail_unless_root
()
{
if
[
"
$(
id
-u
)
"
!=
'0'
]
;
then
log_failure_msg
"
$KUBE_PROXY_DESC
must be run as root"
exit
1
fi
}
KUBE_PROXY_START
=
"start-stop-daemon
\
--start
\
--background
\
--quiet
\
--exec
$KUBE_PROXY
\
--make-pidfile --pidfile
$KUBE_PROXY_PIDFILE
\
--
$KUBE_PROXY_OPTS
\
>>
$KUBE_PROXY_LOGFILE
2>&1"
KUBE_PROXY_STOP
=
"start-stop-daemon
\
--stop
\
--pidfile
$KUBE_PROXY_PIDFILE
"
case
"
$1
"
in
start
)
fail_unless_root
log_begin_msg
"Starting
$KUBE_PROXY_DESC
:
$BASE
"
$KUBE_PROXY_START
log_end_msg
$?
;;
stop
)
fail_unless_root
log_begin_msg
"Stopping
$KUBE_PROXY_DESC
:
$BASE
"
$KUBE_PROXY_STOP
log_end_msg
$?
;;
restart
|
force-reload
)
fail_unless_root
log_begin_msg
"Stopping
$KUBE_PROXY_DESC
:
$BASE
"
$KUBE_PROXY_STOP
$KUBE_PROXY_START
log_end_msg
$?
;;
status
)
status_of_proc
-p
"
$KUBE_PROXY_PIDFILE
"
"
$KUBE_PROXY
"
"
$KUBE_PROXY_DESC
"
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
cluster/ubuntu/minion/init_scripts/kubelet
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/sh
set
-e
### BEGIN INIT INFO
# Provides: kubelet
# Required-Start: $flannel
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop:
# Short-Description: Start kubelet service
# Description:
# http://www.github.com/GoogleCloudPlatform/Kubernetes
### END INIT INFO
export
PATH
=
/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/opt/bin:
BASE
=
$(
basename
$0
)
# modify these in /etc/default/$BASE (/etc/default/kube-apiserver)
KUBELET
=
/opt/bin/
$BASE
# This is the pid file managed by kube-apiserver itself
KUBELET_PIDFILE
=
/var/run/
$BASE
.pid
KUBELET_LOGFILE
=
/var/log/
$BASE
.log
KUBELET_OPTS
=
""
KUBELET_DESC
=
"Kubelet"
# Get lsb functions
.
/lib/lsb/init-functions
if
[
-f
/etc/default/
$BASE
]
;
then
.
/etc/default/
$BASE
fi
# see also init_is_upstart in /lib/lsb/init-functions (which isn't available in Ubuntu 12.04, or we'd use it)
if
[
-x
/sbin/initctl
]
&&
/sbin/initctl version 2>/dev/null |
grep
-q
upstart
;
then
log_failure_msg
"
$KUBELET_DESC
is managed via upstart, try using service
$BASE
$1
"
exit
1
fi
# Check kube-apiserver is present
if
[
!
-x
$KUBELET
]
;
then
log_failure_msg
"
$KUBELET
not present or not executable"
exit
1
fi
fail_unless_root
()
{
if
[
"
$(
id
-u
)
"
!=
'0'
]
;
then
log_failure_msg
"
$KUBELET_DESC
must be run as root"
exit
1
fi
}
KUBELET_START
=
"start-stop-daemon
\
--start
\
--background
\
--quiet
\
--exec
$KUBELET
\
--make-pidfile --pidfile
$KUBELET_PIDFILE
\
--
$KUBELET_OPTS
\
>>
$KUBELET_LOGFILE
2>&1"
KUBELET_STOP
=
"start-stop-daemon
\
--stop
\
--pidfile
$KUBELET_PIDFILE
"
case
"
$1
"
in
start
)
fail_unless_root
log_begin_msg
"Starting
$KUBELET_DESC
:
$BASE
"
$KUBELET_START
log_end_msg
$?
;;
stop
)
fail_unless_root
log_begin_msg
"Stopping
$KUBELET_DESC
:
$BASE
"
$KUBELET_STOP
log_end_msg
$?
;;
restart
|
force-reload
)
fail_unless_root
log_begin_msg
"Stopping
$KUBELET_DESC
:
$BASE
"
$KUBELET_STOP
$KUBELET_START
log_end_msg
$?
;;
status
)
status_of_proc
-p
"
$KUBELET_PIDFILE
"
"
$KUBELET
"
"
$KUBELET_DESC
"
;;
*
)
echo
"Usage:
$0
{start|stop|restart|status}"
exit
1
;;
esac
cluster/ubuntu/namespace.yaml
deleted
100644 → 0
View file @
6d8aa2b1
apiVersion
:
v1
kind
:
Namespace
metadata
:
name
:
kube-system
cluster/ubuntu/reconfDocker.sh
deleted
100755 → 0
View file @
6d8aa2b1
#!/bin/bash
# Copyright 2015 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.
# reconfigure docker network setting
source
"
$HOME
/kube/
${
KUBE_CONFIG_FILE
##*/
}
"
if
[[
-n
"
$DEBUG
"
]]
&&
[[
"
$DEBUG
"
!=
false
]]
&&
[[
"
$DEBUG
"
!=
FALSE
]]
;
then
set
-x
fi
if
[[
"
$(
id
-u
)
"
!=
"0"
]]
;
then
echo
>
&2
"Please run as root"
exit
1
fi
function
config_etcd
{
attempt
=
0
while
true
;
do
/opt/bin/etcdctl get /coreos.com/network/config
if
[[
"
$?
"
==
0
]]
;
then
break
else
# enough timeout??
if
((
attempt
>
600
))
;
then
echo
"timeout waiting for /coreos.com/network/config"
>>
~/kube/err.log
exit
2
fi
/opt/bin/etcdctl mk /coreos.com/network/config
"{
\"
Network
\"
:
\"
${
FLANNEL_NET
}
\"
,
\"
Backend
\"
:
${
FLANNEL_BACKEND
:-
"{
\"
Type
\"
:
\"
vxlan
\"
}"
}${
FLANNEL_OTHER_NET_CONFIG
}
}"
attempt
=
$((
attempt+1
))
sleep
3
fi
done
}
function
restart_docker
{
attempt
=
0
while
[[
!
-f
/run/flannel/subnet.env
]]
;
do
if
((
attempt
>
200
))
;
then
echo
"timeout waiting for /run/flannel/subnet.env"
>>
~/kube/err.log
exit
2
fi
attempt
=
$((
attempt+1
))
sleep
3
done
sudo
ip
link set
dev docker0 down
sudo
brctl delbr docker0
source
/run/flannel/subnet.env
source
/etc/default/docker
echo
DOCKER_OPTS
=
\"
-H
tcp://127.0.0.1:4243
-H
unix:///var/run/docker.sock
\
--bip
=
${
FLANNEL_SUBNET
}
--mtu
=
${
FLANNEL_MTU
}
\"
>
/etc/default/docker
sudo
service docker restart
}
if
[[
$1
==
"i"
]]
;
then
restart_docker
elif
[[
$1
==
"ai"
]]
;
then
config_etcd
restart_docker
elif
[[
$1
==
"a"
]]
;
then
config_etcd
else
echo
"Another argument is required."
exit
1
fi
cluster/ubuntu/util.sh
deleted
100755 → 0
View file @
6d8aa2b1
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment