From 37b099e320cf7da343bc6d61592d2fb2ed82e5d2 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Tue, 15 Aug 2017 00:19:04 -0500 Subject: [PATCH] Neutron: Move OpenVSwitch into its own chart This PS moves OpenVSwitch into its own chart - decoupling it from neutron, both making it easier to deploy and use seperately and permitting use of other network backends. Partially implements: blueprint split-nova-and-neutron-infra Change-Id: Ifd637136b950ddf1ba1c26ce76c9bbdeafc232c3 --- doc/source/install/developer/all-in-one.rst | 1 + doc/source/install/multinode.rst | 3 +- neutron/templates/configmap-bin.yaml | 4 - neutron/values.yaml | 30 +------ openvswitch/Chart.yaml | 25 ++++++ openvswitch/requirements.yaml | 18 ++++ .../bin/_openvswitch-db-server.sh.tpl | 6 +- .../bin/_openvswitch-vswitchd.sh.tpl | 6 +- openvswitch/templates/configmap-bin.yaml | 29 +++++++ .../templates/daemonset-ovs-db.yaml | 16 +--- .../templates/daemonset-ovs-vswitchd.yaml | 9 +- openvswitch/values.yaml | 83 +++++++++++++++++++ .../armada/openstack-master-aio.yaml | 23 +++++ tools/deployment/armada/openstack-master.yaml | 23 +++++ tools/gate/launch-osh/basic.sh | 1 + tools/gate/openstack/network_launch.sh | 2 +- 16 files changed, 227 insertions(+), 52 deletions(-) create mode 100644 openvswitch/Chart.yaml create mode 100644 openvswitch/requirements.yaml rename {neutron => openvswitch}/templates/bin/_openvswitch-db-server.sh.tpl (80%) rename {neutron => openvswitch}/templates/bin/_openvswitch-vswitchd.sh.tpl (91%) create mode 100644 openvswitch/templates/configmap-bin.yaml rename {neutron => openvswitch}/templates/daemonset-ovs-db.yaml (81%) rename {neutron => openvswitch}/templates/daemonset-ovs-vswitchd.yaml (88%) create mode 100644 openvswitch/values.yaml diff --git a/doc/source/install/developer/all-in-one.rst b/doc/source/install/developer/all-in-one.rst index adb27f8ff2..88b2268a47 100644 --- a/doc/source/install/developer/all-in-one.rst +++ b/doc/source/install/developer/all-in-one.rst @@ -191,6 +191,7 @@ OpenStack services depend upon them. helm install --name=rabbitmq ./rabbitmq --namespace=openstack helm install --name=ingress ./ingress --namespace=openstack helm install --name=libvirt ./libvirt --namespace=openstack + helm install --name=openvswitch ./openvswitch --namespace=openstack Once the OpenStack infrastructure components are installed and running, the OpenStack services can be installed. In the below examples the default values diff --git a/doc/source/install/multinode.rst b/doc/source/install/multinode.rst index 4efc0eed07..e406b99021 100644 --- a/doc/source/install/multinode.rst +++ b/doc/source/install/multinode.rst @@ -372,7 +372,7 @@ Installation of Other Services Now you can easily install the other services simply by going in order: -**Install Memcached/Etcd/RabbitMQ/Ingress/Libvirt:** +**Install Memcached/Etcd/RabbitMQ/Ingress/Libvirt/OpenVSwitch:** :: @@ -381,6 +381,7 @@ Now you can easily install the other services simply by going in order: helm install --name=rabbitmq ./rabbitmq --namespace=openstack helm install --name=ingress ./ingress --namespace=openstack helm install --name=libvirt ./libvirt --namespace=openstack + helm install --name=openvswitch ./openvswitch --namespace=openstack **Install Keystone:** diff --git a/neutron/templates/configmap-bin.yaml b/neutron/templates/configmap-bin.yaml index 75db7449c0..397c1052d9 100644 --- a/neutron/templates/configmap-bin.yaml +++ b/neutron/templates/configmap-bin.yaml @@ -55,8 +55,4 @@ data: {{ tuple "bin/_neutron-openvswitch-agent-init.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} neutron-server.sh: |+ {{ tuple "bin/_neutron-server.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} - openvswitch-db-server.sh: |+ -{{ tuple "bin/_openvswitch-db-server.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} - openvswitch-vswitchd.sh: |+ -{{ tuple "bin/_openvswitch-vswitchd.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{- end }} diff --git a/neutron/values.yaml b/neutron/values.yaml index dd6d3dda6d..71530fcd0b 100644 --- a/neutron/values.yaml +++ b/neutron/values.yaml @@ -33,8 +33,6 @@ images: l3: docker.io/kolla/ubuntu-source-neutron-l3-agent:3.0.3 neutron_openvswitch_agent: docker.io/kolla/ubuntu-source-neutron-openvswitch-agent:3.0.3 neutron_linuxbridge_agent: docker.io/kolla/ubuntu-source-neutron-linuxbridge-agent:3.0.3 - openvswitch_db_server: docker.io/kolla/ubuntu-source-openvswitch-db-server:3.0.3 - openvswitch_vswitchd: docker.io/kolla/ubuntu-source-openvswitch-vswitchd:3.0.3 dep_check: docker.io/kolla/ubuntu-source-kubernetes-entrypoint:4.0.0 pull_policy: "IfNotPresent" @@ -164,6 +162,9 @@ dependencies: endpoint: internal - service: network endpoint: internal + daemonset: + - ovs-vswitchd + - ovs-db lb_agent: services: - service: oslo_messaging @@ -261,14 +262,6 @@ pod: enabled: true min_ready_seconds: 0 max_unavailable: 1 - ovs_db: - enabled: false - min_ready_seconds: 0 - max_unavailable: 1 - ovs_vswitchd: - enabled: false - min_ready_seconds: 0 - max_unavailable: 1 disruption_budget: server: min_available: 0 @@ -313,21 +306,6 @@ pod: limits: memory: "1024Mi" cpu: "2000m" - ovs: - db: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" - vswitchd: - requests: - memory: "128Mi" - cpu: "100m" - limits: - memory: "1024Mi" - cpu: "2000m" server: requests: memory: "128Mi" @@ -936,8 +914,6 @@ manifests: daemonset_lb_agent: false daemonset_metadata_agent: true daemonset_ovs_agent: true - daemonset_ovs_db: true - daemonset_ovs_vswitchd: true deployment_server: true ingress_server: true job_bootstrap: true diff --git a/openvswitch/Chart.yaml b/openvswitch/Chart.yaml new file mode 100644 index 0000000000..a11bc469c7 --- /dev/null +++ b/openvswitch/Chart.yaml @@ -0,0 +1,25 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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. + +apiVersion: v1 +description: OpenStack-Helm OpenVSwitch +name: openvswitch +version: 0.1.0 +home: http://openvswitch.org +icon: https://www.openstack.org/themes/openstack/images/project-mascots/Neutron/OpenStack_Project_Neutron_vertical.png +sources: + - https://github.com/openvswitch/ovs + - https://git.openstack.org/cgit/openstack/openstack-helm +maintainers: + - name: OpenStack-Helm Authors diff --git a/openvswitch/requirements.yaml b/openvswitch/requirements.yaml new file mode 100644 index 0000000000..53782e69b2 --- /dev/null +++ b/openvswitch/requirements.yaml @@ -0,0 +1,18 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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. + +dependencies: + - name: helm-toolkit + repository: http://localhost:8879/charts + version: 0.1.0 diff --git a/neutron/templates/bin/_openvswitch-db-server.sh.tpl b/openvswitch/templates/bin/_openvswitch-db-server.sh.tpl similarity index 80% rename from neutron/templates/bin/_openvswitch-db-server.sh.tpl rename to openvswitch/templates/bin/_openvswitch-db-server.sh.tpl index f6a85d5297..a53b667c71 100644 --- a/neutron/templates/bin/_openvswitch-db-server.sh.tpl +++ b/openvswitch/templates/bin/_openvswitch-db-server.sh.tpl @@ -24,4 +24,8 @@ if [[ ! -e "/run/openvswitch/conf.db" ]]; then fi umask 000 -exec /usr/sbin/ovsdb-server /run/openvswitch/conf.db -vconsole:emer -vconsole:err -vconsole:info --remote=punix:/run/openvswitch/db.sock +exec /usr/sbin/ovsdb-server /run/openvswitch/conf.db \ + -vconsole:emer \ + -vconsole:err \ + -vconsole:info \ + --remote=punix:/run/openvswitch/db.sock diff --git a/neutron/templates/bin/_openvswitch-vswitchd.sh.tpl b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl similarity index 91% rename from neutron/templates/bin/_openvswitch-vswitchd.sh.tpl rename to openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl index 172a4b3706..467fd46ee6 100644 --- a/neutron/templates/bin/_openvswitch-vswitchd.sh.tpl +++ b/openvswitch/templates/bin/_openvswitch-vswitchd.sh.tpl @@ -50,4 +50,8 @@ if [ -n "{{- $br -}}" ] ; then fi {{- end }} -exec /usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock --mlockall -vconsole:emer -vconsole:err -vconsole:info +exec /usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock \ + -vconsole:emer \ + -vconsole:err \ + -vconsole:info \ + --mlockall diff --git a/openvswitch/templates/configmap-bin.yaml b/openvswitch/templates/configmap-bin.yaml new file mode 100644 index 0000000000..ac13c9a312 --- /dev/null +++ b/openvswitch/templates/configmap-bin.yaml @@ -0,0 +1,29 @@ +{{/* +Copyright 2017 The Openstack-Helm Authors. + +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. +*/}} + +{{- if .Values.manifests.configmap_bin }} +{{- $envAll := . }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: openvswitch-bin +data: + openvswitch-db-server.sh: |+ +{{ tuple "bin/_openvswitch-db-server.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + openvswitch-vswitchd.sh: |+ +{{ tuple "bin/_openvswitch-vswitchd.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} +{{- end }} diff --git a/neutron/templates/daemonset-ovs-db.yaml b/openvswitch/templates/daemonset-ovs-db.yaml similarity index 81% rename from neutron/templates/daemonset-ovs-db.yaml rename to openvswitch/templates/daemonset-ovs-db.yaml index 0d1dfb5f5c..5ff86ff656 100644 --- a/neutron/templates/daemonset-ovs-db.yaml +++ b/openvswitch/templates/daemonset-ovs-db.yaml @@ -26,10 +26,9 @@ spec: template: metadata: labels: -{{ tuple $envAll "neutron" "ovs-db" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} +{{ tuple $envAll "openvswitch" "ovs-db" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} - configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} spec: nodeSelector: {{ .Values.labels.ovs.node_selector_key }}: {{ .Values.labels.ovs.node_selector_value }} @@ -46,7 +45,7 @@ spec: command: - /tmp/openvswitch-db-server.sh volumeMounts: - - name: neutron-bin + - name: openvswitch-bin mountPath: /tmp/openvswitch-db-server.sh subPath: openvswitch-db-server.sh readOnly: true @@ -55,19 +54,12 @@ spec: - name: run mountPath: /run volumes: - - name: neutron-bin + - name: openvswitch-bin configMap: - name: neutron-bin + name: openvswitch-bin defaultMode: 0555 - name: varlibopenvswitch emptyDir: {} - - name: neutron-etc - configMap: - name: neutron-etc - defaultMode: 0444 - - name: libmodules - hostPath: - path: /lib/modules - name: run hostPath: path: /run diff --git a/neutron/templates/daemonset-ovs-vswitchd.yaml b/openvswitch/templates/daemonset-ovs-vswitchd.yaml similarity index 88% rename from neutron/templates/daemonset-ovs-vswitchd.yaml rename to openvswitch/templates/daemonset-ovs-vswitchd.yaml index 8ab84859e6..5f1ee124b9 100644 --- a/neutron/templates/daemonset-ovs-vswitchd.yaml +++ b/openvswitch/templates/daemonset-ovs-vswitchd.yaml @@ -26,10 +26,9 @@ spec: template: metadata: labels: -{{ tuple $envAll "neutron" "ovs-vswitchd" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} +{{ tuple $envAll "openvswitch" "ovs-vswitchd" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} - configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} spec: nodeSelector: {{ .Values.labels.ovs.node_selector_key }}: {{ .Values.labels.ovs.node_selector_value }} @@ -53,7 +52,7 @@ spec: command: - /tmp/openvswitch-vswitchd.sh volumeMounts: - - name: neutron-bin + - name: openvswitch-bin mountPath: /tmp/openvswitch-vswitchd.sh subPath: openvswitch-vswitchd.sh readOnly: true @@ -63,9 +62,9 @@ spec: - name: run mountPath: /run volumes: - - name: neutron-bin + - name: openvswitch-bin configMap: - name: neutron-bin + name: openvswitch-bin defaultMode: 0555 - name: libmodules hostPath: diff --git a/openvswitch/values.yaml b/openvswitch/values.yaml new file mode 100644 index 0000000000..8765590798 --- /dev/null +++ b/openvswitch/values.yaml @@ -0,0 +1,83 @@ +# Copyright 2017 The Openstack-Helm Authors. +# +# 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. + +# Default values for neutron. +# This is a YAML-formatted file. +# Declare name/value pairs to be passed into your templates. +# name: value + +release_group: null + +images: + openvswitch_db_server: docker.io/kolla/ubuntu-source-openvswitch-db-server:3.0.3 + openvswitch_vswitchd: docker.io/kolla/ubuntu-source-openvswitch-vswitchd:3.0.3 + pull_policy: "IfNotPresent" + +labels: + ovs: + node_selector_key: openvswitch + node_selector_value: enabled + +network: + external_bridge: br-ex + ip_address: 0.0.0.0 + interface: + # External interface will be automatically added to external_bridge. Default is null. + # Tunnel interface will be used for VXLAN tunneling. Default is null, with + # fallback mechanism to search for interface with default routing. + external: null + tunnel: null + # To automatically add a physical interface to a specific bridge using, + # for example eth3 to bridge br-physnet1 define the following key/value + # in auto_bridge_add: + # br-physnet1: eth3 + auto_bridge_add: + # br0: if0 + # br1: iface_two + +pod: + lifecycle: + upgrades: + daemonsets: + pod_replacement_strategy: RollingUpdate + ovs_db: + enabled: false + min_ready_seconds: 0 + max_unavailable: 1 + ovs_vswitchd: + enabled: false + min_ready_seconds: 0 + max_unavailable: 1 + resources: + enabled: false + ovs: + db: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + vswitchd: + requests: + memory: "128Mi" + cpu: "100m" + limits: + memory: "1024Mi" + cpu: "2000m" + +manifests: + configmap_bin: true + daemonset_ovs_db: true + daemonset_ovs_vswitchd: true diff --git a/tools/deployment/armada/openstack-master-aio.yaml b/tools/deployment/armada/openstack-master-aio.yaml index 8122294a26..cedbb2bef2 100644 --- a/tools/deployment/armada/openstack-master-aio.yaml +++ b/tools/deployment/armada/openstack-master-aio.yaml @@ -239,6 +239,28 @@ data: - helm-toolkit --- schema: armada/Chart/v1 +metadata: + schema: metadata/Document/v1 + name: openvswitch +data: + chart_name: openvswitch + release: openvswitch + namespace: openstack + timeout: 300 + install: + no_hooks: false + upgrade: + no_hooks: false + values: {} + source: + type: local + location: /opt/openstack-helm/charts + subpath: openvswitch + reference: master + dependencies: + - helm-toolkit +--- +schema: armada/Chart/v1 metadata: schema: metadata/Document/v1 name: libvirt @@ -727,6 +749,7 @@ data: - memcached - ingress - libvirt + - openvswitch --- schema: armada/ChartGroup/v1 metadata: diff --git a/tools/deployment/armada/openstack-master.yaml b/tools/deployment/armada/openstack-master.yaml index 480f7cf4db..8378b0da57 100644 --- a/tools/deployment/armada/openstack-master.yaml +++ b/tools/deployment/armada/openstack-master.yaml @@ -232,6 +232,28 @@ data: - helm-toolkit --- schema: armada/Chart/v1 +metadata: + schema: metadata/Document/v1 + name: openvswitch +data: + chart_name: openvswitch + release: openvswitch + namespace: openstack + timeout: 300 + install: + no_hooks: false + upgrade: + no_hooks: false + values: {} + source: + type: local + location: /opt/openstack-helm/charts + subpath: openvswitch + reference: master + dependencies: + - helm-toolkit +--- +schema: armada/Chart/v1 metadata: schema: metadata/Document/v1 name: libvirt @@ -720,6 +742,7 @@ data: - memcached - ingress - libvirt + - openvswitch --- schema: armada/ChartGroup/v1 metadata: diff --git a/tools/gate/launch-osh/basic.sh b/tools/gate/launch-osh/basic.sh index 304b5af032..476eda1720 100755 --- a/tools/gate/launch-osh/basic.sh +++ b/tools/gate/launch-osh/basic.sh @@ -75,6 +75,7 @@ helm install --namespace=openstack ${WORK_DIR}/memcached --name=memcached helm install --namespace=openstack ${WORK_DIR}/etcd --name=etcd-rabbitmq helm install --namespace=openstack ${WORK_DIR}/rabbitmq --name=rabbitmq helm install --namespace=openstack ${WORK_DIR}/libvirt --name=libvirt +helm install --namespace=openstack ${WORK_DIR}/openvswitch --name=openvswitch kube_wait_for_pods openstack ${SERVICE_LAUNCH_TIMEOUT} helm install --namespace=openstack ${WORK_DIR}/keystone --name=keystone if [ "x$PVC_BACKEND" == "xceph" ]; then diff --git a/tools/gate/openstack/network_launch.sh b/tools/gate/openstack/network_launch.sh index c8fa218fbe..6da2b9732b 100755 --- a/tools/gate/openstack/network_launch.sh +++ b/tools/gate/openstack/network_launch.sh @@ -29,7 +29,7 @@ sudo ip link set br-ex up sudo iptables -t nat -A POSTROUTING -o $(net_default_iface) -s ${OSH_EXT_SUBNET} -j MASQUERADE # Disable In-Band rules on br-ex bridge to ease debugging -OVS_VSWITCHD_POD=$(kubectl get -n openstack pods -l application=neutron,component=ovs-vswitchd --no-headers -o name | head -1 | awk -F '/' '{ print $NF }') +OVS_VSWITCHD_POD=$(kubectl get -n openstack pods -l application=openvswitch,component=ovs-vswitchd --no-headers -o name | head -1 | awk -F '/' '{ print $NF }') kubectl exec -n openstack ${OVS_VSWITCHD_POD} -- ovs-vsctl set Bridge br-ex other_config:disable-in-band=true