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. spec:
  33. nodeSelector:
  34. {{ dns_autoscaler_deployment_nodeselector }}
  35. priorityClassName: system-cluster-critical
  36. securityContext:
  37. seccompProfile:
  38. type: RuntimeDefault
  39. supplementalGroups: [ 65534 ]
  40. fsGroup: 65534
  41. nodeSelector:
  42. kubernetes.io/os: linux
  43. tolerations:
  44. - effect: NoSchedule
  45. key: node-role.kubernetes.io/control-plane
  46. {% if dns_autoscaler_extra_tolerations is defined %}
  47. {{ dns_autoscaler_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
  48. {% endif %}
  49. affinity:
  50. podAntiAffinity:
  51. requiredDuringSchedulingIgnoredDuringExecution:
  52. - topologyKey: "kubernetes.io/hostname"
  53. labelSelector:
  54. matchLabels:
  55. k8s-app: dns-autoscaler{{ coredns_ordinal_suffix }}
  56. nodeAffinity:
  57. preferredDuringSchedulingIgnoredDuringExecution:
  58. - weight: 100
  59. preference:
  60. matchExpressions:
  61. - key: node-role.kubernetes.io/control-plane
  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