blob: 09033d4dc9f0e6dee2c03bbaf29248cf4f45aa83 [file] [log] [blame]
David K. Bainbridge12463052018-01-19 09:26:09 -08001# Copyright 2017 the original author or authors.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15#
16# SWARM_MANAGER_COUNT - The number of managers in the swarm cluster. This is
17# used to limit the number of instances of some of the
18# service instances for smaller clusters.
19# [ NOTE - currently this parameter is handled via a Jinga2
20# templating capability, because as of 17.09.0-ce Docker
21# cannot use and environment variable for the `replicas`
22# attribute on a container. ]
23# REGISTRY - The docker registry from which images should be pulled.
24# If specified if should end in a `/`. Defaults to empty.
25# TAG - The tag that should be used when referencing VOLTHA docker
26# images, defaults to `latest`.
27# CONSUL_ROOT - The local path on which the consul/data and consul/config
28# directories should be created. Defaults to `/var/local`.
29# VOLTHA_LOGS - The location into which `fluentd` should writes logs.
30# Defaults to `/var/log`.
31# RADIUS_ROOT - The location in which the `data/clients.conf` and
32# `data/users` configuration files can be found. Defaults
33# to `/var/local`.
34# DOCKER_HOST_IP -
35# ZK_TAG - The tag that should be used when referencing the ZooKeeper
36# docker image. Defaults to `3.4.11`.
37# KAFKA_TAG - The tag that should be used when referencing the Kafka
38# docker image. Default to `1.0.0`.
39# CONSUL_TAG - The tag that should be used when referencing the Consul
40# docker image. Defaults to `0.9.2`.
41# RADIUS_TAG - The tag that should be used when referencing the FreeRADIUS
42# docker image. Defaults to `latest`.
43version: "3"
44
45services:
46 zk1:
47 image: "${REGISTRY}zookeeper:${ZK_TAG:-3.4.11}"
48 logging:
49 driver: "json-file"
50 options:
51 max-size: "10m"
52 max-file: 3
53 networks:
54 - kafka-net
55 environment:
56 ZOO_MY_ID: 1
57 ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zk2:2888:3888 server.3=zk3:2888:3888
58
59 zk2:
60 image: "${REGISTRY}zookeeper:${ZK_TAG:-3.4.11}"
61 logging:
62 driver: "json-file"
63 options:
64 max-size: "10m"
65 max-file: 3
66 networks:
67 - kafka-net
68 environment:
69 ZOO_MY_ID: 2
70 ZOO_SERVERS: server.1=zk1:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zk3:2888:3888
71
72 zk3:
73 image: "${REGISTRY}zookeeper:${ZK_TAG:-3.4.11}"
74 logging:
75 driver: "json-file"
76 options:
77 max-size: "10m"
78 max-file: 3
79 networks:
80 - kafka-net
81 environment:
82 ZOO_MY_ID: 3
83 ZOO_SERVERS: server.1=zk1:2888:3888 server.2=zk2:2888:3888 server.3=0.0.0.0:2888:3888
84
85 kafka:
86 deploy:
87 mode: global
88 image: "${REGISTRY}wurstmeister/kafka:${KAFKA_TAG:-1.0.0}"
89 logging:
90 driver: "json-file"
91 options:
92 max-size: "10m"
93 max-file: 3
94 environment:
95 KAFKA_ADVERTISED_PORT: 9092
96 KAFKA_ZOOKEEPER_CONNECT: zk1:2181,zk2:2181,zk3:2181
97 KAFKA_HEAP_OPTS: -Xmx256M -Xms128M
98 volumes:
99 - /var/run/docker.sock:/var/run/docker.sock
100 networks:
101 - kafka-net
102 - voltha-net
103 ports:
104 - 9092:9092
105
106 consul:
107 image: ${REGISTRY}consul:${CONSUL_TAG:-0.9.2}
108 logging:
109 driver: "json-file"
110 options:
111 max-size: "10m"
112 max-file: 3
113
114 # Deploy to all docker manager nodes
115 deploy:
116 mode: global
117 placement:
118 constraints:
119 - node.role == manager
120 restart_policy:
121 condition: on-failure
122 entrypoint:
123 - consul
124 - agent
125 - -server
126 - -bootstrap-expect={{ SWARM_MANAGER_COUNT | default(1) }}
127 - -config-dir=/consul/config
128 - -data-dir=/consul/data # mandatory property
129 - -client=0.0.0.0
130 - -advertise={{ '{{' }} GetAllInterfaces | include "network" "172.29.20.0/29" | sort "size,address" | attr "address" {{ '}}' }}
131 - -ui
132 - -raft-protocol=3
133 - -rejoin
134 - -retry-join=172.29.20.2
135 - -retry-join=172.29.20.3
136 - -retry-join=172.29.20.4
137 - -retry-join=172.29.20.5
138 - -retry-join=172.29.20.6
139 - -retry-join=172.29.20.7
140 networks:
141 - consul-net
142 - voltha-net
143 ports:
144 - "8300:8300"
145 - "8400:8400"
146 - "8500:8500"
147 - "8600:8600/udp"
148{%- if CONSUL_ROOT is defined and CONSUL_ROOT %}
149 volumes:
150 - {{ CONSUL_ROOT }}/data:/consul/data
151 - {{ CONSUL_ROOT }}/config:/consul/config
152{%- endif %}
153
154 fluentdactv:
155 image: "${REGISTRY}voltha/fluentd:${TAG:-latest}"
156 logging:
157 driver: "json-file"
158 options:
159 max-size: "10m"
160 max-file: 3
161 deploy:
162 replicas: 1
163 restart_policy:
164 condition: on-failure
165 environment:
166 FLUENTD_CONF: fluent-agg.conf
167 networks:
168 - voltha-net
169 ports:
170 - "24224"
171{%- if VOLTHA_LOGS is defined and VOLTHA_LOGS %}
172 volumes:
173 - "{{ VOLTHA_LOGS }}:/fluentd/log"
174{%- endif %}
175
176 fluentdstby:
177 image: "${REGISTRY}voltha/fluentd:${TAG:-latest}"
178 logging:
179 driver: "json-file"
180 options:
181 max-size: "10m"
182 max-file: 3
183 deploy:
184 replicas: 1
185 restart_policy:
186 condition: on-failure
187 environment:
188 FLUENTD_CONF: fluent-agg.conf
189 networks:
190 - voltha-net
191 ports:
192 - "24224"
193{%- if VOLTHA_LOGS is defined and VOLTHA_LOGS %}
194 volumes:
195 - "{{ VOLTHA_LOGS }}:/fluentd/log"
196{%- endif %}
197
198 # The Fluentd container is part of the data collection
199 # infrastructure.
200 fluentd:
201 image: "${REGISTRY}voltha/fluentd:${TAG:-latest}"
202 logging:
203 driver: "json-file"
204 options:
205 max-size: "10m"
206 max-file: 3
207 deploy:
208 mode: replicated
209 replicas: {{ SWARM_MANAGER_COUNT | default(1) }}
210 restart_policy:
211 condition: any
212 environment:
213 SERVICE_24224_NAME: "fluentd-intake"
214 FLUENTD_CONF: fluent.conf
215 WAIT_FOR: "fluentdactv:24224 fluentdstby:24224"
216 WAIT_FOR_TIMEOUT: 0
217 networks:
218 - voltha-net
219 ports:
220 - "24224"
221
222 # Free RADIUS can be used to test VOLTHA's authentication
223 # sequence, i.e., EAPOL from a device behind an OLT to
224 # RADIUS authentication on the back end systems. By default
225 # no instances of Free RADIUS are deployed.
226 freeradius:
227 deploy:
228 replicas: 0
229 image: "${REGISTRY}marcelmaatkamp/freeradius:${RADIUS_TAG:-latest}"
230 logging:
231 driver: "json-file"
232 options:
233 max-size: "10m"
234 max-file: 3
235 ports:
236 - "1812:1812/udp"
237 - "1813:1813"
238 - "18120:18120"
239
240{%- if RADIUS_ROOT is defined and RADIUS_ROOT %}
241 # CONFIG: When deploying a Free RADIUS instance client and user
242 # information will need to be configured for the service to
243 # operate correctly.
244 #
245 volumes:
246 - {{ RADIUS_ROOT }}/data/clients.conf:/etc/raddb/clients.conf
247 - {{ RADIUS_ROOT }}/data/users:/etc/raddb/users
248{%- endif %}
249 networks:
250 - voltha-net
251
252 # The cluster manager container calculates and servers ONOS cluster
253 # meta data via HTTP so that ONOS instances can form an HA cluster.
254 # The cluster manager must run on a manager node so that it can
255 # retrieve service information from manager nodes
256 onos_cluster_manager:
257 image: "${REGISTRY}voltha/unum:${TAG:-latest}"
258 deploy:
259 replicas: 1
260 placement:
261 constraints:
262 - node.role == manager
263 environment:
264 PERIOD: "10s"
265 LOG_LEVEL: "debug"
266 ORCHESTRATION: "swarm://"
267 LABELS: "org.voltha.onos.cluster:true"
268 NETWORK: "org.voltha.onos.cluster:true"
269 ports:
270 - 5411:5411
271 networks:
272 - voltha-net
273 volumes:
274 - /var/run/docker.sock:/var/run/docker.sock
275
276 # ONOS is the SDN controller for the solution and handles AAA,
277 # IGMP proxy, and L2 DHCP requests as well as manages flows
278 # down to the virtual devices (MCAST + OLT flows).
279 # Currently there is a single instance of ONOS as some of the
280 # applications running under ONOS do not support HA.
281 onos:
282 deploy:
283 replicas: 1
284 labels:
285 org.voltha.onos.cluster: "true"
286 image: "${REGISTRY}voltha/onos:${TAG:-latest}"
287 logging:
288 driver: "json-file"
289 options:
290 max-size: "10m"
291 max-file: 3
292 ports:
293 - 8101:8101 # ssh
294 - 6653:6653 # OF
295 - 8181:8181 # UI
296 environment:
297 EXTRA_JAVA_OPTS: "-Donos.cluster.metadata.uri=http://onos_cluster_manager:5411/config/"
298 networks:
299 - voltha-net
300
301 # The VCORE container is the core capabilities of VOLTHA including
302 # interacting with device adapters
303 vcore:
304 image: "${REGISTRY}voltha/voltha:${TAG:-latest}"
305 logging:
306 driver: "json-file"
307 options:
308 max-size: "10m"
309 max-file: 3
310 deploy:
311 replicas: {{ SWARM_MANAGER_COUNT | default(1) }}
312 entrypoint:
313 - voltha/voltha/main.py
314 - -v
315 - --consul=consul:8500
316 - --fluentd=fluentd:24224
317 - --kafka=kafka
318 - --rest-port=8880
319 - --grpc-port=50556
320 - --instance-id-is-container-name
321 - --backend=consul
322 - --inter-core-subnet=172.29.19.0/24
323 - --pon-subnet=172.29.19.0/24
324 networks:
325 - voltha-net
326 ports:
327 - "8880:8880"
328 - "18880:18880"
329 - "50556:50556"
330 volumes:
331 - /var/run/docker.sock:/tmp/docker.sock
332
333 # The OpenFlow Agent support the OpenFlow protocol communication
334 # between ONOS and VOLTHA.
335 ofagent:
336 image: "${REGISTRY}voltha/ofagent:${TAG:-latest}"
337 logging:
338 driver: "json-file"
339 options:
340 max-size: "10m"
341 max-file: 3
342 deploy:
343 replicas: 1
344 entrypoint:
345 - /ofagent/ofagent/main.py
346 - -v
347 - --consul=consul:8500
348 - --fluentd=fluentd:24224
349 - --controller=onos:6653
350 - --grpc-endpoint=vcore:50556
351 - --instance-id-is-container-name
352 volumes:
353 - /var/run/docker.sock:/tmp/docker.sock
354 networks:
355 - voltha-net
356
357 # The VOLTHA container supports load balancing of request to
358 # the VOLTHA components as well as surfaces a REST API and maps
359 # the requests to GPRC
360 voltha:
361 image: "${REGISTRY}voltha/envoy:${TAG:-latest}"
362 logging:
363 driver: "json-file"
364 options:
365 max-size: "10m"
366 max-file: 3
367 deploy:
368 replicas: 1
369 #environment:
370 # DOCKER_HOST_IP: "${DOCKER_HOST_IP}"
371 entrypoint:
372 - /usr/local/bin/envoyd
373 - -envoy-cfg-template
374 - "/envoy/voltha-grpc-proxy.template.json"
375 - -envoy-config
376 - "/envoy/voltha-grpc-proxy.json"
377 networks:
378 - voltha-net
379 ports:
380 - "50555:50555"
381 - "8882:8882"
382 - "8443:8443"
383 - "8001:8001"
384 volumes:
385 - /var/run/docker.sock:/tmp/docker.sock
386
387 # The CLI container provides an CLI to the VOLTHA capabilitiy
388 # that can be accessed via SSH.
389 cli:
390 image: "${REGISTRY}voltha/cli:${TAG:-latest}"
391 logging:
392 driver: "json-file"
393 options:
394 max-size: "10m"
395 max-file: 3
396 deploy:
397 replicas: {{ SWARM_MANAGER_COUNT | default(1) }}
398 #environment:
399 # DOCKER_HOST_IP: "${DOCKER_HOST_IP}"
400 entrypoint:
401 - /cli/cli/setup.sh
402 - -C consul:8500
403 - -g voltha:50555
404 - -s voltha:18880
405 - -G
406 networks:
407 - voltha-net
408 ports:
409 - "5022:22"
410
411 # The Netconf container provides an NETCONF API to be used
412 # with VOLTHA and maps that to GRPC requests
413 netconf:
414 image: "${REGISTRY}voltha/netconf:${TAG:-latest}"
415 logging:
416 driver: "json-file"
417 options:
418 max-size: "10m"
419 max-file: 3
420 deploy:
421 mode: global
422 environment:
423 SERVICE_1830_NAME: "netconf-server"
424 entrypoint:
425 - /netconf/netconf/main.py
426 - -v
427 - --consul=consul:8500
428 - --fluentd=fluentd:24224
429 - --grpc-endpoint=voltha:50555
430 - --instance-id-is-container-name
431 networks:
432 - voltha-net
433 ports:
434 - "830:1830"
435 volumes:
436 - /var/run/docker.sock:/tmp/docker.sock
437
438 # The tools container provides a bash command shell to which
439 # an operator can SSH that has the same network connectivity
440 # as other VOLTHA containers and is thus a convenient
441 # troubleshooting tool
442 tools:
443 image: "${REGISTRY}voltha/tools:${TAG:-latest}"
444 logging:
445 driver: "json-file"
446 options:
447 max-size: "10m"
448 max-file: 3
449 deploy:
450 mode: replicated
451 replicas: 1
452 restart_policy:
453 condition: on-failure
454 ports:
455 - "4022:22"
456 networks:
457 - voltha-net
458 - kafka-net
459
460networks:
461 consul-net:
462 driver: overlay
463 driver_opts:
464 encrypted: "true"
465 ipam:
466 driver: default
467 config:
468 - subnet: 172.29.20.0/29
469
470 voltha-net:
471 driver: overlay
472 driver_opts:
473 encrypted: "true"
474 ipam:
475 driver: default
476 config:
477 - subnet: 172.29.19.0/24
478 labels:
479 org.voltha.onos.cluster: "true"
480
481 kafka-net:
482 driver: overlay
483 driver_opts:
484 encrypted: "true"