Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions assets/components/ovn/multi-node/master/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ spec:
echo "$(date -Iseconds) - starting ovn-northd"
exec ovn-northd \
--no-chdir "-vconsole:${OVN_LOG_LEVEL}" -vfile:off "-vPATTERN:console:%D{%Y-%m-%dT%H:%M:%S.###Z}|%05N|%c%T|%p|%m" \
--ovnnb-db "{{.OVN_NB_DB_LIST}}" \
--ovnsb-db "{{.OVN_SB_DB_LIST}}" \
--ovnnb-db "tcp:${K8S_NODE_IP}:{{.OVN_NB_PORT}}" \
--ovnsb-db "tcp:${K8S_NODE_IP}:{{.OVN_SB_PORT}}" \
Comment on lines +71 to +72

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🔴 Critical | ⚖️ Poor tradeoff

Do not manually edit asset manifests.

As per coding guidelines, upstream component manifests under assets/ are rebase-managed and must not be edited manually. Ensure changes are applied via the correct patching or templating mechanism upstream.

  • assets/components/ovn/multi-node/master/daemonset.yaml#L71-L72: revert or migrate this manual edit.
  • assets/components/ovn/single-node/master/daemonset.yaml#L136-L137: revert or migrate this manual edit.
  • assets/components/ovn/single-node/node/daemonset.yaml#L58-L65: revert or migrate this manual edit.
  • assets/components/ovn/multi-node/node/daemonset.yaml#L58-L65: revert or migrate this manual edit.
