From 3adf7195e771273c8e6144771ce6cbb428979bd2 Mon Sep 17 00:00:00 2001 From: changluyi <47097611+changluyi@users.noreply.github.com> Date: Wed, 25 Oct 2023 16:34:19 +0800 Subject: [PATCH] add compact switch release-1.11 (#3338) * add leader check switch and compact switch * golanglint fix --- dist/images/install.sh | 10 ++++++++++ dist/images/start-db.sh | 8 ++++---- kubeovn-helm/templates/central-deploy.yaml | 4 ++++ kubeovn-helm/values.yaml | 2 ++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/dist/images/install.sh b/dist/images/install.sh index e90fa8eab15..24327e38848 100644 --- a/dist/images/install.sh +++ b/dist/images/install.sh @@ -30,6 +30,8 @@ IFACE=${IFACE:-} # Note that the dpdk tunnel iface and tunnel ip cidr should be diffierent with Kubernetes api cidr,otherwise the route will be a problem. DPDK_TUNNEL_IFACE=${DPDK_TUNNEL_IFACE:-br-phy} ENABLE_BIND_LOCAL_IP=${ENABLE_BIND_LOCAL_IP:-true} +OVN_LEADER_PROBE_INTERVAL=${OVN_LEADER_PROBE_INTERVAL:-5} +ENABLE_COMPACT=${ENABLE_COMPACT:-false} # debug DEBUG_WRAPPER=${DEBUG_WRAPPER:-} @@ -2027,6 +2029,10 @@ spec: value: "$ENABLE_BIND_LOCAL_IP" - name: DEBUG_WRAPPER value: "$DEBUG_WRAPPER" + - name: OVN_LEADER_PROBE_INTERVAL + value: "$OVN_LEADER_PROBE_INTERVAL" + - name: ENABLE_COMPACT + value: "$ENABLE_COMPACT" resources: requests: cpu: 300m @@ -2528,6 +2534,10 @@ spec: value: "$ENABLE_BIND_LOCAL_IP" - name: DEBUG_WRAPPER value: "$DEBUG_WRAPPER" + - name: OVN_LEADER_PROBE_INTERVAL + value: "$OVN_LEADER_PROBE_INTERVAL" + - name: ENABLE_COMPACT + value: "$ENABLE_COMPACT" resources: requests: cpu: 300m diff --git a/dist/images/start-db.sh b/dist/images/start-db.sh index 5b7c649dd05..59fdf20be01 100755 --- a/dist/images/start-db.sh +++ b/dist/images/start-db.sh @@ -4,6 +4,9 @@ set -eo pipefail DEBUG_WRAPPER=${DEBUG_WRAPPER:-} DEBUG_OPT="--ovn-northd-wrapper=$DEBUG_WRAPPER --ovsdb-nb-wrapper=$DEBUG_WRAPPER --ovsdb-sb-wrapper=$DEBUG_WRAPPER" +echo "OVN_LEADER_PROBE_INTERVAL is set to $OVN_LEADER_PROBE_INTERVAL" +echo "ENABLE_COMPACT is set to $ENABLE_COMPACT" + # https://bugs.launchpad.net/neutron/+bug/1776778 if grep -q "3.10.0-862" /proc/version then @@ -23,8 +26,6 @@ cat /proc/cmdline" exit 1 fi -PRBOE_INTERVAL=${PRBOE_INTERVAL:-5} -ENABLE_COMPACT=${ENABLE_COMPACT:-false} DB_NB_ADDR=${DB_NB_ADDR:-::} DB_NB_PORT=${DB_NB_PORT:-6641} DB_SB_ADDR=${DB_SB_ADDR:-::} @@ -368,5 +369,4 @@ ovs-appctl -t /var/run/ovn/ovnnb_db.ctl ovsdb-server/memory-trim-on-compaction o ovs-appctl -t /var/run/ovn/ovnsb_db.ctl ovsdb-server/memory-trim-on-compaction on chmod 600 /etc/ovn/* -/kube-ovn/kube-ovn-leader-checker --probeInterval=$PRBOE_INTERVAL --enableCompact=$ENABLE_COMPACT - +/kube-ovn/kube-ovn-leader-checker --probeInterval=${OVN_LEADER_PROBE_INTERVAL} --enableCompact=${ENABLE_COMPACT} diff --git a/kubeovn-helm/templates/central-deploy.yaml b/kubeovn-helm/templates/central-deploy.yaml index f209ed3966f..01f4bf6eaa6 100644 --- a/kubeovn-helm/templates/central-deploy.yaml +++ b/kubeovn-helm/templates/central-deploy.yaml @@ -71,6 +71,10 @@ spec: fieldPath: status.podIPs - name: ENABLE_BIND_LOCAL_IP value: "{{- .Values.func.ENABLE_BIND_LOCAL_IP }}" + - name: OVN_LEADER_PROBE_INTERVAL + value: "{{ .Values.networking.OVN_LEADER_PROBE_INTERVAL }}" + - name: ENABLE_COMPACT + value: "{{ .Values.networking.ENABLE_COMPACT }}" resources: requests: cpu: 300m diff --git a/kubeovn-helm/values.yaml b/kubeovn-helm/values.yaml index 07a053a56d5..3e4a9a24d5b 100644 --- a/kubeovn-helm/values.yaml +++ b/kubeovn-helm/values.yaml @@ -37,6 +37,8 @@ networking: EXCHANGE_LINK_NAME: false ENABLE_EIP_SNAT: true POD_DEFAULT_FIP_TYPE: "" + OVN_LEADER_PROBE_INTERVAL: 5 + ENABLE_COMPACT: false func: ENABLE_LB: true