dns-horizontal-autoscaler.yaml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. # Copyright 2016 The Kubernetes Authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. kind: ServiceAccount
  15. apiVersion: v1
  16. metadata:
  17. name: kube-dns-autoscaler
  18. namespace: kube-system
  19. labels:
  20. addonmanager.kubernetes.io/mode: Reconcile
  21. ---
  22. kind: ClusterRole
  23. apiVersion: rbac.authorization.k8s.io/v1
  24. metadata:
  25. name: system:kube-dns-autoscaler
  26. labels:
  27. addonmanager.kubernetes.io/mode: Reconcile
  28. rules:
  29. - apiGroups: [""]
  30. resources: ["nodes"]
  31. verbs: ["list", "watch"]
  32. - apiGroups: [""]
  33. resources: ["replicationcontrollers/scale"]
  34. verbs: ["get", "update"]
  35. - apiGroups: ["extensions","apps"]
  36. resources: ["deployments/scale", "replicasets/scale"]
  37. verbs: ["get", "update"]
  38. # Remove the configmaps rule once below issue is fixed:
  39. # kubernetes-incubator/cluster-proportional-autoscaler#16
  40. - apiGroups: [""]
  41. resources: ["configmaps"]
  42. verbs: ["get", "create"]
  43. ---
  44. kind: ClusterRoleBinding
  45. apiVersion: rbac.authorization.k8s.io/v1
  46. metadata:
  47. name: system:kube-dns-autoscaler
  48. labels:
  49. addonmanager.kubernetes.io/mode: Reconcile
  50. subjects:
  51. - kind: ServiceAccount
  52. name: kube-dns-autoscaler
  53. namespace: kube-system
  54. roleRef:
  55. kind: ClusterRole
  56. name: system:kube-dns-autoscaler
  57. apiGroup: rbac.authorization.k8s.io
  58. ---
  59. apiVersion: apps/v1
  60. kind: Deployment
  61. metadata:
  62. name: kube-dns-autoscaler
  63. namespace: kube-system
  64. labels:
  65. k8s-app: kube-dns-autoscaler
  66. kubernetes.io/cluster-service: "true"
  67. addonmanager.kubernetes.io/mode: Reconcile
  68. spec:
  69. selector:
  70. matchLabels:
  71. k8s-app: kube-dns-autoscaler
  72. template:
  73. metadata:
  74. labels:
  75. k8s-app: kube-dns-autoscaler
  76. annotations:
  77. scheduler.alpha.kubernetes.io/critical-pod: ''
  78. seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
  79. spec:
  80. priorityClassName: system-cluster-critical
  81. securityContext:
  82. supplementalGroups: [ 65534 ]
  83. fsGroup: 65534
  84. containers:
  85. - name: autoscaler
  86. image: k8s.gcr.io/cluster-proportional-autoscaler-amd64:1.6.0
  87. resources:
  88. requests:
  89. cpu: "20m"
  90. memory: "10Mi"
  91. command:
  92. - /cluster-proportional-autoscaler
  93. - --namespace=kube-system
  94. - --configmap=kube-dns-autoscaler
  95. # Should keep target in sync with cluster/addons/dns/kube-dns.yaml.base
  96. - --target={{.Target}}
  97. # When cluster is using large nodes(with more cores), "coresPerReplica" should dominate.
  98. # If using small nodes, "nodesPerReplica" should dominate.
  99. - --default-params={"linear":{"coresPerReplica":256,"nodesPerReplica":16,"preventSinglePointFailure":true}}
  100. - --logtostderr=true
  101. - --v=2
  102. tolerations:
  103. - key: "CriticalAddonsOnly"
  104. operator: "Exists"
  105. serviceAccountName: kube-dns-autoscaler