forked from flowerinthenight/oops
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
52 lines (50 loc) · 1.23 KB
/
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: oops
spec:
selector:
matchLabels:
app: oops
replicas: 1
revisionHistoryLimit: 3
template:
metadata:
labels:
app: oops
spec:
containers:
- name: oops
image: quay.io/flowerinthenight/oops:v0.2.5
imagePullPolicy: Always
args: ["run", "--dir=/oops/scenarios", "--project-id=xxx", "--pubsub=oops", "--report-slack=https://hooks.slack.com/xxx"]
env:
- name: GET_HOSTS_FROM
value: dns
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /etc/oops/svcacct.json
ports:
- containerPort: 8080
volumeMounts:
- name: gcpkeyfile
mountPath: "/etc/oops"
readOnly: true
# svcacct.json should have permissions for GCP Cloud PubSub
# $ kubectl create secret generic oops-keyfile --from-file svcacct.json
volumes:
- name: gcpkeyfile
secret:
secretName: oops-keyfile
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: oops-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: oops
minReplicas: 1
maxReplicas: 5
targetCPUUtilizationPercentage: 80