-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeedback-sentiment-app-single-pod.yaml
132 lines (131 loc) · 3.14 KB
/
feedback-sentiment-app-single-pod.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongodb-data-pvc
spec:
# volumeName: mongodb-data-pv
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Gi
selector:
matchLabels:
app: mongo
---
apiVersion: v1
kind: ConfigMap
metadata:
name: feedback-service-env
namespace: default
data:
PORT: "3000"
DB_URI: "mongodb://localhost:27017/feedback"
SENTIMENT_URI: "http://localhost:5000/api/get_sentiment"
FEEDBACK_SERVICE_URI: "http://localhost:3000/api/feedback"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: feedback-sentiment-deployment
labels:
app: feedback
spec:
replicas: 1
selector:
matchLabels:
app: feedback
template:
metadata:
labels:
app: feedback
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/os
operator: In
values:
- linux
containers:
- name: feedback-service
image: feedback-service:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
env:
- name: PORT
valueFrom:
configMapKeyRef:
name: feedback-service-env
key: PORT
- name: DB_URI
valueFrom:
configMapKeyRef:
name: feedback-service-env
key: DB_URI
- name: SENTIMENT_URI
valueFrom:
configMapKeyRef:
name: feedback-service-env
key: SENTIMENT_URI
- name: sentiment-service
image: sentiment-service:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5000
- name: sentiment-dashboard
image: sentiment-dashboard:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8501
env:
- name: DB_URI
valueFrom:
configMapKeyRef:
name: feedback-service-env
key: DB_URI
- name: mongodb
image: mongo:latest
ports:
- containerPort: 27017
volumeMounts:
- mountPath: /data/db
name: mongo-data
- name: nginx
image: feedback-frontend:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
volumes:
- name: mongo-data
persistentVolumeClaim:
claimName: mongodb-data-pvc
---
apiVersion: v1
kind: Service
metadata:
name: feedback-sentiment-dashboard
spec:
selector:
app: feedback
type: LoadBalancer
ports:
- name: feedback
protocol: TCP
port: 3000
targetPort: 3000
- name: sentiment
protocol: TCP
port: 5000
targetPort: 5000
- name: daskboard
protocol: TCP
port: 8501
targetPort: 8501
- name: frontend
protocol: TCP
port: 8080
targetPort: 80