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.

73 lines
2.5 KiB

  1. ---
  2. # Copyright 2016 The Kubernetes Authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. apiVersion: extensions/v1beta1
  16. kind: Deployment
  17. metadata:
  18. name: kubedns-autoscaler
  19. namespace: kube-system
  20. labels:
  21. k8s-app: kubedns-autoscaler
  22. kubernetes.io/cluster-service: "true"
  23. addonmanager.kubernetes.io/mode: Reconcile
  24. spec:
  25. template:
  26. metadata:
  27. labels:
  28. k8s-app: kubedns-autoscaler
  29. spec:
  30. {% if kube_version is version('v1.11.1', '>=') %}
  31. priorityClassName: system-cluster-critical
  32. {% endif %}
  33. # When having win nodes in cluster without this patch, this pod cloud try to be created in windows
  34. nodeSelector:
  35. beta.kubernetes.io/os: linux
  36. tolerations:
  37. - effect: NoSchedule
  38. operator: Equal
  39. key: node-role.kubernetes.io/master
  40. affinity:
  41. podAntiAffinity:
  42. requiredDuringSchedulingIgnoredDuringExecution:
  43. - topologyKey: "kubernetes.io/hostname"
  44. labelSelector:
  45. matchLabels:
  46. k8s-app: kubedns-autoscaler
  47. nodeAffinity:
  48. preferredDuringSchedulingIgnoredDuringExecution:
  49. - weight: 100
  50. preference:
  51. matchExpressions:
  52. - key: node-role.kubernetes.io/master
  53. operator: In
  54. values:
  55. - "true"
  56. containers:
  57. - name: autoscaler
  58. image: "{{ kubednsautoscaler_image_repo }}:{{ kubednsautoscaler_image_tag }}"
  59. resources:
  60. requests:
  61. cpu: "20m"
  62. memory: "10Mi"
  63. command:
  64. - /cluster-proportional-autoscaler
  65. - --namespace=kube-system
  66. - --configmap=kubedns-autoscaler
  67. # Should keep target in sync with cluster/addons/dns/kubedns-controller.yaml.base
  68. - --target=Deployment/kube-dns
  69. - --default-params={"linear":{"nodesPerReplica":{{ kubedns_nodes_per_replica }},"min":{{ kubedns_min_replicas }}}}
  70. - --logtostderr=true
  71. - --v=2
  72. serviceAccountName: cluster-proportional-autoscaler