-
Notifications
You must be signed in to change notification settings - Fork 0
/
app-swimmpair.yaml
65 lines (65 loc) · 1.43 KB
/
app-swimmpair.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
apiVersion: v1
kind: Service
metadata:
name: swimmpair-service
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 80
selector:
app: swimmpair
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: swimmpair
spec:
replicas: 2
selector:
matchLabels:
app: swimmpair
template:
metadata:
labels:
app: swimmpair
spec:
containers:
- name: swimmpair
image: stepanklos/swimmpair:latest
securityContext:
allowPrivilegeEscalation: true
ports:
- containerPort: 80
env:
- name: MESSAGE
value: Hello from swimmpair Deployment!
- name: DATABASE_HOST
value: 'mysql-service'
- name: DATABASE_USER
value: 'root'
- name: DATABASE_PASS
value: 'password'
- name: DATABASE_NAME
value: 'database'
#- name: REDIS_HOST
# value: 'redis-service'
#- name: REDIS_PASS
# value: 'cGFzc3dvcmQ='
- name: PHP_INI_SESSION__SAVE_HANDLER
value: 'redis'
- name: PHP_INI_SESSION__SAVE_PATH
value: 'tcp://redis-service:6379?auth=cGFzc3dvcmQ='
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: swimmpair-autoscaler
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: swimmpair
minReplicas: 2
maxReplicas: 5
targetCPUUtilizationPercentage: 70