From 2c3bded7ef6dbce75ce25f1ed18bd2e1fb23a38b Mon Sep 17 00:00:00 2001 From: Phil Cameron Date: Wed, 15 Jan 2020 10:30:52 -0500 Subject: [PATCH] Bug 1801384: [4.3]Bump to ovn2.12 New paths for components pidfile changes. Backport Bug 1798191 PR 445 to 4.3 SDN-643 Signed-off-by: Phil Cameron --- .../ovn-kubernetes/ovnkube-master.yaml | 16 ++++++++++--- .../network/ovn-kubernetes/ovnkube-node.yaml | 23 +++++++++++++++---- 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/bindata/network/ovn-kubernetes/ovnkube-master.yaml b/bindata/network/ovn-kubernetes/ovnkube-master.yaml index c28b84829d..844f6d9b33 100644 --- a/bindata/network/ovn-kubernetes/ovnkube-master.yaml +++ b/bindata/network/ovn-kubernetes/ovnkube-master.yaml @@ -54,7 +54,6 @@ spec: exec ovn-northd \ --no-chdir "-vconsole:${OVN_LOG_LEVEL}" -vfile:off \ - --pidfile=/var/run/openvswitch/ovn-northd.pid \ --ovnnb-db "{{.OVN_NB_DB_LIST}}" \ --ovnsb-db "{{.OVN_SB_DB_LIST}}" \ -p /ovn-cert/tls.key \ @@ -70,6 +69,8 @@ spec: name: var-lib-openvswitch - mountPath: /run/openvswitch/ name: run-openvswitch + - mountPath: /run/ovn/ + name: run-ovn - mountPath: /env name: env-overrides - mountPath: /ovn-cert # not needed, but useful when exec'ing in to pod. @@ -155,6 +156,8 @@ spec: name: var-lib-openvswitch - mountPath: /run/openvswitch/ name: run-openvswitch + - mountPath: /run/ovn/ + name: run-ovn - mountPath: /env name: env-overrides - mountPath: /ovn-cert @@ -246,6 +249,8 @@ spec: name: var-lib-openvswitch - mountPath: /run/openvswitch/ name: run-openvswitch + - mountPath: /run/ovn/ + name: run-ovn - mountPath: /env name: env-overrides - mountPath: /ovn-cert @@ -281,7 +286,7 @@ spec: fi # start nbctl daemon for caching - export OVN_NB_DAEMON=$(ovn-nbctl --pidfile=/run/openvswitch/ovnk-nbctl.pid \ + export OVN_NB_DAEMON=$(ovn-nbctl --pidfile=/tmp/ovnk-nbctl.pid \ --detach \ -p /ovn-cert/tls.key -c /ovn-cert/tls.crt -C /ovn-ca/ca-bundle.crt \ --db "{{.OVN_NB_DB_LIST}}") @@ -305,7 +310,7 @@ spec: lifecycle: preStop: exec: - command: ["/bin/bash", "-c", "kill $(cat /run/openvswitch/ovnk-nbctl.pid)"] + command: ["/bin/bash", "-c", "kill $(cat /tmp/ovnk-nbctl.pid) && unset OVN_NB_DAEMON"] volumeMounts: - mountPath: /etc/openvswitch/ name: etc-openvswitch @@ -313,6 +318,8 @@ spec: name: var-lib-openvswitch - mountPath: /run/openvswitch/ name: run-openvswitch + - mountPath: /run/ovn/ + name: run-ovn - mountPath: /env name: env-overrides - mountPath: /ovn-cert @@ -356,6 +363,9 @@ spec: path: /var/lib/ovn/data - name: run-openvswitch emptyDir: {} + - name: run-ovn + hostPath: + path: /var/run/ovn - name: env-overrides configMap: name: env-overrides diff --git a/bindata/network/ovn-kubernetes/ovnkube-node.yaml b/bindata/network/ovn-kubernetes/ovnkube-node.yaml index 2d8b03dcb3..61ef5bac74 100644 --- a/bindata/network/ovn-kubernetes/ovnkube-node.yaml +++ b/bindata/network/ovn-kubernetes/ovnkube-node.yaml @@ -128,8 +128,16 @@ spec: source "/env/${K8S_NODE}" set +o allexport fi + # Determine the ovn rundir. + if [[ -f /usr/bin/ovn-appctl ]] ; then + # ovn-appctl is present. Use new ovn run dir path. + OVNCTL_DIR=ovn + else + # ovn-appctl is not present. Use openvswitch run dir path. + OVNCTL_DIR=openvswitch + fi exec ovn-controller unix:/var/run/openvswitch/db.sock -vfile:off \ - --no-chdir --pidfile=/var/run/openvswitch/ovn-controller.pid \ + --no-chdir --pidfile=/var/run/${OVNCTL_DIR}/ovn-controller.pid \ -p /ovn-cert/tls.key -c /ovn-cert/tls.crt -C /ovn-ca/ca-bundle.crt \ -vconsole:"${OVN_LOG_LEVEL}" securityContext: @@ -144,6 +152,8 @@ spec: volumeMounts: - mountPath: /run/openvswitch name: run-openvswitch + - mountPath: /run/ovn/ + name: run-ovn - mountPath: /etc/openvswitch name: etc-openvswitch - mountPath: /var/lib/openvswitch @@ -213,7 +223,6 @@ spec: --sb-client-cacert /ovn-ca/ca-bundle.crt \ --nodeport --gateway-mode local \ ${hybrid_overlay_flags} \ - --pidfile /var/run/openvswitch/ovnkube-node.pid \ --loglevel "${OVN_KUBE_LOG_LEVEL}" --logfile /dev/stdout \ --metrics-bind-address "0.0.0.0:9101" env: @@ -266,6 +275,8 @@ spec: name: host-var-lib-cni-networks-ovn-kubernetes - mountPath: /run/openvswitch name: run-openvswitch + - mountPath: /run/ovn/ + name: run-ovn - mountPath: /etc/openvswitch name: etc-openvswitch - mountPath: /var/lib/openvswitch @@ -308,11 +319,15 @@ spec: - name: etc-openvswitch hostPath: path: /var/lib/openvswitch/etc - - name: run-openvswitch - emptyDir: {} # commit 0ac2cd changed the location of the ovs database, mount and check if a database already exists - name: old-openvswitch-database path: /etc/origin/openvswitch + - name: run-openvswitch + hostPath: + path: /var/run/openvswitch + - name: run-ovn + hostPath: + path: /var/run/ovn # For CNI server - name: host-run-ovn-kubernetes hostPath: