forked from kubernetes/autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster-autoscaler-deployment.yaml
77 lines (77 loc) · 2.5 KB
/
cluster-autoscaler-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
kind: Deployment
apiVersion: apps/v1
metadata:
name: cluster-autoscaler
namespace: kube-system
labels:
app: cluster-autoscaler
spec:
replicas: 1
selector:
matchLabels:
app: cluster-autoscaler
template:
metadata:
namespace: kube-system
labels:
app: cluster-autoscaler
spec:
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/control-plane
# Node affinity is used to force cluster-autoscaler to stick
# to the macontrol-plane node. This allows the cluster to reliably downscale
# to zero worker nodes when needed.
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
serviceAccountName: cluster-autoscaler
containers:
- name: cluster-autoscaler
image: registry.k8s.io/autoscaling/cluster-autoscaler:latest
imagePullPolicy: Always
env:
- name: BOOTSTRAP_TOKEN_ID
valueFrom:
secretKeyRef:
name: bootstrap-token-cluster-autoscaler-cherry
key: token-id
- name: BOOTSTRAP_TOKEN_SECRET
valueFrom:
secretKeyRef:
name: bootstrap-token-cluster-autoscaler-cherry
key: token-secret
- name: CHERRY_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: cluster-autoscaler-cherry
key: authtoken
# You can take advantage of multiple nodepools by adding
# extra arguments on the cluster-autoscaler command.
# e.g. for pool1, pool2
# --nodes=0:10:pool1
# --nodes=0:10:pool2
command:
- ./cluster-autoscaler
- --alsologtostderr
- --cluster-name=cluster1
- --cloud-config=/config/cloud-config
- --cloud-provider=cherryservers
- --nodes=0:10:pool1
- --nodes=0:10:pool2
- --scale-down-unneeded-time=1m0s
- --scale-down-delay-after-add=1m0s
- --scale-down-unready-time=1m0s
- --v=2
volumeMounts:
- name: cloud-config
mountPath: /config
readOnly: true
volumes:
- name: cloud-config
secret:
secretName: cluster-autoscaler-cloud-config