📍 Affects 4 files
  • assets/components/ovn/multi-node/master/daemonset.yaml#L71-L72 (this comment)
  • assets/components/ovn/single-node/master/daemonset.yaml#L136-L137
  • assets/components/ovn/single-node/node/daemonset.yaml#L58-L65
  • assets/components/ovn/multi-node/node/daemonset.yaml#L58-L65
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@assets/components/ovn/multi-node/master/daemonset.yaml` around lines 71 - 72,
Revert the manual edits in the OVN daemonset manifests at
assets/components/ovn/multi-node/master/daemonset.yaml lines 71-72,
assets/components/ovn/single-node/master/daemonset.yaml lines 136-137,
assets/components/ovn/single-node/node/daemonset.yaml lines 58-65, and
assets/components/ovn/multi-node/node/daemonset.yaml lines 58-65. Apply the
intended changes through the upstream patching or templating mechanism instead
of editing rebase-managed assets directly.

Source: Coding guidelines

--pidfile /var/run/ovn/ovn-northd.pid &

wait $!
Expand Down Expand Up @@ -141,6 +141,8 @@ spec:
--db-nb-cluster-local-proto=tcp \
--no-monitor"

rm -f /run/ovn/ovnnb_db.sock

echo "$(date -Iseconds) - starting nbdb"

exec /usr/share/ovn/scripts/ovn-ctl \
Expand Down Expand Up @@ -177,7 +179,7 @@ spec:
done

#configure northd_probe_interval
OVN_NB_CTL="ovn-nbctl --db "{{.OVN_NB_DB_LIST}}""
OVN_NB_CTL="ovn-nbctl --no-leader-only"
northd_probe_interval=${OVN_NORTHD_PROBE_INTERVAL:-10000}
echo "Setting northd probe interval to ${northd_probe_interval} ms"
retries=0
Expand Down Expand Up @@ -286,6 +288,8 @@ spec:
--db-sb-cluster-local-proto=tcp \
--no-monitor"

rm -f /run/ovn/ovnsb_db.sock

echo "$(date -Iseconds) - starting sbdb "
exec /usr/share/ovn/scripts/ovn-ctl \
${OVN_ARGS} \
Expand Down
8 changes: 8 additions & 0 deletions assets/components/ovn/multi-node/node/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ spec:
# K8S_NODE_IP triggers reconcilation of this daemon when node IP changes
echo "$(date -Iseconds) - starting ovn-controller, Node: ${K8S_NODE} IP: ${K8S_NODE_IP}"

# Wait for the SBDB unix socket to appear. The sbdb container
# removes stale sockets and creates fresh ones on startup.
# Connecting to a stale socket would cause ovn-controller to
# cache a raft commit index higher than the fresh SBDB's.
echo "Waiting for SBDB socket..."
while [ ! -S /run/ovn/ovnsb_db.sock ]; do sleep 1; done
echo "SBDB socket ready"

exec ovn-controller unix:/var/run/openvswitch/db.sock -vfile:off \
--no-chdir --pidfile=/var/run/ovn/ovn-controller.pid \
--syslog-method="null" \
Expand Down
4 changes: 4 additions & 0 deletions assets/components/ovn/single-node/master/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ spec:
ovn_db_file="/etc/ovn/ovn${db}_db.db"
OVN_ARGS="--db-nb-cluster-local-port=9643 --no-monitor"

rm -f /run/ovn/ovnnb_db.sock

echo "$(date -Iseconds) - starting nbdb"
exec /usr/share/ovn/scripts/ovn-ctl \
${OVN_ARGS} \
Expand Down Expand Up @@ -251,6 +253,8 @@ spec:

OVN_ARGS="--db-sb-cluster-local-port=9644 --no-monitor"

rm -f /run/ovn/ovnsb_db.sock

echo "$(date -Iseconds) - starting sbdb "
exec /usr/share/ovn/scripts/ovn-ctl \
${OVN_ARGS} \
Expand Down
8 changes: 8 additions & 0 deletions assets/components/ovn/single-node/node/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ spec:
# K8S_NODE_IP triggers reconcilation of this daemon when node IP changes
echo "$(date -Iseconds) - starting ovn-controller, Node: ${K8S_NODE} IP: ${K8S_NODE_IP}"

# Wait for the SBDB unix socket to appear. The sbdb container
# removes stale sockets and creates fresh ones on startup.
# Connecting to a stale socket would cause ovn-controller to
# cache a raft commit index higher than the fresh SBDB's.
echo "Waiting for SBDB socket..."
while [ ! -S /run/ovn/ovnsb_db.sock ]; do sleep 1; done
echo "SBDB socket ready"

exec ovn-controller unix:/var/run/openvswitch/db.sock -vfile:off \
--no-chdir --pidfile=/var/run/ovn/ovn-controller.pid \
--syslog-method="null" \
Expand Down
4 changes: 1 addition & 3 deletions pkg/components/networking.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,11 @@ func startCNIPlugin(ctx context.Context, cfg *config.Config, kubeconfigPath stri
return err
}

// Multinode only params: OVN_NB_DB_LIST, OVN_SB_DB_LIST, OVN_NB_PORT, OVN_SB_PORT
// Multinode only params: OVN_NB_PORT, OVN_SB_PORT
extraParams := assets.RenderParams{
"OVNConfig": ovnConfig,
"KubeconfigPath": kubeconfigPath,
"KubeconfigDir": filepath.Join(config.DataDir, "/resources/kubeadmin"),
"OVN_NB_DB_LIST": fmt.Sprintf("tcp:%s:%s", cfg.MultiNode.Controlplane, ovn.OVN_NB_PORT),
"OVN_SB_DB_LIST": fmt.Sprintf("tcp:%s:%s", cfg.MultiNode.Controlplane, ovn.OVN_SB_PORT),
"OVN_NB_PORT": ovn.OVN_NB_PORT,
"OVN_SB_PORT": ovn.OVN_SB_PORT,
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/config/multinode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ package config

type MultiNodeConfig struct {
Enabled bool `json:"enabled"`
// only one controlplane node is supported
// IP address of control plane node
Controlplane string `json:"controlplane"`
}

// ConfigMultiNode populates multinode configurations to Config.MultiNode
Expand All @@ -13,6 +10,5 @@ func ConfigMultiNode(c *Config, enabled bool) *Config {
return c
}
c.MultiNode.Enabled = enabled
c.MultiNode.Controlplane = c.Node.NodeIP
return c
}