Skip to content

Commit

Permalink
Bump to ovn2.12
Browse files Browse the repository at this point in the history
New paths for components
pidfile changes.

SDN-643

Signed-off-by: Phil Cameron <pcameron@redhat.com>
  • Loading branch information
pecameron committed Feb 4, 2020
1 parent cee4cf9 commit 6d36234
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bindata/network/ovn-kubernetes/006-ovs-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
containers:
# ovsdb and ovs-vswitchd
- name: ovs-daemons
image: {{.OvnImage}}
image: "{{.OvnImage}}"
command:
- /bin/bash
- -c
Expand Down
21 changes: 16 additions & 5 deletions bindata/network/ovn-kubernetes/ovnkube-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ spec:
# (container) -> (host)
# /etc/openvswitch -> /var/lib/ovn/etc - ovsdb data
# /var/lib/openvswitch -> /var/lib/ovn/data - ovsdb pki state
# /run/openvswitch -> tmpfs - sockets & pids
# /run/openvswitch -> tmpfs - sockets
# /env -> configmap env-overrides - debug overrides
containers:
# ovn-northd: convert network objects in nbdb to flows in sbdb
Expand All @@ -70,7 +70,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 \
Expand All @@ -86,6 +85,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.
Expand Down Expand Up @@ -187,6 +188,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
Expand Down Expand Up @@ -294,6 +297,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
Expand Down Expand Up @@ -330,7 +335,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}}")
Expand All @@ -349,7 +354,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
Expand All @@ -359,6 +364,8 @@ spec:
name: var-lib-openvswitch
- mountPath: /run/openvswitch/
name: run-openvswitch
- mountPath: /run/ovn/
name: run-ovn
- mountPath: /run/ovnkube-config/
name: ovnkube-config
- mountPath: /env
Expand Down Expand Up @@ -394,7 +401,11 @@ spec:
hostPath:
path: /var/lib/ovn/data
- name: run-openvswitch
emptyDir: {}
hostPath:
path: /var/run/openvswitch
- name: run-ovn
hostPath:
path: /var/run/ovn
- name: ovnkube-config
configMap:
name: ovnkube-config
Expand Down
20 changes: 17 additions & 3 deletions bindata/network/ovn-kubernetes/ovnkube-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,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:
Expand All @@ -62,6 +70,8 @@ spec:
volumeMounts:
- mountPath: /run/openvswitch
name: run-openvswitch
- mountPath: /run/ovn/
name: run-ovn
- mountPath: /etc/openvswitch
name: etc-openvswitch
- mountPath: /etc/ovn/
Expand Down Expand Up @@ -134,7 +144,6 @@ spec:
--config-file=/run/ovnkube-config/ovnkube.conf \
--loglevel "${OVN_KUBE_LOG_LEVEL}" \
${hybrid_overlay_flags} \
--pidfile /var/run/openvswitch/ovnkube-node.pid \
--metrics-bind-address "0.0.0.0:9103"
env:
# for kubectl
Expand Down Expand Up @@ -177,6 +186,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: /etc/ovn/
Expand Down Expand Up @@ -222,7 +233,10 @@ spec:
path: /var/lib/openvswitch/etc
- name: run-openvswitch
hostPath:
path: /run/openvswitch
path: /var/run/openvswitch
- name: run-ovn
hostPath:
path: /var/run/ovn
# For CNI server
- name: host-run-ovn-kubernetes
hostPath:
Expand Down

0 comments on commit 6d36234

Please sign in to comment.