|
| 1 | +kind: ServiceAccount |
| 2 | +apiVersion: v1 |
| 3 | +metadata: |
| 4 | + name: kube-dns-autoscaler |
| 5 | + namespace: kube-system |
| 6 | +--- |
| 7 | +kind: ClusterRole |
| 8 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 9 | +metadata: |
| 10 | + name: system:kube-dns-autoscaler |
| 11 | +rules: |
| 12 | + - apiGroups: [""] |
| 13 | + resources: ["nodes"] |
| 14 | + verbs: ["list", "watch"] |
| 15 | + - apiGroups: [""] |
| 16 | + resources: ["replicationcontrollers/scale"] |
| 17 | + verbs: ["get", "update"] |
| 18 | + - apiGroups: ["apps"] |
| 19 | + resources: ["deployments/scale", "replicasets/scale"] |
| 20 | + verbs: ["get", "update"] |
| 21 | +# 待以下 issue 修复后,请删除 Configmaps |
| 22 | +# kubernetes-incubator/cluster-proportional-autoscaler#16 |
| 23 | + - apiGroups: [""] |
| 24 | + resources: ["configmaps"] |
| 25 | + verbs: ["get", "create"] |
| 26 | +--- |
| 27 | +kind: ClusterRoleBinding |
| 28 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 29 | +metadata: |
| 30 | + name: system:kube-dns-autoscaler |
| 31 | +subjects: |
| 32 | + - kind: ServiceAccount |
| 33 | + name: kube-dns-autoscaler |
| 34 | + namespace: kube-system |
| 35 | +roleRef: |
| 36 | + kind: ClusterRole |
| 37 | + name: system:kube-dns-autoscaler |
| 38 | + apiGroup: rbac.authorization.k8s.io |
| 39 | + |
| 40 | +--- |
1 | 41 | apiVersion: apps/v1
|
2 | 42 | kind: Deployment
|
3 | 43 | metadata:
|
4 |
| - name: dns-autoscaler |
| 44 | + name: kube-dns-autoscaler |
5 | 45 | namespace: kube-system
|
6 | 46 | labels:
|
7 |
| - k8s-app: dns-autoscaler |
| 47 | + k8s-app: kube-dns-autoscaler |
| 48 | + kubernetes.io/cluster-service: "true" |
8 | 49 | spec:
|
9 | 50 | selector:
|
10 | 51 | matchLabels:
|
11 |
| - k8s-app: dns-autoscaler |
| 52 | + k8s-app: kube-dns-autoscaler |
12 | 53 | template:
|
13 | 54 | metadata:
|
14 | 55 | labels:
|
15 |
| - k8s-app: dns-autoscaler |
| 56 | + k8s-app: kube-dns-autoscaler |
16 | 57 | spec:
|
| 58 | + priorityClassName: system-cluster-critical |
| 59 | + securityContext: |
| 60 | + seccompProfile: |
| 61 | + type: RuntimeDefault |
| 62 | + supplementalGroups: [ 65534 ] |
| 63 | + fsGroup: 65534 |
| 64 | + nodeSelector: |
| 65 | + kubernetes.io/os: linux |
17 | 66 | containers:
|
18 | 67 | - name: autoscaler
|
19 |
| - image: k8s.gcr.io/cluster-proportional-autoscaler-amd64:1.6.0 |
| 68 | + image: k8s.gcr.io/cpa/cluster-proportional-autoscaler:1.8.4 |
20 | 69 | resources:
|
21 |
| - requests: |
22 |
| - cpu: 20m |
23 |
| - memory: 10Mi |
| 70 | + requests: |
| 71 | + cpu: "20m" |
| 72 | + memory: "10Mi" |
24 | 73 | command:
|
25 |
| - - /cluster-proportional-autoscaler |
26 |
| - - --namespace=kube-system |
27 |
| - - --configmap=dns-autoscaler |
28 |
| - - --target=<SCALE_TARGET> |
29 |
| - # When cluster is using large nodes(with more cores), "coresPerReplica" should dominate. |
30 |
| - # If using small nodes, "nodesPerReplica" should dominate. |
31 |
| - - --default-params={"linear":{"coresPerReplica":256,"nodesPerReplica":16,"min":1}} |
32 |
| - - --logtostderr=true |
33 |
| - - --v=2 |
| 74 | + - /cluster-proportional-autoscaler |
| 75 | + - --namespace=kube-system |
| 76 | + - --configmap=kube-dns-autoscaler |
| 77 | + # 应该保持目标与 cluster/addons/dns/kube-dns.yaml.base 同步 |
| 78 | + - --target=<SCALE_TARGET> |
| 79 | + #当集群使用大节点(有更多核)时,“coresPerReplica”应该占主导地位。 |
| 80 | + #如果使用小节点,“nodesPerReplica“ 应该占主导地位。 |
| 81 | + - --default-params={"linear":{"coresPerReplica":256,"nodesPerReplica":16,"preventSinglePointFailure":true,"includeUnschedulableNodes":true}} |
| 82 | + - --logtostderr=true |
| 83 | + - --v=2 |
| 84 | + tolerations: |
| 85 | + - key: "CriticalAddonsOnly" |
| 86 | + operator: "Exists" |
| 87 | + serviceAccountName: kube-dns-autoscaler |
0 commit comments