diff --git a/service/files/defaults.yaml b/service/files/defaults.yaml index af04eb5..479a080 100644 --- a/service/files/defaults.yaml +++ b/service/files/defaults.yaml @@ -30,6 +30,7 @@ configs: debug: false plugin_agent: "openvswitch" l3_ha: false + dvr: false ovsdb: interface: "native" connection: "unix:/run/openvswitch/db.sock" diff --git a/service/files/l3_agent.ini.j2 b/service/files/l3_agent.ini.j2 index 1bb7234..8db7582 100644 --- a/service/files/l3_agent.ini.j2 +++ b/service/files/l3_agent.ini.j2 @@ -1,4 +1,4 @@ # l3_agent.ini [DEFAULT] -agent_mode = legacy +agent_mode = {% if neutron.dvr %} dvr_snat {% else %} legacy {% endif %} external_network_bridge = diff --git a/service/files/l3_agent_compute.ini.j2 b/service/files/l3_agent_compute.ini.j2 new file mode 100644 index 0000000..9b8858e --- /dev/null +++ b/service/files/l3_agent_compute.ini.j2 @@ -0,0 +1,3 @@ +# l3_agent_compute.ini +[DEFAULT] +agent_mode = dvr diff --git a/service/files/ml2_conf.ini.j2 b/service/files/ml2_conf.ini.j2 index 969a815..218bd13 100644 --- a/service/files/ml2_conf.ini.j2 +++ b/service/files/ml2_conf.ini.j2 @@ -52,6 +52,10 @@ tunnel_types = vxlan l2_population = true arp_responder = true +{% if neutron.dvr %} +enable_distributed_routing = true +{% endif %} + [ovs] ovsdb_interface = {{ neutron.ovsdb.interface }} ovsdb_connection = {{ neutron.ovsdb.connection }} diff --git a/service/files/neutron.conf.j2 b/service/files/neutron.conf.j2 index 318e1e0..8146109 100644 --- a/service/files/neutron.conf.j2 +++ b/service/files/neutron.conf.j2 @@ -35,6 +35,10 @@ l3_ha = {{ neutron.l3_ha }} # If it is set to 0 then the ha router will be scheduled on every L3 agent. max_l3_agents_per_router=0 +{% if neutron.dvr %} +# System-wide flag to determine the type of router that tenants can create. Only admin can override. (boolean value) +router_distributed = true +{% endif %} {% if neutron.enable_lbaas %} [service_providers] diff --git a/service/neutron-l3-agent-compute.yaml b/service/neutron-l3-agent-compute.yaml new file mode 100644 index 0000000..6501a50 --- /dev/null +++ b/service/neutron-l3-agent-compute.yaml @@ -0,0 +1,37 @@ +dsl_version: 0.2.0 +service: + name: neutron-l3-agent-compute + antiAffinity: local + hostNetwork: true + containers: + - name: neutron-l3-agent + image: neutron-l3-agent + privileged: true + volumes: + - name: ovs-socket + type: host + path: /run/openvswitch + - name: metadata-socket + type: host + path: /var/lib/neutron/ccp + daemon: + command: neutron-l3-agent --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/l3_agent_compute.ini --config-file /etc/neutron/plugins/ml2/ml2_conf.ini + dependencies: + - rabbitmq + files: + - neutron.conf + - ml2-conf.ini + - l3-agent-compute.ini +files: + neutron.conf: + path: /etc/neutron/neutron.conf + content: neutron.conf.j2 + perm: "0600" + ml2-conf.ini: + path: /etc/neutron/plugins/ml2/ml2_conf.ini + content: ml2_conf.ini.j2 + perm: "0600" + l3-agent-compute.ini: + path: /etc/neutron/l3_agent_compute.ini + content: l3_agent_compute.ini.j2 + perm: "0600" diff --git a/service/neutron-metadata-agent.yaml b/service/neutron-metadata-agent.yaml index 0a56d73..e8ff92d 100644 --- a/service/neutron-metadata-agent.yaml +++ b/service/neutron-metadata-agent.yaml @@ -1,6 +1,9 @@ -dsl_version: 0.1.0 +dsl_version: 0.2.0 service: name: neutron-metadata-agent + # {% if neutron.dvr %} + antiAffinity: local + # {% endif %} hostNetwork: true containers: - name: neutron-metadata-agent