update to use kube-scheduler-config.yaml

pull/992/head
gjmzj 2021-02-15 09:55:37 +08:00
parent 67e33c4eb8
commit 0798b2855a
3 changed files with 13 additions and 3 deletions

View File

@ -64,6 +64,10 @@
- "/etc/kubernetes/kube-scheduler.kubeconfig"
tags: upgrade_k8s, restart_master
- name: 创建 kube-scheduler 配置文件
template: src=kube-scheduler-config.yaml.j2 dest=/etc/kubernetes/kube-scheduler-config.yaml
tags: restart_master, upgrade_k8s
- name: 创建 master 服务的 systemd unit 文件
template: src={{ item }}.j2 dest=/etc/systemd/system/{{ item }}
with_items:

View File

@ -0,0 +1,8 @@
apiVersion: kubescheduler.config.k8s.io/v1beta1
kind: KubeSchedulerConfiguration
clientConnection:
kubeconfig: "/etc/kubernetes/kube-scheduler.kubeconfig"
healthzBindAddress: {{ inventory_hostname }}:10251
leaderElection:
leaderElect: true
metricsBindAddress: {{ inventory_hostname }}:10251

View File

@ -4,9 +4,7 @@ Documentation=https://github.com/GoogleCloudPlatform/kubernetes
[Service]
ExecStart={{ bin_dir }}/kube-scheduler \
--bind-address={{ inventory_hostname }} \
--kubeconfig=/etc/kubernetes/kube-scheduler.kubeconfig \
--leader-elect=true \
--config=/etc/kubernetes/kube-scheduler-config.yaml \
--v=2
Restart=always
RestartSec=5