
separated from the apiserver running locally on the master node so that it can be optionally enabled or disabled as needed. Also, fix the healthchecking configuration for the master components, which was previously only working by coincidence: If a kubelet doesn't register with a master, it never bothers to figure out what its local address is. In which case it ends up constructing a URL like http://:8080/healthz for the http probe. This happens to work on the master because all of the pods are using host networking and explicitly binding to 127.0.0.1. Once the kubelet is registered with the master and it determines the local node address, it tries to healthcheck on an address where the pod isn't listening and the kubelet periodically restarts each master component when the liveness probe fails.
56 lines
1.3 KiB
Plaintext
56 lines
1.3 KiB
Plaintext
{% set params = "{{pillar['log_level']}}" -%}
|
|
|
|
# test_args has to be kept at the end, so they'll overwrite any prior configuration
|
|
{% if pillar['scheduler_test_args'] is defined -%}
|
|
{% set params = params + " " + pillar['scheduler_test_args'] -%}
|
|
{% endif -%}
|
|
|
|
{
|
|
"apiVersion": "v1",
|
|
"kind": "Pod",
|
|
"metadata": {
|
|
"name":"kube-scheduler",
|
|
"namespace": "kube-system"
|
|
},
|
|
"spec":{
|
|
"hostNetwork": true,
|
|
"containers":[
|
|
{
|
|
"name": "kube-scheduler",
|
|
"image": "gcr.io/google_containers/kube-scheduler:{{pillar['kube-scheduler_docker_tag']}}",
|
|
"resources": {
|
|
"limits": {
|
|
"cpu": "200m"
|
|
}
|
|
},
|
|
"command": [
|
|
"/bin/sh",
|
|
"-c",
|
|
"/usr/local/bin/kube-scheduler --master=127.0.0.1:8080 {{params}} 1>>/var/log/kube-scheduler.log 2>&1"
|
|
],
|
|
"livenessProbe": {
|
|
"httpGet": {
|
|
"host": "127.0.0.1",
|
|
"port": 10251,
|
|
"path": "/healthz"
|
|
},
|
|
"initialDelaySeconds": 15,
|
|
"timeoutSeconds": 15
|
|
},
|
|
"volumeMounts": [
|
|
{
|
|
"name": "logfile",
|
|
"mountPath": "/var/log/kube-scheduler.log",
|
|
"readOnly": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"volumes":[
|
|
{ "name": "logfile",
|
|
"hostPath": {
|
|
"path": "/var/log/kube-scheduler.log"}
|
|
}
|
|
]
|
|
}}
|