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.

86 lines
3.0 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: apps/v1
  16. kind: Deployment
  17. metadata:
  18. name: dns-autoscaler{{ coredns_ordinal_suffix }}
  19. namespace: kube-system
  20. labels:
  21. k8s-app: dns-autoscaler{{ coredns_ordinal_suffix }}
  22. addonmanager.kubernetes.io/mode: Reconcile
  23. spec:
  24. selector:
  25. matchLabels:
  26. k8s-app: dns-autoscaler{{ coredns_ordinal_suffix }}
  27. template:
  28. metadata:
  29. labels:
  30. k8s-app: dns-autoscaler{{ coredns_ordinal_suffix }}
  31. annotations:
  32. seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
  33. spec:
  34. priorityClassName: system-cluster-critical
  35. securityContext:
  36. supplementalGroups: [ 65534 ]
  37. fsGroup: 65534
  38. nodeSelector:
  39. kubernetes.io/os: linux
  40. tolerations:
  41. - effect: NoSchedule
  42. key: node-role.kubernetes.io/master
  43. - effect: NoSchedule
  44. key: node-role.kubernetes.io/control-plane
  45. affinity:
  46. podAntiAffinity:
  47. requiredDuringSchedulingIgnoredDuringExecution:
  48. - topologyKey: "kubernetes.io/hostname"
  49. labelSelector:
  50. matchLabels:
  51. k8s-app: dns-autoscaler{{ coredns_ordinal_suffix }}
  52. nodeAffinity:
  53. preferredDuringSchedulingIgnoredDuringExecution:
  54. - weight: 100
  55. preference:
  56. matchExpressions:
  57. {% if kube_version is version('v1.20.0', '<') %}
  58. - key: node-role.kubernetes.io/master
  59. {% else %}
  60. - key: node-role.kubernetes.io/control-plane
  61. {% endif %}
  62. operator: In
  63. values:
  64. - ""
  65. containers:
  66. - name: autoscaler
  67. image: "{{ dnsautoscaler_image_repo }}:{{ dnsautoscaler_image_tag }}"
  68. resources:
  69. requests:
  70. cpu: {{ dns_autoscaler_cpu_requests }}
  71. memory: {{ dns_autoscaler_memory_requests }}
  72. readinessProbe:
  73. httpGet:
  74. path: /healthz
  75. port: 8080
  76. scheme: HTTP
  77. command:
  78. - /cluster-proportional-autoscaler
  79. - --namespace=kube-system
  80. - --default-params={"linear":{"preventSinglePointFailure":{{ dns_prevent_single_point_failure }},"coresPerReplica":{{ dns_cores_per_replica }},"nodesPerReplica":{{ dns_nodes_per_replica }},"min":{{ dns_min_replicas }}}}
  81. - --logtostderr=true
  82. - --v=2
  83. - --configmap=dns-autoscaler{{ coredns_ordinal_suffix }}
  84. - --target=Deployment/coredns{{ coredns_ordinal_suffix }}
  85. serviceAccountName: dns-autoscaler