Skip to content

Commit 69b402c

Browse files
kinzhitengqm
andauthored
[zh]Update content/zh/examples/admin/dns/dns-horizontal-autoscaler.yaml (#33234)
* [zh]Update content/zh/examples/admin/dns/dns-horizontal-autoscaler.yaml * [zh]Update content/zh/examples/admin/dns/dns-horizontal-autoscaler.yaml * Update content/zh/examples/admin/dns/dns-horizontal-autoscaler.yaml Co-authored-by: Qiming Teng <[email protected]> Co-authored-by: Qiming Teng <[email protected]>
1 parent d97df38 commit 69b402c

File tree

1 file changed

+71
-17
lines changed

1 file changed

+71
-17
lines changed
Lines changed: 71 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,87 @@
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+
---
141
apiVersion: apps/v1
242
kind: Deployment
343
metadata:
4-
name: dns-autoscaler
44+
name: kube-dns-autoscaler
545
namespace: kube-system
646
labels:
7-
k8s-app: dns-autoscaler
47+
k8s-app: kube-dns-autoscaler
48+
kubernetes.io/cluster-service: "true"
849
spec:
950
selector:
1051
matchLabels:
11-
k8s-app: dns-autoscaler
52+
k8s-app: kube-dns-autoscaler
1253
template:
1354
metadata:
1455
labels:
15-
k8s-app: dns-autoscaler
56+
k8s-app: kube-dns-autoscaler
1657
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
1766
containers:
1867
- 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
2069
resources:
21-
requests:
22-
cpu: 20m
23-
memory: 10Mi
70+
requests:
71+
cpu: "20m"
72+
memory: "10Mi"
2473
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

Comments
 (0)