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
372c9271
Commit
372c9271
authored
Feb 10, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20871 from andyzheng0831/kube-addon
Auto commit by PR queue bot
parents
808209de
20444558
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
29 deletions
+48
-29
configure.sh
cluster/gce/trusty/configure.sh
+10
-28
master.yaml
cluster/gce/trusty/master.yaml
+38
-1
No files found.
cluster/gce/trusty/configure.sh
View file @
372c9271
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
# limitations under the License.
# limitations under the License.
# This script contains functions for configuring instances to run kubernetes
# This script contains functions for configuring instances to run kubernetes
#
nodes. It is uploaded to GCE metadata server when a VM instance is created,
#
master and nodes. It is uploaded as GCE instance metadata. The upstart jobs
#
and then downloaded by the instance. The upstart jobs in
#
in cluster/gce/trusty/<node.yaml, master.yaml> download it and make use
#
cluster/gce/trusty/node.yaml source this script to make use of needed
#
of needed functions. The script itself is not supposed to be executed in
#
functions. The script itself is not supposed to be executed in
other manners.
# other manners.
config_hostname
()
{
config_hostname
()
{
# Set the hostname to the short version.
# Set the hostname to the short version.
...
@@ -441,10 +441,6 @@ compute_master_manifest_variables() {
...
@@ -441,10 +441,6 @@ compute_master_manifest_variables() {
if
[
-n
"
${
KUBE_DOCKER_REGISTRY
:-}
"
]
;
then
if
[
-n
"
${
KUBE_DOCKER_REGISTRY
:-}
"
]
;
then
DOCKER_REGISTRY
=
${
KUBE_DOCKER_REGISTRY
}
DOCKER_REGISTRY
=
${
KUBE_DOCKER_REGISTRY
}
fi
fi
KUBECTL_BIN
=
"/usr/bin/kubectl"
if
[
"
${
TEST_CLUSTER
:-}
"
=
"true"
]
;
then
KUBECTL_BIN
=
"/usr/local/bin/kubectl"
fi
}
}
# Starts k8s apiserver.
# Starts k8s apiserver.
...
@@ -621,13 +617,7 @@ setup_addon_manifests() {
...
@@ -621,13 +617,7 @@ setup_addon_manifests() {
}
}
# Start k8s addons static pods.
# Start k8s addons static pods.
#
prepare_kube_addons
()
{
# Assumed vars (which are calculated in function compute_master_manifest_variables)
# KUBECTL_BIN
start_kube_addons
()
{
# Fluentd
start_fluentd
addon_src_dir
=
"/run/kube-manifests/kubernetes/trusty"
addon_src_dir
=
"/run/kube-manifests/kubernetes/trusty"
addon_dst_dir
=
"/etc/kubernetes/addons"
addon_dst_dir
=
"/etc/kubernetes/addons"
# Set up manifests of other addons.
# Set up manifests of other addons.
...
@@ -684,27 +674,19 @@ start_kube_addons() {
...
@@ -684,27 +674,19 @@ start_kube_addons() {
setup_addon_manifests
"addons"
"fluentd-elasticsearch"
setup_addon_manifests
"addons"
"fluentd-elasticsearch"
fi
fi
if
[
"
${
ENABLE_CLUSTER_UI
:-}
"
=
"true"
]
;
then
if
[
"
${
ENABLE_CLUSTER_UI
:-}
"
=
"true"
]
;
then
setup_addon_manifests
"addons"
"
kube-ui
"
setup_addon_manifests
"addons"
"
dashboard
"
fi
fi
if
echo
"
${
ADMISSION_CONTROL
:-}
"
|
grep
-q
"LimitRanger"
;
then
if
echo
"
${
ADMISSION_CONTROL
:-}
"
|
grep
-q
"LimitRanger"
;
then
setup_addon_manifests
"admission-controls"
"limit-range"
setup_addon_manifests
"admission-controls"
"limit-range"
fi
fi
#
Run scripts to start addons placed in /etc/kubernetes/addons
#
Prepare the scripts for running addons.
addon_script_dir
=
"/var/lib/cloud/scripts/kubernetes"
addon_script_dir
=
"/var/lib/cloud/scripts/kubernetes"
mkdir
-p
"
${
addon_script_dir
}
"
mkdir
-p
"
${
addon_script_dir
}
"
cp
"
${
addon_src_dir
}
/kube-addons.sh"
"
${
addon_script_dir
}
"
cp
"
${
addon_src_dir
}
/kube-addons.sh"
"
${
addon_script_dir
}
"
cp
"
${
addon_src_dir
}
/kube-addon-update.sh"
"
${
addon_script_dir
}
"
cp
"
${
addon_src_dir
}
/kube-addon-update.sh"
"
${
addon_script_dir
}
"
chmod
544
"
${
addon_script_dir
}
/"
*
.sh
chmod
544
"
${
addon_script_dir
}
/"
*
.sh
# In case that upstart does not set the HOME variable or sometimes
# In case that some GCE customized trusty may have a read-only /root.
# GCE customized trusty has a read-only /root.
mount
-t
tmpfs tmpfs /root
export
HOME
=
"/root"
mount
--bind
-o
remount,rw,noexec /root
mount
-t
tmpfs tmpfs
"
${
HOME
}
"
mount
--bind
-o
remount,rw,noexec
"
${
HOME
}
"
export
KUBECTL_BIN
export
TOKEN_DIR
=
"/etc/srv/kubernetes"
export
kubelet_kubeconfig_file
=
"/var/lib/kubelet/kubeconfig"
export
TRUSTY_MASTER
=
"true"
# Run the script to start and monitoring addon manifest changes.
/bin/bash
"
${
addon_script_dir
}
/kube-addons.sh"
}
}
cluster/gce/trusty/master.yaml
View file @
372c9271
...
@@ -204,17 +204,54 @@ script
...
@@ -204,17 +204,54 @@ script
. /etc/kube-configure.sh
. /etc/kube-configure.sh
. /etc/kube-env
. /etc/kube-env
start_etcd_servers
start_etcd_servers
start_fluentd
compute_master_manifest_variables
compute_master_manifest_variables
start_kube_apiserver
start_kube_apiserver
start_kube_controller_manager
start_kube_controller_manager
start_kube_scheduler
start_kube_scheduler
start
_kube_addons
prepare
_kube_addons
end script
end script
--====================================
--====================================
MIME-Version
:
1.0
MIME-Version
:
1.0
Content-Type
:
text/upstart-job; charset="us-ascii"
Content-Type
:
text/upstart-job; charset="us-ascii"
Content-Transfer-Encoding
:
7bit
Content-Transfer-Encoding
:
7bit
Content-Disposition
:
attachment; filename="kube-addons.conf"
#upstart-job
description "Run kubernetes addon pods"
start on stopped kube-master-components
respawn
script
set -o errexit
set -o nounset
. /etc/kube-env
export HOME="/root"
if [ "${TEST_CLUSTER:-}" = "true" ]; then
export KUBECTL_BIN="/usr/local/bin/kubectl"
else
export KUBECTL_BIN="/usr/bin/kubectl"
fi
export TOKEN_DIR="/etc/srv/kubernetes"
export kubelet_kubeconfig_file="/var/lib/kubelet/kubeconfig"
export TRUSTY_MASTER="true"
# Run the script to start and monitoring addon manifest changes.
exec /var/lib/cloud/scripts/kubernetes/kube-addons.sh
end script
# Wait for 10s to start it again.
post-stop exec sleep 10
--====================================
MIME-Version
:
1.0
Content-Type
:
text/upstart-job; charset="us-ascii"
Content-Transfer-Encoding
:
7bit
Content-Disposition
:
attachment; filename="kube-master-health-monitoring.conf"
Content-Disposition
:
attachment; filename="kube-master-health-monitoring.conf"
#upstart-job
#upstart-job
...
...
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