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" - "/etc/kubernetes/kube-scheduler.kubeconfig"
tags: upgrade_k8s, restart_master 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 文件 - name: 创建 master 服务的 systemd unit 文件
template: src={{ item }}.j2 dest=/etc/systemd/system/{{ item }} template: src={{ item }}.j2 dest=/etc/systemd/system/{{ item }}
with_items: 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] [Service]
ExecStart={{ bin_dir }}/kube-scheduler \ ExecStart={{ bin_dir }}/kube-scheduler \
--bind-address={{ inventory_hostname }} \ --config=/etc/kubernetes/kube-scheduler-config.yaml \
--kubeconfig=/etc/kubernetes/kube-scheduler.kubeconfig \
--leader-elect=true \
--v=2 --v=2
Restart=always Restart=always
RestartSec=5 RestartSec=5