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
03d9f1b8
Commit
03d9f1b8
authored
Dec 14, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18561 from ZJU-SEL/configurable-config-file
Auto commit by PR queue bot
parents
166ae235
1571edfb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
20 deletions
+28
-20
download-release.sh
cluster/ubuntu/download-release.sh
+1
-1
reconfDocker.sh
cluster/ubuntu/reconfDocker.sh
+6
-4
util.sh
cluster/ubuntu/util.sh
+20
-14
ubuntu.md
docs/getting-started-guides/ubuntu.md
+1
-1
No files found.
cluster/ubuntu/download-release.sh
View file @
03d9f1b8
...
...
@@ -72,5 +72,5 @@ grep -q "^${KUBE_VERSION}\$" binaries/.kubernetes 2>/dev/null || {
rm
-rf
flannel
*
kubernetes
*
etcd
*
echo
"Done! All your
commands locate in kubernetes/cluster/ubuntu/binaries dir
"
echo
"Done! All your
binaries locate in kubernetes/cluster/ubuntu/binaries directory
"
popd
cluster/ubuntu/reconfDocker.sh
View file @
03d9f1b8
...
...
@@ -16,14 +16,13 @@
# reconfigure docker network setting
source
~/kube/config-default.sh
source
"
$HOME
/kube/
${
KUBE_CONFIG_FILE
##*/
}
"
if
[
"
$(
id
-u
)
"
!=
"0"
]
;
then
if
[
[
"
$(
id
-u
)
"
!=
"0"
]
]
;
then
echo
>
&2
"Please run as root"
exit
1
fi
function
config_etcd
{
attempt
=
0
while
true
;
do
...
...
@@ -72,4 +71,7 @@ elif [[ $1 == "ai" ]]; then
restart_docker
elif
[[
$1
==
"a"
]]
;
then
config_etcd
fi
else
echo
"Another arguement is required."
exit
1
fi
cluster/ubuntu/util.sh
View file @
03d9f1b8
...
...
@@ -268,7 +268,7 @@ EOF
# Vars set:
# KUBE_MASTER_IP
function
detect-master
()
{
source
"
${
KUBE_
ROOT
}
/cluster/ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
source
"
${
KUBE_
CONFIG_FILE
}
"
setClusterInfo
export
KUBE_MASTER
=
"
${
MASTER
}
"
export
KUBE_MASTER_IP
=
"
${
MASTER_IP
}
"
...
...
@@ -282,7 +282,7 @@ function detect-master() {
# Vars set:
# KUBE_NODE_IP_ADDRESS (array)
function
detect-nodes
()
{
source
"
${
KUBE_
ROOT
}
/cluster/ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
source
"
${
KUBE_
CONFIG_FILE
}
"
KUBE_NODE_IP_ADDRESSES
=()
setClusterInfo
...
...
@@ -306,7 +306,8 @@ function detect-nodes() {
# Instantiate a kubernetes cluster on ubuntu
function
kube-up
()
{
source
"
${
KUBE_ROOT
}
/cluster/ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
export
KUBE_CONFIG_FILE
=
${
KUBE_CONFIG_FILE
:-${
KUBE_ROOT
}
/cluster/ubuntu/config-default.sh
}
source
"
${
KUBE_CONFIG_FILE
}
"
# downloading tarball release
"
${
KUBE_ROOT
}
/cluster/ubuntu/download-release.sh"
...
...
@@ -357,7 +358,7 @@ function provision-master() {
scp
-r
$SSH_OPTS
\
saltbase/salt/generate-cert/make-ca-cert.sh
\
ubuntu/reconfDocker.sh
\
ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
\
"
${
KUBE_CONFIG_FILE
}
"
\
ubuntu/util.sh
\
ubuntu/master/
*
\
ubuntu/binaries/master/
\
...
...
@@ -407,7 +408,7 @@ function provision-master() {
mkdir -p /opt/bin/
cp ~/kube/master/* /opt/bin/
service etcd start
FLANNEL_NET=
\"
${
FLANNEL_NET
}
\"
~/kube/reconfDocker.sh a
FLANNEL_NET=
\"
${
FLANNEL_NET
}
\"
KUBE_CONFIG_FILE=
\"
${
KUBE_CONFIG_FILE
}
\"
~/kube/reconfDocker.sh a
'"
||
{
echo
"Deploying master on machine
${
MASTER_IP
}
failed"
exit
1
...
...
@@ -422,7 +423,7 @@ function provision-node() {
# copy the binaries and scripts to the ~/kube directory on the node
scp
-r
$SSH_OPTS
\
ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
\
"
${
KUBE_CONFIG_FILE
}
"
\
ubuntu/util.sh
\
ubuntu/reconfDocker.sh
\
ubuntu/minion/
*
\
...
...
@@ -459,7 +460,7 @@ function provision-node() {
mkdir -p /opt/bin/
cp ~/kube/minion/* /opt/bin
service flanneld start
~/kube/reconfDocker.sh i
KUBE_CONFIG_FILE=
\"
${
KUBE_CONFIG_FILE
}
\"
~/kube/reconfDocker.sh i
'"
||
{
echo
"Deploying node on machine
${
1
#*@
}
failed"
exit
1
...
...
@@ -476,7 +477,7 @@ function provision-masterandnode() {
# scp order matters
scp
-r
$SSH_OPTS
\
saltbase/salt/generate-cert/make-ca-cert.sh
\
ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
\
"
${
KUBE_CONFIG_FILE
}
"
\
ubuntu/util.sh
\
ubuntu/minion/
*
\
ubuntu/master/
*
\
...
...
@@ -539,7 +540,7 @@ function provision-masterandnode() {
cp ~/kube/minion/* /opt/bin/
service etcd start
FLANNEL_NET=
\"
${
FLANNEL_NET
}
\"
~/kube/reconfDocker.sh ai
FLANNEL_NET=
\"
${
FLANNEL_NET
}
\"
KUBE_CONFIG_FILE=
\"
${
KUBE_CONFIG_FILE
}
\"
~/kube/reconfDocker.sh ai
'"
||
{
echo
"Deploying master and node on machine
${
MASTER_IP
}
failed"
exit
1
...
...
@@ -562,9 +563,11 @@ function check-pods-torn-down() {
# Delete a kubernetes cluster
function
kube-down
()
{
export
KUBECTL_PATH
=
"
${
KUBE_ROOT
}
/cluster/ubuntu/binaries/kubectl"
source
"
${
KUBE_ROOT
}
/cluster/ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
export
KUBE_CONFIG_FILE
=
${
KUBE_CONFIG_FILE
:-${
KUBE_ROOT
}
/cluster/ubuntu/config-default.sh
}
source
"
${
KUBE_CONFIG_FILE
}
"
source
"
${
KUBE_ROOT
}
/cluster/common.sh"
tear_down_alive_resources
...
...
@@ -647,7 +650,8 @@ function prepare-push() {
# Update a kubernetes master with expected release
function
push-master
()
{
source
"
${
KUBE_ROOT
}
/cluster/ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
export
KUBE_CONFIG_FILE
=
${
KUBE_CONFIG_FILE
:-${
KUBE_ROOT
}
/cluster/ubuntu/config-default.sh
}
source
"
${
KUBE_CONFIG_FILE
}
"
if
[[
!
-f
"
${
KUBE_ROOT
}
/cluster/ubuntu/binaries/master/kube-apiserver"
]]
;
then
echo
"There is no required release of kubernetes, please check first"
...
...
@@ -702,7 +706,8 @@ function push-master() {
# Update a kubernetes node with expected release
function
push-node
()
{
source
"
${
KUBE_ROOT
}
/cluster/ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
export
KUBE_CONFIG_FILE
=
${
KUBE_CONFIG_FILE
:-${
KUBE_ROOT
}
/cluster/ubuntu/config-default.sh
}
source
"
${
KUBE_CONFIG_FILE
}
"
if
[[
!
-f
"
${
KUBE_ROOT
}
/cluster/ubuntu/binaries/minion/kubelet"
]]
;
then
echo
"There is no required release of kubernetes, please check first"
...
...
@@ -764,7 +769,8 @@ function push-node() {
# Update a kubernetes cluster with expected source
function
kube-push
()
{
prepare-push
source
"
${
KUBE_ROOT
}
/cluster/ubuntu/
${
KUBE_CONFIG_FILE
:-
config
-default.sh
}
"
export
KUBE_CONFIG_FILE
=
${
KUBE_CONFIG_FILE
:-${
KUBE_ROOT
}
/cluster/ubuntu/config-default.sh
}
source
"
${
KUBE_CONFIG_FILE
}
"
if
[[
!
-f
"
${
KUBE_ROOT
}
/cluster/ubuntu/binaries/master/kube-apiserver"
]]
;
then
echo
"There is no required release of kubernetes, please check first"
...
...
docs/getting-started-guides/ubuntu.md
View file @
03d9f1b8
...
...
@@ -156,7 +156,7 @@ bring up the whole cluster.
`$ KUBERNETES_PROVIDER=ubuntu ./kube-up.sh`
The scripts automatically
`scp`
binaries and config files to all the machines
and start kubernetes
The scripts automatically
copy binaries and config files to all the machines via
`scp`
and start kubernetes
service on them. The only thing you need to do is to type the sudo password when promoted.
```
console
...
...
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