diff --git a/roles/kubernetes/master/tasks/static-pod-setup.yml b/roles/kubernetes/master/tasks/static-pod-setup.yml index cd6c09194..151f7ad54 100644 --- a/roles/kubernetes/master/tasks/static-pod-setup.yml +++ b/roles/kubernetes/master/tasks/static-pod-setup.yml @@ -9,6 +9,13 @@ - meta: flush_handlers +- name: Write kube-scheduler policy file + template: + src: kube-scheduler-policy.yaml.j2 + dest: "{{ kube_config_dir }}/kube-scheduler-policy.yaml" + tags: + - kube-scheduler + - name: Write kube-scheduler kubeconfig template: src: kube-scheduler-kubeconfig.yaml.j2 @@ -39,4 +46,4 @@ tags: - kube-controller-manager -- meta: flush_handlers \ No newline at end of file +- meta: flush_handlers diff --git a/roles/kubernetes/master/templates/manifests/kube-scheduler.manifest.j2 b/roles/kubernetes/master/templates/manifests/kube-scheduler.manifest.j2 index d50c10ed7..fd1d24547 100644 --- a/roles/kubernetes/master/templates/manifests/kube-scheduler.manifest.j2 +++ b/roles/kubernetes/master/templates/manifests/kube-scheduler.manifest.j2 @@ -28,6 +28,9 @@ spec: - scheduler - --leader-elect=true - --kubeconfig={{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml +{% if cloud_provider == 'openstack' %} + - --policy-config-file={{ kube_config_dir }}/kube-scheduler-policy.yaml +{% endif %} - --profiling=false - --v={{ kube_log_level }} {% if kube_feature_gates %} @@ -62,6 +65,11 @@ spec: - mountPath: "{{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml" name: kubeconfig readOnly: true +{% if cloud_provider == 'openstack' %} + - mountPath: "{{ kube_config_dir }}/kube-scheduler-policy.yaml" + name: kube-scheduler-policy + readOnly: true +{% endif %} volumes: - name: ssl-certs-host hostPath: @@ -77,3 +85,8 @@ spec: - name: kubeconfig hostPath: path: "{{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml" +{% if cloud_provider == 'openstack' %} + - name: kube-scheduler-policy + hostPath: + path: "{{ kube_config_dir }}/kube-scheduler-policy.yaml" +{% endif %}