-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdeployment.yml
More file actions
73 lines (73 loc) · 1.76 KB
/
deployment.yml
File metadata and controls
73 lines (73 loc) · 1.76 KB
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: <% .Name %>
spec:
revisionHistoryLimit: 5
selector:
matchLabels:
app: <% .Name %>
template:
spec:
serviceAccountName: backend-service
automountServiceAccountToken: true
containers:
- name: <% .Name %>
image: fake-image
resources:
requests:
memory: 64Mi
cpu: 0.1
limits:
memory: 256Mi
cpu: 0.5
livenessProbe:
exec:
command:
- rm
- /tmp/service-alive
initialDelaySeconds: 5
periodSeconds: 5
readinessProbe:
httpGet:
port: http
path: /status/ready
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 2
ports:
- containerPort: 80
name: http
envFrom:
- configMapRef:
name: <% .Name %>-config
env:
- name: SERVER_PORT
value: "80"
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: <% .Name %>
key: DATABASE_USERNAME
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: <% .Name %>
key: DATABASE_PASSWORD
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: <% .Name %>
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: <% .Name %>
maxReplicas: 2
minReplicas: 1
targetCPUUtilizationPercentage: 60