-
Notifications
You must be signed in to change notification settings - Fork 3
/
dane-server-k8s.yaml
171 lines (171 loc) · 3.57 KB
/
dane-server-k8s.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
---
apiVersion: v1 # -------------- HOOK UP EXTERNAL ELASTICSEARCH ------------------------------------
kind: Service
metadata:
name: elasticsearch
spec:
type: ClusterIP
ports:
- port: 9200
targetPort: 9200
---
apiVersion: v1
kind: Endpoints
metadata:
name: elasticsearch
subsets:
- addresses:
- ip: 'localhost' # your (external) ES host
ports:
- port: 9200
---
apiVersion: apps/v1 # -------------- RUN RABBITMQ ------------------------------
kind: Deployment
metadata:
name: rabbitmq-deployment
labels:
app: dane-rabbitmq
spec:
replicas: 1
selector:
matchLabels:
app: dane-rabbitmq
template:
metadata:
labels:
app: dane-rabbitmq
spec:
containers:
- name: dane-rabbitmq-server
image: rabbitmq:3-management
ports:
- containerPort: 15672
- containerPort: 5672
---
apiVersion: v1
kind: Service
metadata:
name: dane-rabbitmq-management
spec:
selector:
app: dane-rabbitmq
ports:
- protocol: TCP
port: 80
targetPort: 15672
---
apiVersion: v1
kind: Service
metadata:
name: dane-rabbitmq-api
spec:
selector:
app: dane-rabbitmq
ports:
- protocol: TCP
port: 5672
targetPort: 5672
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dane-rabbitmq-ingress
spec:
rules:
- host: rabbitmq.dane.nl # Note: change this to whatever domain you'd like to access the RabbitMQ
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: dane-rabbitmq-management
port:
number: 80
---
apiVersion: apps/v1 # -------------- RUN DANE SERVER (TASK SCHEDULER ONLY) ------------
kind: Deployment
metadata:
name: dane-server-ts-deployment
labels:
app: dane-server-ts
spec:
replicas: 1 # only one scheduler can run at a time, otherwise the queue will be disrupted!
selector:
matchLabels:
app: dane-server-ts
template:
metadata:
labels:
app: dane-server-ts
spec:
containers:
- name: dane-server
image: dane-server:latest
imagePullPolicy: Never
volumeMounts:
- name: dane-server-mnt
mountPath: "/root/.DANE"
readOnly: true
volumes:
- name: dane-server-mnt
configMap:
name: dane-server-cfg
---
apiVersion: apps/v1 # -------------- RUN DANE SERVER API -------------------------------
kind: Deployment
metadata:
name: dane-server-api-deployment
labels:
app: dane-server-api
spec:
replicas: 2
selector:
matchLabels:
app: dane-server-api
template:
metadata:
labels:
app: dane-server-api
spec:
containers:
- name: dane-server-api
image: dane-server-api:latest
imagePullPolicy: Never
volumeMounts:
- name: dane-server-mnt
mountPath: "/root/.DANE"
readOnly: true
volumes:
- name: dane-server-mnt
configMap:
name: dane-server-cfg #Note: same config as task scheduler
---
apiVersion: v1
kind: Service
metadata:
name: dane-server-api-service
spec:
selector:
app: dane-server-api
ports:
- protocol: TCP
port: 80
targetPort: 5500
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dane-server-ingress
spec:
rules:
- host: api.dane.nl # Note: change this to whatever domain you'd like to access the DANE server
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: dane-server-api-service
port:
number: 80