blob: be4b254a2b03be9fcd294edd39e24925af4c8f7f [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001#!/bin/bash
2
3{{/*
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17set -ex
18COMMAND="${@:-start}"
19
20function start () {
Rico Lin0e153482024-05-03 03:29:14 +080021# (ricolin): Currently ovn have issue with uWSGI,
22# let's keep using non-uWSGI way until this bug fixed:
23# https://bugs.launchpad.net/neutron/+bug/1912359
24{{- if ( has "ovn" .Values.network.backend ) }}
25 start_ovn
26{{- else }}
27 exec uwsgi --ini /etc/neutron/neutron-api-uwsgi.ini
28{{- end }}
29}
30
31function start_ovn () {
Mohammed Naserf3f59a72023-01-15 21:02:04 -050032 exec neutron-server \
33 --config-file /etc/neutron/neutron.conf \
Mohammed Naser8ceefcf2023-07-23 12:36:58 +000034{{- if ( has "ovn" .Values.network.backend ) }}
35 --config-file /tmp/pod-shared/ovn.ini \
36{{- end }}
Rico Lincf86b122023-11-02 01:29:14 +080037{{- if .Values.conf.plugins.taas.taas.enabled }}
Mohammed Naser8ceefcf2023-07-23 12:36:58 +000038 --config-file /etc/neutron/taas_plugin.ini \
39{{- end }}
Rico Lincf86b122023-11-02 01:29:14 +080040{{- if ( has "sriov" .Values.network.backend ) }}
Mohammed Naser8ceefcf2023-07-23 12:36:58 +000041 --config-file /etc/neutron/plugins/ml2/sriov_agent.ini \
42{{- end }}
Rico Lincf86b122023-11-02 01:29:14 +080043{{- if .Values.conf.plugins.l2gateway }}
Mohammed Naser8ceefcf2023-07-23 12:36:58 +000044 --config-file /etc/neutron/l2gw_plugin.ini \
45{{- end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050046{{- if ( has "tungstenfabric" .Values.network.backend ) }}
47 --config-file /etc/neutron/plugins/tungstenfabric/tf_plugin.ini
Mohammed Naserf3f59a72023-01-15 21:02:04 -050048{{- else }}
49 --config-file /etc/neutron/plugins/ml2/ml2_conf.ini
50{{- end }}
Mohammed Naserf3f59a72023-01-15 21:02:04 -050051}
52
53function stop () {
54 kill -TERM 1
55}
56
57$COMMAND