diff --git a/bindata/network/ovn-kubernetes/common/008-script-lib.yaml b/bindata/network/ovn-kubernetes/common/008-script-lib.yaml index b244e6b3f8..a995f5d244 100644 --- a/bindata/network/ovn-kubernetes/common/008-script-lib.yaml +++ b/bindata/network/ovn-kubernetes/common/008-script-lib.yaml @@ -478,6 +478,18 @@ data: echo "$(date --iso-8601=seconds) [{$1}] ${2}" } + # set-encap-ip-flag() sets --encap-ip from the OVN_ENCAP_IP environment + # variable when present. + set-encap-ip-flag() + { + ovn_encap_ip_flag= + + if [[ -n "${OVN_ENCAP_IP}" ]]; then + log "encapip" "Using OVN_ENCAP_IP=${OVN_ENCAP_IP}" + ovn_encap_ip_flag="--encap-ip=${OVN_ENCAP_IP}" + fi + } + # cni-bin-copy() detects the host OS and copies the correct shim binary to # the CNI binary directory. # @@ -688,6 +700,8 @@ data: enable_interconnect_flag="--enable-interconnect" fi + set-encap-ip-flag + exec /usr/bin/ovnkube \ ${init_ovnkube_controller} \ --init-node "${K8S_NODE}" \ @@ -698,6 +712,7 @@ data: ${gateway_mode_flags} \ ${node_mgmt_port_netdev_flags} \ ${ovnkube_node_mode} \ + ${ovn_encap_ip_flag} \ --metrics-bind-address "127.0.0.1:${metrics_port}" \ --ovn-metrics-bind-address "127.0.0.1:${ovn_metrics_port}" \ --metrics-enable-pprof \