2015-12-11 18:52:20 +08:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Pod
|
|
|
|
metadata:
|
|
|
|
name: kube-scheduler
|
2017-06-27 12:27:25 +08:00
|
|
|
namespace: {{ system_namespace }}
|
2016-11-09 21:15:27 +08:00
|
|
|
labels:
|
|
|
|
k8s-app: kube-scheduler
|
2017-09-01 14:02:23 +08:00
|
|
|
annotations:
|
|
|
|
kubespray.scheduler-cert/serial: "{{ scheduler_cert_serial }}"
|
2015-12-11 18:52:20 +08:00
|
|
|
spec:
|
|
|
|
hostNetwork: true
|
2017-03-28 22:33:07 +08:00
|
|
|
{% if kube_version | version_compare('v1.6', '>=') %}
|
2017-04-20 17:07:34 +08:00
|
|
|
dnsPolicy: ClusterFirst
|
2017-03-28 22:33:07 +08:00
|
|
|
{% endif %}
|
2015-12-11 18:52:20 +08:00
|
|
|
containers:
|
|
|
|
- name: kube-scheduler
|
2015-12-14 16:54:58 +08:00
|
|
|
image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}
|
2016-11-22 23:16:04 +08:00
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2016-12-23 22:44:44 +08:00
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: {{ kube_scheduler_cpu_limit }}
|
|
|
|
memory: {{ kube_scheduler_memory_limit }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ kube_scheduler_cpu_requests }}
|
|
|
|
memory: {{ kube_scheduler_memory_requests }}
|
2015-12-11 18:52:20 +08:00
|
|
|
command:
|
|
|
|
- /hyperkube
|
|
|
|
- scheduler
|
2016-03-22 05:25:09 +08:00
|
|
|
- --leader-elect=true
|
2017-06-27 12:27:25 +08:00
|
|
|
- --kubeconfig={{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml
|
2016-11-25 18:33:39 +08:00
|
|
|
- --v={{ kube_log_level }}
|
2017-08-25 04:18:38 +08:00
|
|
|
{% if kube_feature_gates %}
|
|
|
|
- --feature-gates={{ kube_feature_gates|join(',') }}
|
|
|
|
{% endif %}
|
2017-04-17 23:09:34 +08:00
|
|
|
{% if scheduler_custom_flags is string %}
|
|
|
|
- {{ scheduler_custom_flags }}
|
2017-04-18 00:24:24 +08:00
|
|
|
{% else %}
|
2017-04-17 23:09:34 +08:00
|
|
|
{% for flag in scheduler_custom_flags %}
|
2017-04-15 05:33:04 +08:00
|
|
|
- {{ flag }}
|
2017-04-17 23:09:34 +08:00
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2015-12-11 18:52:20 +08:00
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
host: 127.0.0.1
|
|
|
|
path: /healthz
|
|
|
|
port: 10251
|
2016-02-01 20:41:49 +08:00
|
|
|
initialDelaySeconds: 30
|
|
|
|
timeoutSeconds: 10
|
2017-06-27 12:27:25 +08:00
|
|
|
volumeMounts:
|
2017-08-31 03:41:09 +08:00
|
|
|
- mountPath: /etc/ssl
|
2017-06-27 12:27:25 +08:00
|
|
|
name: ssl-certs-host
|
|
|
|
readOnly: true
|
2017-08-31 03:41:09 +08:00
|
|
|
{% for dir in ssl_ca_dirs %}
|
|
|
|
- mountPath: {{ dir }}
|
|
|
|
name: {{ dir | regex_replace('^/(.*)$', '\\1' ) | regex_replace('/', '-') }}
|
|
|
|
readOnly: true
|
|
|
|
{% endfor %}
|
2017-06-27 12:27:25 +08:00
|
|
|
- mountPath: "{{ kube_config_dir }}/ssl"
|
|
|
|
name: etc-kube-ssl
|
|
|
|
readOnly: true
|
|
|
|
- mountPath: "{{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml"
|
|
|
|
name: kubeconfig
|
|
|
|
readOnly: true
|
|
|
|
volumes:
|
|
|
|
- name: ssl-certs-host
|
|
|
|
hostPath:
|
2017-08-31 03:41:09 +08:00
|
|
|
path: /etc/ssl
|
|
|
|
{% for dir in ssl_ca_dirs %}
|
|
|
|
- name: {{ dir | regex_replace('^/(.*)$', '\\1' ) | regex_replace('/', '-') }}
|
|
|
|
hostPath:
|
|
|
|
path: {{ dir }}
|
|
|
|
{% endfor %}
|
2017-06-27 12:27:25 +08:00
|
|
|
- name: etc-kube-ssl
|
|
|
|
hostPath:
|
|
|
|
path: "{{ kube_config_dir }}/ssl"
|
|
|
|
- name: kubeconfig
|
|
|
|
hostPath:
|
|
|
|
path: "{{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml"
|