Merge "[docs] Update documentation on scenarios for MS6"
[fuel.git] / mcp / scripts / docker-compose / docker-compose.yaml.j2
1 ##############################################################################
2 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {%- import 'net_map.j2' as nm with context %}
9 {%- import 'net_macros.j2' as ma with context %}
10 {#- conf.MCPCONTROL_NET & co are mandatory, defaults are set via globals.sh #}
11 {%- set net_mcpcontrol = [conf.MCPCONTROL_NET, conf.MCPCONTROL_PREFIX] | join("/") %}
12 version: '2'
13 services:
14   opnfv-fuel-salt-master:
15     container_name: "fuel"
16     image: "opnfv/fuel:saltmaster-reclass-{{ conf.MCP_DOCKER_TAG }}"
17     networks:
18       - mcpcontrol
19       - pxebr
20       - mgmt
21     volumes:
22        - /run/dbus/system_bus_socket:/run/dbus/system_bus_socket:ro
23        - {{ conf.MCP_REPO_ROOT_PATH }}:/root/fuel
24        - {{ conf.MCP_REPO_ROOT_PATH }}/mcp/scripts/docker-compose/files/entrypoint.sh:/entrypoint.sh
25        - {{ conf.MCP_STORAGE_DIR }}/pod_config.yml:/root/pod_config.yml
26        - {{ conf.MCP_STORAGE_DIR }}/base_image_opnfv_fuel_vcp.img:/srv/salt/env/prd/salt/files/control/images/base_image_opnfv_fuel_vcp.img
27        - {{ conf.MCP_STORAGE_DIR }}/nodes:/srv/salt/reclass/nodes
28        - {{ conf.MCP_STORAGE_DIR }}/pki:/etc/pki
29        - {{ conf.MCP_STORAGE_DIR }}/salt:/etc/salt
30        - {{ conf.MCP_STORAGE_DIR }}/hosts:/etc/hosts
31     hostname: cfg01
32     domainname: {{ conf.cluster.domain }}
33     privileged: true
34 networks:
35   mcpcontrol:
36     driver: macvlan
37     driver_opts:
38       parent: veth_mcp1  # Always untagged
39     ipam:
40       config:
41         - subnet: {{ net_mcpcontrol }}
42           gateway: {{ net_mcpcontrol | ipnet_hostaddr(1) }}
43           ip_range: {{ [conf.SALT_MASTER, conf.MCPCONTROL_PREFIX] | join("/") }}
44   pxebr:
45     driver: macvlan
46     driver_opts:
47       parent: veth_mcp3  # Always untagged
48     ipam:
49       config:
50         - subnet: {{ nm.net_admin }}
51           ip_range: {{ [nm.net_admin | ipnet_hostaddr(nm.start_ip[nm.net_admin] + nm.net_admin_hosts.index('opnfv_infra_config_pxe_admin_address') +1), nm.net_admin.split("/")[-1]] | join("/") }}
52   mgmt:
53     driver: macvlan
54     driver_opts:
55 {%- if conf.idf.fuel.jumphost.get('trunks', {}).get('mgmt', False) %}
56       parent: {{ ma.interface_str('veth_mcp5', nm.vlan_mgmt) }}
57 {%- else %}
58       parent: veth_mcp5  # Untagged by default
59 {%- endif %}
60     ipam:
61       config:
62         - subnet: {{ nm.net_mgmt }}
63           ip_range: {{ [nm.net_mgmt | ipnet_hostaddr(2), nm.net_mgmt.split("/")[-1]] | join("/") }}