-
Notifications
You must be signed in to change notification settings - Fork 4
/
k8-prod-deployment.yaml
85 lines (85 loc) · 1.53 KB
/
k8-prod-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
78
79
80
81
82
83
84
85
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pm2-server
namespace: default
labels:
app: pm2-server
spec:
selector:
matchLabels:
app: pm2-server
replicas: 1
template:
metadata:
labels:
app: pm2-server
spec:
containers:
- name: pm2-server
image: <IMAGE>
- name: nginx
image: nginx:alpine
ports:
- containerPort: 80
volumeMounts:
- name: nginx-proxy-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
volumes:
- name: nginx-proxy-config
configMap:
name: pm2-nginx-config-map
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: pm2-server-hpa
namespace: default
labels:
app: pm2-server
spec:
scaleTargetRef:
kind: Deployment
name: pm2-server
apiVersion: apps/v1
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80
---
kind: Service
apiVersion: v1
metadata:
name: pm2-server-service
spec:
ports:
- name: http
port: 80
targetPort: 80
selector:
app: pm2-server
type: NodePort
---
apiVersion: v1
kind: Secret
metadata:
name: certificate-secret
namespace: default
data:
tls.crt: xxx
tls.key: xxx
type: Opaque
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: pm2-server-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: pm2-socket-lb-ip
spec:
tls:
- secretName: certificate-secret
backend:
serviceName: pm2-server-service
servicePort: 80