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
15 changes: 15 additions & 0 deletions config_example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,21 @@ set -x
#export BGP_TOR_ASN=64513
#export BGP_CLUSTER_ASN=64512
#

# BGP_VIP_MANAGEMENT -
# Render platform.baremetal.bgpVIPConfig into the install-config so the
# cluster advertises its API/ingress VIPs over BGP instead of managing them
# with keepalived (enhancement 1982, DevPreview). Requires ENABLE_BGP_TOR
# (the peer the cluster speaks to) and a FEATURE_SET that enables the
# BGPBasedVIPManagement gate (DevPreviewNoUpgrade). The local ASN defaults
# to BGP_CLUSTER_ASN, the peer ASN to BGP_TOR_ASN, and the peer address to
# the ToR address on the external subnet; override the peer address with
# BGP_VIP_PEER_ADDRESS if your topology differs.
# Default is unset.
#
#export BGP_VIP_MANAGEMENT=true
#export BGP_VIP_PEER_ADDRESS=
#
# FRR container image:
#export BGP_TOR_IMAGE=quay.io/frrouting/frr:9.1.0

Expand Down
15 changes: 15 additions & 0 deletions ocp_install_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,20 @@ EOF
fi
}

function bgp_vip_config() {
if [[ "${BGP_VIP_MANAGEMENT:-false}" == "true" ]]; then
local peer_address
peer_address="${BGP_VIP_PEER_ADDRESS:-$(nth_ip "${EXTERNAL_SUBNET_V4}" 1)}"
cat <<EOF
bgpVIPConfig:
localASN: ${BGP_CLUSTER_ASN:-64512}
peers:
- peerAddress: ${peer_address}
peerASN: ${BGP_TOR_ASN:-64513}
EOF
fi
}

function featureSet() {
if [[ -n "${FEATURE_SET:-}" ]]; then
cat <<EOF
Expand Down Expand Up @@ -445,6 +459,7 @@ $(setVIPs apivips)
$(setVIPs ingressvips)
$(dnsvip)
$(loadbalancer_type)
$(bgp_vip_config)
hosts:
EOF

Expand Down
19 changes: 19 additions & 0 deletions validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ function early_deploy_validation() {
CHECK_OC_TOOL_PRESENCE=${1:-"false"}

early_either_validation
early_bgp_vip_validation

if [ ! -s "${PERSONAL_PULL_SECRET}" ] && [ "${OPENSHIFT_RELEASE_TYPE}" != "okd" ]; then
error "${PERSONAL_PULL_SECRET} is missing or empty"
Expand Down Expand Up @@ -93,6 +94,24 @@ function early_deploy_validation() {
fi
}

function early_bgp_vip_validation() {
if [[ "${BGP_VIP_MANAGEMENT:-false}" != "true" ]]; then
return 0
fi
if [[ "${ENABLE_BGP_TOR:-false}" != "true" ]]; then
error "BGP_VIP_MANAGEMENT needs a BGP peer for the cluster to talk to; set ENABLE_BGP_TOR=true"
exit 1
fi
case "${FEATURE_SET:-}" in
DevPreviewNoUpgrade|CustomNoUpgrade)
;;
*)
error "BGP_VIP_MANAGEMENT requires the BGPBasedVIPManagement feature gate; set FEATURE_SET=DevPreviewNoUpgrade (or CustomNoUpgrade with the gate enabled)"
exit 1
;;
esac
}

# Perform validation steps that we only want done when trying to clean
# up.
function early_cleanup_validation() {
Expand Down