blob: f46724f9222a3f19802ad5d4e820ea242f6600e7 [file] [log] [blame]
David K. Bainbridgebba65ff2018-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
Jonathan Hart0584a1e2018-04-17 08:36:21 -070017# used to limit the number of instances of some of the
18# service instances for smaller clusters.
David K. Bainbridgebba65ff2018-01-19 09:26:09 -080019# [ 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. ]
David K. Bainbridge737b74f2018-01-22 12:57:52 -080023# REGISTRY - The docker registry host from which images should be
24# pulled, i.e. `private-reg.com:5000/`. If specified
25# it should end in a `/`. Defaults to empty.
26# REPOSITORY - The docker repository name from which voltha specific
27# images should be pulled, i.e. `voltha/`. If specified it
28# should end in a `/`. Defaults to empty.
29# TAG - The tag that should be used when referencing VOLTHA docker
30# images, defaults to `latest`.
31# CONSUL_ROOT - The local path on which the consul/data and consul/config
32# directories should be created. Defaults to `/var/local`.
33# VOLTHA_LOGS - The location into which `fluentd` should writes logs.
34# Defaults to `/var/log`.
Jonathan Hart0584a1e2018-04-17 08:36:21 -070035# RADIUS_ROOT - The location in which the `data/clients.conf` and
David K. Bainbridge737b74f2018-01-22 12:57:52 -080036# `data/users` configuration files can be found. Defaults
37# to `/var/local`.
David K. Bainbridgebba65ff2018-01-19 09:26:09 -080038# DOCKER_HOST_IP -
David K. Bainbridge737b74f2018-01-22 12:57:52 -080039# ZK_TAG - The tag that should be used when referencing the ZooKeeper
40# docker image. Defaults to `latest`.
41# KAFKA_TAG - The tag that should be used when referencing the Kafka
42# docker image. Default to `1.0.0`.
43# CONSUL_TAG - The tag that should be used when referencing the Consul
44# docker image. Defaults to `0.9.2`.
45# RADIUS_TAG - The tag that should be used when referencing the FreeRADIUS
46# docker image. Defaults to `latest`.
David K. Bainbridgebba65ff2018-01-19 09:26:09 -080047version: "3"
48
49services:
50 zk1:
David K. Bainbridge737b74f2018-01-22 12:57:52 -080051 image: "${REGISTRY}wurstmeister/zookeeper:${ZK_TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -080052 logging:
53 driver: "json-file"
54 options:
55 max-size: "10m"
56 max-file: 3
57 networks:
58 - kafka-net
59 environment:
60 ZOO_MY_ID: 1
61 ZOO_SERVERS: server.1=0.0.0.0:2888:3888 server.2=zk2:2888:3888 server.3=zk3:2888:3888
62
63 zk2:
David K. Bainbridge737b74f2018-01-22 12:57:52 -080064 image: "${REGISTRY}wurstmeister/zookeeper:${ZK_TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -080065 logging:
66 driver: "json-file"
67 options:
68 max-size: "10m"
69 max-file: 3
70 networks:
71 - kafka-net
72 environment:
73 ZOO_MY_ID: 2
74 ZOO_SERVERS: server.1=zk1:2888:3888 server.2=0.0.0.0:2888:3888 server.3=zk3:2888:3888
75
76 zk3:
David K. Bainbridge737b74f2018-01-22 12:57:52 -080077 image: "${REGISTRY}wurstmeister/zookeeper:${ZK_TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -080078 logging:
79 driver: "json-file"
80 options:
81 max-size: "10m"
82 max-file: 3
83 networks:
84 - kafka-net
85 environment:
86 ZOO_MY_ID: 3
87 ZOO_SERVERS: server.1=zk1:2888:3888 server.2=zk2:2888:3888 server.3=0.0.0.0:2888:3888
88
89 kafka:
90 deploy:
91 mode: global
David K. Bainbridge737b74f2018-01-22 12:57:52 -080092 image: "${REGISTRY}wurstmeister/kafka:${KAFKA_TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -080093 logging:
94 driver: "json-file"
95 options:
96 max-size: "10m"
97 max-file: 3
98 environment:
Jonathan Hart0584a1e2018-04-17 08:36:21 -070099 KAFKA_LISTENERS: PLAINTEXT://:9092
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800100 KAFKA_ZOOKEEPER_CONNECT: zk1:2181,zk2:2181,zk3:2181
101 KAFKA_HEAP_OPTS: -Xmx256M -Xms128M
102 volumes:
103 - /var/run/docker.sock:/var/run/docker.sock
104 networks:
105 - kafka-net
106 - voltha-net
107 ports:
108 - 9092:9092
109
Jonathan Hart87314cd2018-02-12 17:15:35 -0800110 vconsul:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800111 image: "${REGISTRY}consul:${CONSUL_TAG:-0.9.2}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800112 logging:
113 driver: "json-file"
114 options:
115 max-size: "10m"
116 max-file: 3
117
118 # Deploy to all docker manager nodes
119 deploy:
120 mode: global
121 placement:
122 constraints:
123 - node.role == manager
124 restart_policy:
125 condition: on-failure
126 entrypoint:
127 - consul
128 - agent
129 - -server
130 - -bootstrap-expect={{ SWARM_MANAGER_COUNT | default(1) }}
131 - -config-dir=/consul/config
132 - -data-dir=/consul/data # mandatory property
133 - -client=0.0.0.0
134 - -advertise={{ '{{' }} GetAllInterfaces | include "network" "172.29.20.0/29" | sort "size,address" | attr "address" {{ '}}' }}
135 - -ui
136 - -raft-protocol=3
137 - -rejoin
138 - -retry-join=172.29.20.2
139 - -retry-join=172.29.20.3
140 - -retry-join=172.29.20.4
141 - -retry-join=172.29.20.5
142 - -retry-join=172.29.20.6
143 - -retry-join=172.29.20.7
144 networks:
145 - consul-net
146 - voltha-net
147 ports:
148 - "8300:8300"
149 - "8400:8400"
150 - "8500:8500"
151 - "8600:8600/udp"
152{%- if CONSUL_ROOT is defined and CONSUL_ROOT %}
153 volumes:
154 - {{ CONSUL_ROOT }}/data:/consul/data
155 - {{ CONSUL_ROOT }}/config:/consul/config
156{%- endif %}
157
158 fluentdactv:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800159 image: "${REGISTRY}${REPOSITORY}voltha-fluentd:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800160 logging:
161 driver: "json-file"
162 options:
163 max-size: "10m"
164 max-file: 3
165 deploy:
166 replicas: 1
167 restart_policy:
168 condition: on-failure
169 environment:
170 FLUENTD_CONF: fluent-agg.conf
171 networks:
172 - voltha-net
173 ports:
174 - "24224"
175{%- if VOLTHA_LOGS is defined and VOLTHA_LOGS %}
176 volumes:
177 - "{{ VOLTHA_LOGS }}:/fluentd/log"
178{%- endif %}
179
180 fluentdstby:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800181 image: "${REGISTRY}${REPOSITORY}voltha-fluentd:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800182 logging:
183 driver: "json-file"
184 options:
185 max-size: "10m"
186 max-file: 3
187 deploy:
188 replicas: 1
189 restart_policy:
190 condition: on-failure
191 environment:
192 FLUENTD_CONF: fluent-agg.conf
193 networks:
194 - voltha-net
195 ports:
196 - "24224"
197{%- if VOLTHA_LOGS is defined and VOLTHA_LOGS %}
198 volumes:
199 - "{{ VOLTHA_LOGS }}:/fluentd/log"
200{%- endif %}
201
202 # The Fluentd container is part of the data collection
203 # infrastructure.
204 fluentd:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800205 image: "${REGISTRY}${REPOSITORY}voltha-fluentd:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800206 logging:
207 driver: "json-file"
208 options:
209 max-size: "10m"
210 max-file: 3
211 deploy:
212 mode: replicated
213 replicas: {{ SWARM_MANAGER_COUNT | default(1) }}
214 restart_policy:
215 condition: any
216 environment:
217 SERVICE_24224_NAME: "fluentd-intake"
218 FLUENTD_CONF: fluent.conf
219 WAIT_FOR: "fluentdactv:24224 fluentdstby:24224"
220 WAIT_FOR_TIMEOUT: 0
221 networks:
222 - voltha-net
223 ports:
224 - "24224"
225
Jonathan Hart0584a1e2018-04-17 08:36:21 -0700226 # Free RADIUS can be used to test VOLTHA's authentication
227 # sequence, i.e., EAPOL from a device behind an OLT to
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800228 # RADIUS authentication on the back end systems. By default
229 # no instances of Free RADIUS are deployed.
230 freeradius:
231 deploy:
232 replicas: 0
233 image: "${REGISTRY}marcelmaatkamp/freeradius:${RADIUS_TAG:-latest}"
234 logging:
235 driver: "json-file"
236 options:
237 max-size: "10m"
238 max-file: 3
239 ports:
240 - "1812:1812/udp"
241 - "1813:1813"
242 - "18120:18120"
Jonathan Hart0584a1e2018-04-17 08:36:21 -0700243
244{%- if RADIUS_ROOT is defined and RADIUS_ROOT %}
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800245 # CONFIG: When deploying a Free RADIUS instance client and user
246 # information will need to be configured for the service to
247 # operate correctly.
248 #
249 volumes:
250 - {{ RADIUS_ROOT }}/data/clients.conf:/etc/raddb/clients.conf
251 - {{ RADIUS_ROOT }}/data/users:/etc/raddb/users
252{%- endif %}
253 networks:
254 - voltha-net
255
256 # The cluster manager container calculates and servers ONOS cluster
257 # meta data via HTTP so that ONOS instances can form an HA cluster.
Jonathan Hart0584a1e2018-04-17 08:36:21 -0700258 # The cluster manager must run on a manager node so that it can
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800259 # retrieve service information from manager nodes
260 onos_cluster_manager:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800261 image: "${REGISTRY}${REPOSITORY}voltha-unum:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800262 deploy:
263 replicas: 1
264 placement:
265 constraints:
266 - node.role == manager
267 environment:
268 PERIOD: "10s"
269 LOG_LEVEL: "debug"
270 ORCHESTRATION: "swarm://"
271 LABELS: "org.voltha.onos.cluster:true"
272 NETWORK: "org.voltha.onos.cluster:true"
273 ports:
274 - 5411:5411
275 networks:
276 - voltha-net
277 volumes:
278 - /var/run/docker.sock:/var/run/docker.sock
279
280 # ONOS is the SDN controller for the solution and handles AAA,
281 # IGMP proxy, and L2 DHCP requests as well as manages flows
282 # down to the virtual devices (MCAST + OLT flows).
283 # Currently there is a single instance of ONOS as some of the
284 # applications running under ONOS do not support HA.
285 onos:
286 deploy:
287 replicas: 1
288 labels:
289 org.voltha.onos.cluster: "true"
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800290 image: "${REGISTRY}${REPOSITORY}voltha-onos:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800291 logging:
292 driver: "json-file"
293 options:
294 max-size: "10m"
295 max-file: 3
296 ports:
297 - 8101:8101 # ssh
298 - 6653:6653 # OF
299 - 8181:8181 # UI
300 environment:
301 EXTRA_JAVA_OPTS: "-Donos.cluster.metadata.uri=http://onos_cluster_manager:5411/config/"
302 networks:
303 - voltha-net
304
Jonathan Hartf78cd1b2018-02-05 09:31:29 -0800305 config_push:
306 deploy:
307 replicas: 1
308 restart_policy:
309 condition: on-failure
310 image: "${REGISTRY}${REPOSITORY}voltha-config-push:${TAG:-latest}"
311 logging:
312 driver: "json-file"
313 options:
314 max-size: "10m"
315 max-file: 3
316 environment:
317 ONOS_CONNECTION: "onos:8181"
318 ONOS_USER: "karaf"
319 ONOS_PASSWORD: "karaf"
Jonathan Hartb122cd52018-02-14 15:37:22 -0800320{%- if ONOS_CONFIG is defined and ONOS_CONFIG %}
321 volumes:
322 - {{ ONOS_CONFIG }}:/data/onos-config.json
323{%- endif %}
Jonathan Hartf78cd1b2018-02-05 09:31:29 -0800324 networks:
325 - voltha-net
326
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800327 # The VCORE container is the core capabilities of VOLTHA including
328 # interacting with device adapters
329 vcore:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800330 image: "${REGISTRY}${REPOSITORY}voltha-voltha:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800331 logging:
332 driver: "json-file"
333 options:
334 max-size: "10m"
335 max-file: 3
336 deploy:
337 replicas: {{ SWARM_MANAGER_COUNT | default(1) }}
338 entrypoint:
339 - voltha/voltha/main.py
340 - -v
Jonathan Hart87314cd2018-02-12 17:15:35 -0800341 - --consul=vconsul:8500
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800342 - --kafka=kafka
343 - --rest-port=8880
344 - --grpc-port=50556
345 - --instance-id-is-container-name
346 - --backend=consul
347 - --inter-core-subnet=172.29.19.0/24
348 - --pon-subnet=172.29.19.0/24
349 networks:
350 - voltha-net
351 ports:
352 - "8880:8880"
353 - "18880:18880"
354 - "50556:50556"
355 volumes:
356 - /var/run/docker.sock:/tmp/docker.sock
357
358 # The OpenFlow Agent support the OpenFlow protocol communication
359 # between ONOS and VOLTHA.
360 ofagent:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800361 image: "${REGISTRY}${REPOSITORY}voltha-ofagent:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800362 logging:
363 driver: "json-file"
364 options:
365 max-size: "10m"
366 max-file: 3
367 deploy:
368 replicas: 1
369 entrypoint:
370 - /ofagent/ofagent/main.py
371 - -v
Jonathan Hart87314cd2018-02-12 17:15:35 -0800372 - --consul=vconsul:8500
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800373 - --controller=onos:6653
374 - --grpc-endpoint=vcore:50556
375 - --instance-id-is-container-name
Jonathan Hartf78cd1b2018-02-05 09:31:29 -0800376 - --enable-tls
377 - --key-file=/ofagent/pki/voltha.key
378 - --cert-file=/ofagent/pki/voltha.crt
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800379 volumes:
380 - /var/run/docker.sock:/tmp/docker.sock
381 networks:
382 - voltha-net
383
384 # The VOLTHA container supports load balancing of request to
385 # the VOLTHA components as well as surfaces a REST API and maps
386 # the requests to GPRC
387 voltha:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800388 image: "${REGISTRY}${REPOSITORY}voltha-envoy:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800389 logging:
390 driver: "json-file"
391 options:
392 max-size: "10m"
393 max-file: 3
394 deploy:
395 replicas: 1
396 #environment:
397 # DOCKER_HOST_IP: "${DOCKER_HOST_IP}"
398 entrypoint:
399 - /usr/local/bin/envoyd
Jonathan Hart87314cd2018-02-12 17:15:35 -0800400 - -consul-svc-nme
401 - "vconsul"
402 - -kv-svc-name
403 - "vconsul"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800404 - -envoy-cfg-template
405 - "/envoy/voltha-grpc-proxy.template.json"
406 - -envoy-config
407 - "/envoy/voltha-grpc-proxy.json"
408 networks:
409 - voltha-net
410 ports:
411 - "50555:50555"
412 - "8882:8882"
413 - "8443:8443"
414 - "8001:8001"
415 volumes:
416 - /var/run/docker.sock:/tmp/docker.sock
417
Jonathan Hart0584a1e2018-04-17 08:36:21 -0700418 # The CLI container provides an CLI to the VOLTHA capabilitiy
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800419 # that can be accessed via SSH.
420 cli:
David K. Bainbridge60fdad72018-02-20 11:17:38 -0500421 image: "${REGISTRY}${REPOSITORY}voltha-cli${CUSTOM_CLI_LABEL}:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800422 logging:
423 driver: "json-file"
424 options:
425 max-size: "10m"
426 max-file: 3
427 deploy:
428 replicas: {{ SWARM_MANAGER_COUNT | default(1) }}
429 #environment:
430 # DOCKER_HOST_IP: "${DOCKER_HOST_IP}"
431 entrypoint:
432 - /cli/cli/setup.sh
Jonathan Hart87314cd2018-02-12 17:15:35 -0800433 - -C vconsul:8500
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800434 - -g voltha:50555
435 - -s voltha:18880
436 - -G
437 networks:
438 - voltha-net
439 ports:
440 - "5022:22"
441
442 # The Netconf container provides an NETCONF API to be used
443 # with VOLTHA and maps that to GRPC requests
444 netconf:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800445 image: "${REGISTRY}${REPOSITORY}voltha-netconf:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800446 logging:
447 driver: "json-file"
448 options:
449 max-size: "10m"
450 max-file: 3
451 deploy:
452 mode: global
453 environment:
454 SERVICE_1830_NAME: "netconf-server"
455 entrypoint:
456 - /netconf/netconf/main.py
457 - -v
Jonathan Hart87314cd2018-02-12 17:15:35 -0800458 - --consul=vconsul:8500
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800459 - --grpc-endpoint=voltha:50555
460 - --instance-id-is-container-name
461 networks:
462 - voltha-net
463 ports:
464 - "830:1830"
465 volumes:
466 - /var/run/docker.sock:/tmp/docker.sock
467
468 # The tools container provides a bash command shell to which
469 # an operator can SSH that has the same network connectivity
Jonathan Hart0584a1e2018-04-17 08:36:21 -0700470 # as other VOLTHA containers and is thus a convenient
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800471 # troubleshooting tool
472 tools:
David K. Bainbridge737b74f2018-01-22 12:57:52 -0800473 image: "${REGISTRY}${REPOSITORY}voltha-tools:${TAG:-latest}"
David K. Bainbridgebba65ff2018-01-19 09:26:09 -0800474 logging:
475 driver: "json-file"
476 options:
477 max-size: "10m"
478 max-file: 3
479 deploy:
480 mode: replicated
481 replicas: 1
482 restart_policy:
483 condition: on-failure
484 ports:
485 - "4022:22"
486 networks:
487 - voltha-net
488 - kafka-net
489
490networks:
491 consul-net:
492 driver: overlay
493 driver_opts:
494 encrypted: "true"
495 ipam:
496 driver: default
497 config:
498 - subnet: 172.29.20.0/29
499
500 voltha-net:
501 driver: overlay
502 driver_opts:
503 encrypted: "true"
504 ipam:
505 driver: default
506 config:
507 - subnet: 172.29.19.0/24
508 labels:
509 org.voltha.onos.cluster: "true"
510
511 kafka-net:
512 driver: overlay
513 driver_opts:
514 encrypted: "true"