forked from onfido/k8s-rabbit-pod-autoscaler
-
Notifications
You must be signed in to change notification settings - Fork 4
/
deploy.yml
78 lines (78 loc) · 2.01 KB
/
deploy.yml
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
78
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: rabbit-pod-autoscaler
rules:
- apiGroups: ["*"]
resources: ["deployments", "deployments/scale"]
verbs: ["get", "list", "update"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: rabbit-pod-autoscaler
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: rabbit-pod-autoscaler
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: rabbit-pod-autoscaler
subjects:
- kind: ServiceAccount
name: rabbit-pod-autoscaler
namespace: kube-system
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: rabbit-pod-autoscaler
namespace: kube-system
spec:
replicas: 1
template:
metadata:
labels:
app: rabbit-pod-autoscaler
spec:
nodeSelector:
kubernetes.io/role: master
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
serviceAccountName: rabbit-pod-autoscaler
containers:
- name: rabbit-pod-autoscaler
image: onfido/k8s-rabbit-pod-autoscaler
imagePullPolicy: Always
resources:
requests:
cpu: 100m
memory: 50Mi
env:
- name: INTERVAL
value: "30"
- name: RABBIT_HOST
value: "http://rabbitmq.example.com"
- name: RABBIT_USER
valueFrom:
secretKeyRef:
name: rabbit-pod-autoscaler
key: rabbit-user
- name: RABBIT_PASS
valueFrom:
secretKeyRef:
name: rabbit-pod-autoscaler
key: rabbit-pass
- name: AUTOSCALING
value: >
3|10|5|development|example|example.queue;
3|5|3|development|example2|example2.queue
- name: LOGS
value: HIGH
- name: SLACK_HOOK
value: SLACK_HOOK