blob: 73f5c6e7eca93ff4c4e3c2f444d449c4f7061f0f [file] [log] [blame]
{#
Copyright 2017-present Open Networking Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}
version: '2'
services:
storage:
image: "docker-registry:5000/consul:{{ docker.tag }}"
container_name: storage
labels:
- "lab.solution=CORD"
- "lab.component=storage"
- "lab.implementation=consul"
volumes:
- "/etc/maas/automation/storage:/consul/data"
network_mode: host
command: agent --server --bind {{ mgmt_ip_address.stdout }} --client {{ mgmt_ip_address.stdout }} --bootstrap-expect=1
restart: unless-stopped
allocator:
image: "docker-registry:5000/opencord/maas-allocator:{{ docker.tag }}"
container_name: allocator
ports:
- "4242:4242"
labels:
- "lab.solution=CORD"
- "lab.component=allocator"
environment:
# need to explicitly set the resolver, else go will skip the /etc/hosts file
- "GODEBUG=netdns=go"
- "ALLOCATE_PORT=4242"
- "ALLOCATE_LISTEN=0.0.0.0"
- "ALLOCATE_NETWORK={{ networks.fabric }}"
- "ALLOCATE_RANGE_LOW={{ ranges.fabric.low }}"
- "ALLOCATE_RANGE_HIGH={{ ranges.fabric.high }}"
- "ALLOCATE_LOG_LEVEL=warn"
- "ALLOCATE_LOG_FORMAT=text"
restart: unless-stopped
provisioner:
image: "docker-registry:5000/opencord/maas-provisioner:{{ docker.tag }}"
container_name: provisioner
dns: {{ mgmt_ip_address.stdout }}
ports:
- "4243:4243"
labels:
- "lab.solution=CORD"
- "lab.component=provisioner"
links:
- allocator
- storage
environment:
# need to explicitly set the resolver, else go will skip the /etc/hosts file
- "GODEBUG=netdns=go"
- "INTERFACE_CONFIG=1"
- "PROVISION_PORT=4243"
- "PROVISION_LISTEN=0.0.0.0"
- "PROVISION_DEFAULT_ROLE=compute-node"
- "PROVISION_SCRIPT=/etc/maas/ansible/do-ansible"
- "PROVISION_STORAGE_URL=consul://{{ mgmt_ip_address.stdout }}:8500"
- "PROVISION_NUMBER_OF_WORKERS=1"
- "PROVISION_LOG_LEVEL=warn"
- "PROVISION_LOG_FORMAT=text"
volumes:
- "/etc/maas/ansible:/etc/maas/ansible"
- "/usr/local/share/ca-certificates:/usr/local/share/ca-certificates"
- "/opt/cord:/opt/cord"
- "/opt/cord_profile:/opt/cord_profile"
- "/opt/credentials:/opt/credentials"
- "/etc/maas/.ssh:/etc/maas/.ssh"
restart: unless-stopped
switchq:
image: "docker-registry:5000/opencord/maas-switchq:{{ docker.tag }}"
container_name: switchq
ports:
- "4244:4244"
labels:
- "lab.solution=CORD"
- "lab.component=switchq"
links:
- provisioner
env_file:
- "/etc/maas/secrets/switchq.env"
environment:
- "SWITCHQ_SCRIPT=/etc/maas/ansible/do-switch"
- "SWITCHQ_PROVISION_URL=http://provisioner:4243/provision/"
- "SWITCHQ_PROVISION_TTL=0s"
- "SWITCHQ_DEFAULT_ROLE=fabric-switch"
- "SWITCHQ_ADDRESS_URL=file:///switchq/dhcp/dhcp_harvest.inc"
- "SWITCHQ_LOG_LEVEL=warn"
- "SWITCHQ_LOG_FORMAT=text"
- "SWITCHQ_MAAS_URL=http://{{ mgmt_ip_address.stdout }}/MAAS"
volumes:
- "/etc/bind/maas:/switchq/dhcp"
restart: unless-stopped
automation:
image: "docker-registry:5000/opencord/maas-automation:{{ docker.tag }}"
container_name: automation
labels:
- "lab.solution=CORD"
- "lab.component=automation"
links:
- provisioner
env_file:
- "/etc/maas/secrets/automation.env"
environment:
# need to explicitly set the resolver, else go will skip the /etc/hosts file
- "GODEBUG=netdns=go"
- "AUTOMATION_PROVISION_URL=http://provisioner:4243/provision/"
- "AUTOMATION_PROVISION_TTL=0s"
{% if virtualbox_support is defined and virtualbox_support == "1" %}
- "AUTOMATION_POWER_HELPER_SCRIPT=/etc/maas/virtualbox/power_discovery"
- "AUTOMATION_POWER_HELPER_USER={{ virtualbox.power_helper_user }}"
- "AUTOMATION_POWER_HELPER_HOST={{ virtualbox_host }}"
{% endif %}
- "AUTOMATION_LOG_FORMAT=text"
- "AUTOMATION_LOG_LEVEL=warn"
- "AUTOMATION_MAAS_API_VERSION=1.0"
- "AUTOMATION_MAAS_URL=http://{{ mgmt_ip_address.stdout }}/MAAS"
- "AUTOMATION_QUERY_INTERVAL=30s"
- "AUTOMATION_MAC_TO_NAME_MAPPINGS=@/mappings/mappings.json"
- "AUTOMATION_ALWAYS_RENAME=true"
volumes:
- "/etc/maas:/mappings"
{% if virtualbox_support is defined and virtualbox_support == "1" %}
- "/etc/maas/virtualbox:/etc/maas/virtualbox"
{% endif %}
restart: unless-stopped
harvester:
image: "docker-registry:5000/opencord/maas-harvester:{{ docker.tag }}"
container_name: harvester
restart: always
labels:
- "lab.solution=cord"
- "lab.component=harvester"
volumes:
- "/etc/dhcp:/reservations"
- "/var/lib/maas/dhcp:/harvester"
- "/etc/bind/maas:/bind"
- "/etc/bind/maas:/key"
- "/etc/dhcp:/etc/dhcp"
environment:
- "HARVESTER_LOG_LEVEL=warn"
- "HARVESTER_PORT=8954"
- "HARVESTER_OUTPUT_FILE=/bind/dhcp_harvest.inc"
- "HARVESTER_VERIFY_LEASES=true"
- "HARVESTER_VERIFY_TIME_OUT=2s"
- "HARVESTER_QUERY_PERIOD=2m"
- "HARVESTER_QUIET_PERIOD=2s"
- "HARVESTER_RNDC_ADDRESS={{ mgmt_ip_address.stdout }}"
- "HARVESTER_RNDC_PORT=954"
- "HARVESTER_RNDC_KEY_FILE=/key/rndc.conf.maas"
- "HARVESTER_RNDC_ZONE=cord.lab"
- "HARVESTER_RNDC_UPDATE=true"
ports:
- "8954:8954"
restart: unless-stopped
generator:
image: "docker-registry:5000/opencord/maas-generator:{{ docker.tag }}"
container_name: generator
ports:
- "4245:4245"
labels:
- "lab.solution=CORD"
- "lab.component=generator"
environment:
- "CONFIGGEN_PORT=4245"
- "CONFIGGEN_LISTEN=0.0.0.0"
- "CONFIGGEN_CONTROLLER=http://%s:%s@onos-fabric:8181"
- "CONFIGGEN_USERNAME=karaf"
- "CONFIGGEN_PASSWORD=karaf"
- "CONFIGGEN_LOG_LEVEL=warn"
restart: unless-stopped