You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.6 KiB

  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: kube-scheduler
  5. namespace: {{ system_namespace }}
  6. labels:
  7. k8s-app: kube-scheduler
  8. annotations:
  9. kubespray.scheduler-cert/serial: "{{ scheduler_cert_serial }}"
  10. spec:
  11. hostNetwork: true
  12. {% if kube_version | version_compare('v1.6', '>=') %}
  13. dnsPolicy: ClusterFirst
  14. {% endif %}
  15. containers:
  16. - name: kube-scheduler
  17. image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}
  18. imagePullPolicy: {{ k8s_image_pull_policy }}
  19. resources:
  20. limits:
  21. cpu: {{ kube_scheduler_cpu_limit }}
  22. memory: {{ kube_scheduler_memory_limit }}
  23. requests:
  24. cpu: {{ kube_scheduler_cpu_requests }}
  25. memory: {{ kube_scheduler_memory_requests }}
  26. command:
  27. - /hyperkube
  28. - scheduler
  29. - --leader-elect=true
  30. - --kubeconfig={{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml
  31. {% if volume_cross_zone_attachment %}
  32. - --policy-config-file={{ kube_config_dir }}/kube-scheduler-policy.yaml
  33. {% endif %}
  34. - --profiling=false
  35. - --v={{ kube_log_level }}
  36. {% if kube_feature_gates %}
  37. - --feature-gates={{ kube_feature_gates|join(',') }}
  38. {% endif %}
  39. {% if scheduler_custom_flags is string %}
  40. - {{ scheduler_custom_flags }}
  41. {% else %}
  42. {% for flag in scheduler_custom_flags %}
  43. - {{ flag }}
  44. {% endfor %}
  45. {% endif %}
  46. livenessProbe:
  47. httpGet:
  48. host: 127.0.0.1
  49. path: /healthz
  50. port: 10251
  51. initialDelaySeconds: 30
  52. timeoutSeconds: 10
  53. volumeMounts:
  54. - mountPath: /etc/ssl
  55. name: ssl-certs-host
  56. readOnly: true
  57. {% for dir in ssl_ca_dirs %}
  58. - mountPath: {{ dir }}
  59. name: {{ dir | regex_replace('^/(.*)$', '\\1' ) | regex_replace('/', '-') }}
  60. readOnly: true
  61. {% endfor %}
  62. - mountPath: "{{ kube_config_dir }}/ssl"
  63. name: etc-kube-ssl
  64. readOnly: true
  65. - mountPath: "{{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml"
  66. name: kubeconfig
  67. readOnly: true
  68. {% if volume_cross_zone_attachment %}
  69. - mountPath: "{{ kube_config_dir }}/kube-scheduler-policy.yaml"
  70. name: kube-scheduler-policy
  71. readOnly: true
  72. {% endif %}
  73. volumes:
  74. - name: ssl-certs-host
  75. hostPath:
  76. path: /etc/ssl
  77. {% for dir in ssl_ca_dirs %}
  78. - name: {{ dir | regex_replace('^/(.*)$', '\\1' ) | regex_replace('/', '-') }}
  79. hostPath:
  80. path: {{ dir }}
  81. {% endfor %}
  82. - name: etc-kube-ssl
  83. hostPath:
  84. path: "{{ kube_config_dir }}/ssl"
  85. - name: kubeconfig
  86. hostPath:
  87. path: "{{ kube_config_dir }}/kube-scheduler-kubeconfig.yaml"
  88. {% if volume_cross_zone_attachment %}
  89. - name: kube-scheduler-policy
  90. hostPath:
  91. path: "{{ kube_config_dir }}/kube-scheduler-policy.yaml"
  92. {% endif %}