Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | {{/* |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */}} |
| 16 | |
| 17 | set -ex |
| 18 | COMMAND="${@:-start}" |
| 19 | |
| 20 | function start () { |
Rico Lin | 0e15348 | 2024-05-03 03:29:14 +0800 | [diff] [blame] | 21 | # (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 | |
| 31 | function start_ovn () { |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 32 | exec neutron-server \ |
| 33 | --config-file /etc/neutron/neutron.conf \ |
Mohammed Naser | 8ceefcf | 2023-07-23 12:36:58 +0000 | [diff] [blame] | 34 | {{- if ( has "ovn" .Values.network.backend ) }} |
| 35 | --config-file /tmp/pod-shared/ovn.ini \ |
| 36 | {{- end }} |
Rico Lin | cf86b12 | 2023-11-02 01:29:14 +0800 | [diff] [blame] | 37 | {{- if .Values.conf.plugins.taas.taas.enabled }} |
Mohammed Naser | 8ceefcf | 2023-07-23 12:36:58 +0000 | [diff] [blame] | 38 | --config-file /etc/neutron/taas_plugin.ini \ |
| 39 | {{- end }} |
Rico Lin | cf86b12 | 2023-11-02 01:29:14 +0800 | [diff] [blame] | 40 | {{- if ( has "sriov" .Values.network.backend ) }} |
Mohammed Naser | 8ceefcf | 2023-07-23 12:36:58 +0000 | [diff] [blame] | 41 | --config-file /etc/neutron/plugins/ml2/sriov_agent.ini \ |
| 42 | {{- end }} |
Rico Lin | cf86b12 | 2023-11-02 01:29:14 +0800 | [diff] [blame] | 43 | {{- if .Values.conf.plugins.l2gateway }} |
Mohammed Naser | 8ceefcf | 2023-07-23 12:36:58 +0000 | [diff] [blame] | 44 | --config-file /etc/neutron/l2gw_plugin.ini \ |
| 45 | {{- end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 46 | {{- if ( has "tungstenfabric" .Values.network.backend ) }} |
| 47 | --config-file /etc/neutron/plugins/tungstenfabric/tf_plugin.ini |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 48 | {{- else }} |
| 49 | --config-file /etc/neutron/plugins/ml2/ml2_conf.ini |
| 50 | {{- end }} |
Mohammed Naser | f3f59a7 | 2023-01-15 21:02:04 -0500 | [diff] [blame] | 51 | } |
| 52 | |
| 53 | function stop () { |
| 54 | kill -TERM 1 |
| 55 | } |
| 56 | |
| 57 | $COMMAND |