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
616c6be6
Commit
616c6be6
authored
Apr 06, 2015
by
Zach Loafman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor the "gcloud compute instances create" call as well.
parent
9e5fd874
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
32 deletions
+38
-32
upgrade.sh
cluster/gce/upgrade.sh
+1
-17
util.sh
cluster/gce/util.sh
+37
-15
No files found.
cluster/gce/upgrade.sh
View file @
616c6be6
...
...
@@ -79,23 +79,7 @@ function upgrade-master() {
--zone
"
${
ZONE
}
"
\
"
${
MASTER_NAME
}
"
write-master-env
gcloud compute instances create
"
${
MASTER_NAME
}
"
\
--address
"
${
MASTER_NAME
}
-ip"
\
--project
"
${
PROJECT
}
"
\
--zone
"
${
ZONE
}
"
\
--machine-type
"
${
MASTER_SIZE
}
"
\
--image-project
=
"
${
IMAGE_PROJECT
}
"
\
--image
"
${
IMAGE
}
"
\
--tags
"
${
MASTER_TAG
}
"
\
--network
"
${
NETWORK
}
"
\
--scopes
"storage-ro"
"compute-rw"
\
--can-ip-forward
\
--metadata-from-file
\
"startup-script=
${
KUBE_ROOT
}
/cluster/gce/configure-vm.sh"
\
"kube-env=
${
KUBE_TEMP
}
/master-kube-env.yaml"
\
--disk
name
=
"
${
MASTER_NAME
}
-pd"
device-name
=
master-pd
mode
=
rw
boot
=
no auto-delete
=
no
create-master-instance
"
${
MASTER_NAME
}
-ip"
wait-for-master
}
...
...
cluster/gce/util.sh
View file @
616c6be6
...
...
@@ -487,6 +487,42 @@ function write-node-env {
build-kube-env
false
"
${
KUBE_TEMP
}
/node-kube-env.yaml"
}
# create-master-instance creates the master instance. If called with
# an argument, the argument is used as the name to a reserved IP
# address for the master. (In the case of upgrade/repair, we re-use
# the same IP.)
#
# It requires a whole slew of assumed variables, partially due to to
# the call to write-master-env. Listing them would be rather
# futile. Instead, we list the required calls to ensure any additional
# variables are set:
# ensure-temp-dir
# detect-project
# get-password
# set-master-htpasswd
#
function
create-master-instance
{
local
address_opt
=
""
[[
-n
${
1
:-}
]]
&&
address_opt
=
"--address
${
1
}
"
write-master-env
gcloud compute instances create
"
${
MASTER_NAME
}
"
\
${
address_opt
}
\
--project
"
${
PROJECT
}
"
\
--zone
"
${
ZONE
}
"
\
--machine-type
"
${
MASTER_SIZE
}
"
\
--image-project
=
"
${
IMAGE_PROJECT
}
"
\
--image
"
${
IMAGE
}
"
\
--tags
"
${
MASTER_TAG
}
"
\
--network
"
${
NETWORK
}
"
\
--scopes
"storage-ro"
"compute-rw"
\
--can-ip-forward
\
--metadata-from-file
\
"startup-script=
${
KUBE_ROOT
}
/cluster/gce/configure-vm.sh"
\
"kube-env=
${
KUBE_TEMP
}
/master-kube-env.yaml"
\
--disk
name
=
"
${
MASTER_NAME
}
-pd"
device-name
=
master-pd
mode
=
rw
boot
=
no auto-delete
=
no
}
# Instantiate a kubernetes cluster
#
# Assumed vars
...
...
@@ -546,21 +582,7 @@ function kube-up {
# https://github.com/GoogleCloudPlatform/kubernetes/issues/3168
KUBELET_TOKEN
=
$(
dd
if
=
/dev/urandom
bs
=
128
count
=
1 2>/dev/null |
base64
|
tr
-d
"=+/"
|
dd
bs
=
32
count
=
1 2>/dev/null
)
write-master-env
gcloud compute instances create
"
${
MASTER_NAME
}
"
\
--project
"
${
PROJECT
}
"
\
--zone
"
${
ZONE
}
"
\
--machine-type
"
${
MASTER_SIZE
}
"
\
--image-project
=
"
${
IMAGE_PROJECT
}
"
\
--image
"
${
IMAGE
}
"
\
--tags
"
${
MASTER_TAG
}
"
\
--network
"
${
NETWORK
}
"
\
--scopes
"storage-ro"
"compute-rw"
\
--can-ip-forward
\
--metadata-from-file
\
"startup-script=
${
KUBE_ROOT
}
/cluster/gce/configure-vm.sh"
\
"kube-env=
${
KUBE_TEMP
}
/master-kube-env.yaml"
\
--disk
name
=
"
${
MASTER_NAME
}
-pd"
device-name
=
master-pd
mode
=
rw
boot
=
no auto-delete
=
no &
create-master-instance &
# Create a single firewall rule for all minions.
create-firewall-rule
"
${
MINION_TAG
}
-all"
"
${
CLUSTER_IP_RANGE
}
"
"
${
MINION_TAG
}
"
&
...
...
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