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
c3b0a83a
Commit
c3b0a83a
authored
Jan 02, 2018
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configurable liveness probe initial delays for etcd and kube-apiserver in GCE
parent
da9a4d5d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
2 deletions
+29
-2
common.sh
cluster/common.sh
+10
-0
configure-vm.sh
cluster/gce/configure-vm.sh
+10
-0
configure-helper.sh
cluster/gce/container-linux/configure-helper.sh
+2
-0
configure-helper.sh
cluster/gce/gci/configure-helper.sh
+2
-0
etcd.manifest
cluster/saltbase/salt/etcd/etcd.manifest
+2
-1
kube-apiserver.manifest
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest
+3
-1
No files found.
cluster/common.sh
View file @
c3b0a83a
...
...
@@ -840,6 +840,16 @@ EOF
ETCD_HOSTNAME:
$(
yaml-quote
${
ETCD_HOSTNAME
})
EOF
fi
if
[
-n
"
${
ETCD_LIVENESS_PROBE_INITIAL_DELAY_SEC
:-}
"
]
;
then
cat
>>
$file
<<
EOF
ETCD_LIVENESS_PROBE_INITIAL_DELAY_SEC:
$(
yaml-quote
${
ETCD_LIVENESS_PROBE_INITIAL_DELAY_SEC
})
EOF
fi
if
[
-n
"
${
KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC
:-}
"
]
;
then
cat
>>
$file
<<
EOF
KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC:
$(
yaml-quote
${
KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC
})
EOF
fi
if
[
-n
"
${
APISERVER_TEST_ARGS
:-}
"
]
;
then
cat
>>
$file
<<
EOF
APISERVER_TEST_ARGS:
$(
yaml-quote
${
APISERVER_TEST_ARGS
})
...
...
cluster/gce/configure-vm.sh
View file @
c3b0a83a
...
...
@@ -496,6 +496,16 @@ EOF
kube_apiserver_request_timeout_sec: '
$(
echo
"
$KUBE_APISERVER_REQUEST_TIMEOUT_SEC
"
|
sed
-e
"s/'/''/g"
)
'
EOF
fi
if
[
-n
"
${
ETCD_LIVENESS_PROBE_INITIAL_DELAY_SEC
:-}
"
]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
etcd_liveness_probe_initial_delay: '
$(
echo
"
$ETCD_LIVENESS_PROBE_INITIAL_DELAY_SEC
"
|
sed
-e
"s/'/''/g"
)
'
EOF
fi
if
[
-n
"
${
KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC
:-}
"
]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
kube_apiserver_liveness_probe_initial_delay: '
$(
echo
"
$KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC
"
|
sed
-e
"s/'/''/g"
)
'
EOF
fi
if
[
-n
"
${
ADMISSION_CONTROL
:-}
"
]
&&
[
${
ADMISSION_CONTROL
}
==
*
"ImagePolicyWebhook"
*
]
;
then
cat
<<
EOF
>>/srv/salt-overlay/pillar/cluster-params.sls
admission-control-config-file: /etc/admission_controller.config
...
...
cluster/gce/container-linux/configure-helper.sh
View file @
c3b0a83a
...
...
@@ -778,6 +778,7 @@ function prepare-etcd-manifest {
sed
-i
-e
"s@{{ *hostname *}}@
$host_name
@g"
"
${
temp_file
}
"
sed
-i
-e
"s@{{ *srv_kube_path *}}@/etc/srv/kubernetes@g"
"
${
temp_file
}
"
sed
-i
-e
"s@{{ *etcd_cluster *}}@
$etcd_cluster
@g"
"
${
temp_file
}
"
sed
-i
-e
"s@{{ *liveness_probe_initial_delay *}}@
${
ETCD_LIVENESS_PROBE_INITIAL_DELAY_SEC
:-
15
}
@g"
"
${
temp_file
}
"
# Get default storage backend from manifest file.
local
-r
default_storage_backend
=
$(
cat
"
${
temp_file
}
"
|
\
grep
-o
"{{ *pillar
\.
get('storage_backend', '
\(
.*
\)
') *}}"
|
\
...
...
@@ -1060,6 +1061,7 @@ function start-kube-apiserver {
sed
-i
-e
"s@{{pillar
\[
'kube_docker_registry'
\]
}}@
${
DOCKER_REGISTRY
}
@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{pillar
\[
'kube-apiserver_docker_tag'
\]
}}@
${
kube_apiserver_docker_tag
}
@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{pillar
\[
'allow_privileged'
\]
}}@true@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{liveness_probe_initial_delay}}@
${
KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC
:-
15
}
@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{secure_port}}@443@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{secure_port}}@8080@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{additional_cloud_config_mount}}@@g"
"
${
src_file
}
"
...
...
cluster/gce/gci/configure-helper.sh
View file @
c3b0a83a
...
...
@@ -1372,6 +1372,7 @@ function prepare-etcd-manifest {
sed
-i
-e
"s@{{ *hostname *}}@
$host_name
@g"
"
${
temp_file
}
"
sed
-i
-e
"s@{{ *srv_kube_path *}}@/etc/srv/kubernetes@g"
"
${
temp_file
}
"
sed
-i
-e
"s@{{ *etcd_cluster *}}@
$etcd_cluster
@g"
"
${
temp_file
}
"
sed
-i
-e
"s@{{ *liveness_probe_initial_delay *}}@
${
ETCD_LIVENESS_PROBE_INITIAL_DELAY_SEC
:-
15
}
@g"
"
${
temp_file
}
"
# Get default storage backend from manifest file.
local
-r
default_storage_backend
=
$(
cat
"
${
temp_file
}
"
|
\
grep
-o
"{{ *pillar
\.
get('storage_backend', '
\(
.*
\)
') *}}"
|
\
...
...
@@ -1747,6 +1748,7 @@ function start-kube-apiserver {
sed
-i
-e
"s@{{pillar
\[
'kube_docker_registry'
\]
}}@
${
DOCKER_REGISTRY
}
@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{pillar
\[
'kube-apiserver_docker_tag'
\]
}}@
${
kube_apiserver_docker_tag
}
@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{pillar
\[
'allow_privileged'
\]
}}@true@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{liveness_probe_initial_delay}}@
${
KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC
:-
15
}
@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{secure_port}}@443@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{secure_port}}@8080@g"
"
${
src_file
}
"
sed
-i
-e
"s@{{additional_cloud_config_mount}}@@g"
"
${
src_file
}
"
...
...
cluster/saltbase/salt/etcd/etcd.manifest
View file @
c3b0a83a
...
...
@@ -22,6 +22,7 @@
{% if pillar.get('storage_backend', 'etcd3') == 'etcd3' -%}
{% set quota_bytes = '--quota-backend-bytes=4294967296' -%}
{% endif -%}
{% set liveness_probe_initial_delay = pillar.get('etcd_liveness_probe_initial_delay', 15) -%}
{% set srv_kube_path = "/srv/kubernetes" -%}
{
...
...
@@ -67,7 +68,7 @@
"port": {{ port }},
"path": "/health"
},
"initialDelaySeconds":
15
,
"initialDelaySeconds":
{{ liveness_probe_initial_delay }}
,
"timeoutSeconds": 15
},
"ports": [
...
...
cluster/saltbase/salt/kube-apiserver/kube-apiserver.manifest
View file @
c3b0a83a
...
...
@@ -66,6 +66,8 @@
{% set storage_media_type = "--storage-media-type=" + pillar['storage_media_type'] -%}
{% endif -%}
{% set liveness_probe_initial_delay = pillar.get('kube_apiserver_liveness_probe_initial_delay', 15) -%}
{% set request_timeout = "" -%}
{% if pillar['kube_apiserver_request_timeout_sec'] is defined -%}
{% set request_timeout = "--request-timeout=" + pillar['kube_apiserver_request_timeout_sec'] + "s" -%}
...
...
@@ -248,7 +250,7 @@
"port": 8080,
"path": "/healthz"
},
"initialDelaySeconds":
15
,
"initialDelaySeconds":
{{liveness_probe_initial_delay}}
,
"timeoutSeconds": 15
},
"ports":[
...
...
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