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
73ee5080
Commit
73ee5080
authored
May 03, 2016
by
Andy Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GCI: Add two GCI specific metadata pairs
parent
ae6dec63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
7 deletions
+40
-7
helper.sh
cluster/gce/trusty/helper.sh
+40
-7
No files found.
cluster/gce/trusty/helper.sh
View file @
73ee5080
...
...
@@ -18,17 +18,45 @@
# The configuration is based on upstart, which is in Ubuntu up to 14.04 LTS (Trusty).
# Ubuntu 15.04 and above replaced upstart with systemd as the init system.
# Consequently, the configuration cannot work on these images.
# Consequently, the configuration cannot work on these images. In release-1.2 branch,
# GCI and Trusty share the configuration code. We have to keep the GCI specific code
# here as long as the release-1.2 branch has not been deprecated.
# Creates the GCI specific metadata files if they do not exit.
# Assumed var
# KUBE_TEMP
function
ensure-gci-metadata-files
{
if
[[
!
-f
"
${
KUBE_TEMP
}
/gci-update.txt"
]]
;
then
cat
>
"
${
KUBE_TEMP
}
/gci-update.txt"
<<
EOF
update_disabled
EOF
fi
if
[[
!
-f
"
${
KUBE_TEMP
}
/gci-docker.txt"
]]
;
then
cat
>
"
${
KUBE_TEMP
}
/gci-docker.txt"
<<
EOF
true
EOF
fi
}
# $1: template name (required)
function
create-node-instance-template
{
local
template_name
=
"
$1
"
create-node-template
"
$template_name
"
"
${
scope_flags
[*]
}
"
\
"kube-env=
${
KUBE_TEMP
}
/node-kube-env.yaml"
\
"user-data=
${
KUBE_ROOT
}
/cluster/gce/trusty/node.yaml"
\
"configure-sh=
${
KUBE_ROOT
}
/cluster/gce/trusty/configure.sh"
\
"cluster-name=
${
KUBE_TEMP
}
/cluster-name.txt"
if
[[
"
${
OS_DISTRIBUTION
}
"
==
"gci"
&&
"
${
NODE_IMAGE
}
"
==
gci
*
]]
;
then
ensure-gci-metadata-files
create-node-template
"
$template_name
"
"
${
scope_flags
[*]
}
"
\
"kube-env=
${
KUBE_TEMP
}
/node-kube-env.yaml"
\
"user-data=
${
KUBE_ROOT
}
/cluster/gce/trusty/node.yaml"
\
"configure-sh=
${
KUBE_ROOT
}
/cluster/gce/trusty/configure.sh"
\
"cluster-name=
${
KUBE_TEMP
}
/cluster-name.txt"
\
"gci-update-strategy=
${
KUBE_TEMP
}
/gci-update.txt"
\
"gci-ensure-gke-docker=
${
KUBE_TEMP
}
/gci-docker.txt"
else
create-node-template
"
$template_name
"
"
${
scope_flags
[*]
}
"
\
"kube-env=
${
KUBE_TEMP
}
/node-kube-env.yaml"
\
"user-data=
${
KUBE_ROOT
}
/cluster/gce/trusty/node.yaml"
\
"configure-sh=
${
KUBE_ROOT
}
/cluster/gce/trusty/configure.sh"
\
"cluster-name=
${
KUBE_TEMP
}
/cluster-name.txt"
fi
}
# create-master-instance creates the master instance. If called with
...
...
@@ -47,6 +75,11 @@ function create-node-instance-template {
function
create-master-instance
{
local
address_opt
=
""
[[
-n
${
1
:-}
]]
&&
address_opt
=
"--address
${
1
}
"
local
image_metadata
=
""
if
[[
"
${
OS_DISTRIBUTION
}
"
==
"gci"
&&
"
${
MASTER_IMAGE
}
"
==
gci
*
]]
;
then
ensure-gci-metadata-files
image_metadata
=
",gci-update-strategy=
${
KUBE_TEMP
}
/gci-update.txt,gci-ensure-gke-docker=
${
KUBE_TEMP
}
/gci-docker.txt"
fi
write-master-env
gcloud compute instances create
"
${
MASTER_NAME
}
"
\
...
...
@@ -61,6 +94,6 @@ function create-master-instance {
--scopes
"storage-ro,compute-rw,monitoring,logging-write"
\
--can-ip-forward
\
--metadata-from-file
\
"kube-env=
${
KUBE_TEMP
}
/master-kube-env.yaml,user-data=
${
KUBE_ROOT
}
/cluster/gce/trusty/master.yaml,configure-sh=
${
KUBE_ROOT
}
/cluster/gce/trusty/configure.sh,cluster-name=
${
KUBE_TEMP
}
/cluster-name.txt"
\
"kube-env=
${
KUBE_TEMP
}
/master-kube-env.yaml,user-data=
${
KUBE_ROOT
}
/cluster/gce/trusty/master.yaml,configure-sh=
${
KUBE_ROOT
}
/cluster/gce/trusty/configure.sh,cluster-name=
${
KUBE_TEMP
}
/cluster-name.txt
${
image_metadata
}
"
\
--disk
"name=
${
MASTER_NAME
}
-pd,device-name=master-pd,mode=rw,boot=no,auto-delete=no"
}
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