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
972b6eef
Commit
972b6eef
authored
Dec 04, 2017
by
Michelle Au
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Override recycler pod image in GCE
parent
21751996
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
0 deletions
+47
-0
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+43
-0
kube-controller-manager.manifest
.../kube-controller-manager/kube-controller-manager.manifest
+4
-0
No files found.
cluster/gce/gci/configure-helper.sh
View file @
972b6eef
...
...
@@ -1811,6 +1811,10 @@ function start-kube-controller-manager {
[[
"
${
HPA_USE_REST_CLIENTS
:-}
"
==
"false"
]]
;
then
params+
=
" --horizontal-pod-autoscaler-use-rest-clients=false"
fi
if
[[
-n
"
${
PV_RECYCLER_OVERRIDE_TEMPLATE
:-}
"
]]
;
then
params+
=
" --pv-recycler-pod-template-filepath-nfs=
$PV_RECYCLER_OVERRIDE_TEMPLATE
"
params+
=
" --pv-recycler-pod-template-filepath-hostpath=
$PV_RECYCLER_OVERRIDE_TEMPLATE
"
fi
local
-r
kube_rc_docker_tag
=
$(
cat
/home/kubernetes/kube-docker-files/kube-controller-manager.docker_tag
)
local
container_env
=
""
...
...
@@ -1830,6 +1834,8 @@ function start-kube-controller-manager {
sed
-i
-e
"s@{{cloud_config_volume}}@
${
CLOUD_CONFIG_VOLUME
}
@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{additional_cloud_config_mount}}@@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{additional_cloud_config_volume}}@@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{pv_recycler_mount}}@
${
PV_RECYCLER_MOUNT
}
@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{pv_recycler_volume}}@
${
PV_RECYCLER_VOLUME
}
@g"
"
${
src_file
}
"
cp
"
${
src_file
}
"
/etc/kubernetes/manifests
}
...
...
@@ -2282,11 +2288,47 @@ function override-kubectl {
echo
"export PATH=
${
KUBE_HOME
}
/bin:
\$
PATH"
>
/etc/profile.d/kube_env.sh
}
function
override-pv-recycler
{
if
[[
-z
"
${
PV_RECYCLER_OVERRIDE_TEMPLATE
:-}
"
]]
;
then
echo
"PV_RECYCLER_OVERRIDE_TEMPLATE is not set"
exit
1
fi
PV_RECYCLER_VOLUME
=
"{
\"
name
\"
:
\"
pv-recycler-mount
\"
,
\"
hostPath
\"
: {
\"
path
\"
:
\"
${
PV_RECYCLER_OVERRIDE_TEMPLATE
}
\"
,
\"
type
\"
:
\"
FileOrCreate
\"
}},"
PV_RECYCLER_MOUNT
=
"{
\"
name
\"
:
\"
pv-recycler-mount
\"
,
\"
mountPath
\"
:
\"
${
PV_RECYCLER_OVERRIDE_TEMPLATE
}
\"
,
\"
readOnly
\"
: true},"
cat
>
${
PV_RECYCLER_OVERRIDE_TEMPLATE
}
<<
EOF
version: v1
kind: Pod
metadata:
generateName: pv-recycler-
namespace: default
spec:
activeDeadlineSeconds: 60
restartPolicy: Never
volumes:
- name: vol
containers:
- name: pv-recycler
image: gcr.io/google_containers/busybox:1.27
command:
- /bin/sh
args:
- -c
- test -e /scrub && rm -rf /scrub/..?* /scrub/.[!.]* /scrub/* && test -z
$(
ls
-A
/scrub
)
|| exit 1
volumeMounts:
- name: vol
mountPath: /scrub
EOF
}
########### Main Function ###########
echo
"Start to configure instance for kubernetes"
KUBE_HOME
=
"/home/kubernetes"
CONTAINERIZED_MOUNTER_HOME
=
"
${
KUBE_HOME
}
/containerized_mounter"
PV_RECYCLER_OVERRIDE_TEMPLATE
=
"
${
KUBE_HOME
}
/kube-manifests/kubernetes/pv-recycler-template.yaml"
if
[[
!
-e
"
${
KUBE_HOME
}
/kube-env"
]]
;
then
echo
"The
${
KUBE_HOME
}
/kube-env file does not exist!! Terminate cluster initialization."
exit
1
...
...
@@ -2322,6 +2364,7 @@ if [[ "${KUBERNETES_MASTER:-}" == "true" ]]; then
create-master-auth
create-master-kubelet-auth
create-master-etcd-auth
override-pv-recycler
else
create-node-pki
create-kubelet-kubeconfig
${
KUBERNETES_MASTER_NAME
}
...
...
cluster/saltbase/salt/kube-controller-manager/kube-controller-manager.manifest
View file @
972b6eef
...
...
@@ -34,6 +34,8 @@
{% set cloud_config_volume = "" -%}
{% set additional_cloud_config_mount = "{\"name\": \"usrsharessl\",\"mountPath\": \"/usr/share/ssl\", \"readOnly\": true}, {\"name\": \"usrssl\",\"mountPath\": \"/usr/ssl\", \"readOnly\": true}, {\"name\": \"usrlibssl\",\"mountPath\": \"/usr/lib/ssl\", \"readOnly\": true}, {\"name\": \"usrlocalopenssl\",\"mountPath\": \"/usr/local/openssl\", \"readOnly\": true}," -%}
{% set additional_cloud_config_volume = "{\"name\": \"usrsharessl\",\"hostPath\": {\"path\": \"/usr/share/ssl\"}}, {\"name\": \"usrssl\",\"hostPath\": {\"path\": \"/usr/ssl\"}}, {\"name\": \"usrlibssl\",\"hostPath\": {\"path\": \"/usr/lib/ssl\"}}, {\"name\": \"usrlocalopenssl\",\"hostPath\": {\"path\": \"/usr/local/openssl\"}}," -%}
{% set pv_recycler_mount = "" -%}
{% set pv_recycler_volume = "" -%}
{% set srv_kube_path = "/srv/kubernetes" -%}
{% if grains.cloud is defined -%}
...
...
@@ -131,6 +133,7 @@
"volumeMounts": [
{{cloud_config_mount}}
{{additional_cloud_config_mount}}
{{pv_recycler_mount}}
{ "name": "srvkube",
"mountPath": "{{srv_kube_path}}",
"readOnly": true},
...
...
@@ -158,6 +161,7 @@
"volumes":[
{{cloud_config_volume}}
{{additional_cloud_config_volume}}
{{pv_recycler_volume}}
{ "name": "srvkube",
"hostPath": {
"path": "{{srv_kube_path}}"}
...
...
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