-
Notifications
You must be signed in to change notification settings - Fork 5
/
api-deployment.yaml
79 lines (75 loc) · 1.47 KB
/
api-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
apiVersion: apps/v1
kind: Deployment
metadata:
name: api
labels:
name: api
spec:
selector:
matchLabels:
name: api
replicas: 3
template:
metadata:
labels:
app: api
name: api
spec:
containers:
- name: api
image: myimage:v1
imagePullPolicy: Always
ports:
- name: api
containerPort: 3000
env:
- name: LOGGER
value: "true"
- name: LOGLEVEL
value: info
- name: PORT
value: "3000"
- name: SERVICES
value: services/api.service.js
- name: TRANSPORTER
value: nats://nats:4222
- name: REDIS_URI
value: redis://redis:6379
restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
name: api-service
labels:
name: api-service
spec:
type: NodePort
sessionAffinity: ClientIP
ports:
- port: 80
name: http
targetPort: 3000
protocol: TCP
- port: 443
name: https
targetPort: 3000
protocol: TCP
selector:
app: api
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: api-ingress
annotations:
kubernetes.io/ingress.global-static-ip-name: "nlp-ip"
kubernetes.io/ingress.class: "gce"
spec:
rules:
- http:
paths:
- path: /*
backend:
serviceName: api-service
servicePort: 80