Skip to content

Commit 5e24ee3

Browse files
committed
Add internalapi routes for scenario A adoption
Doing data-plane adoption while testing scenario A (different subnets between wallaby and next-gen) will result in connectivity problem since pods will try to reach old CP using default route (since both CP are on different subnets) and won't be able to reach it. Adding this route in internalapi to support data-plane adoption scenario A gates. Currently only one route can be added, if needed logic can be improved to include more than one route. Ref: OSPRH-5602
1 parent 3519429 commit 5e24ee3

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ NETWORK_STORAGE_ADDRESS_PREFIX ?= 172.18.0
5151
NETWORK_TENANT_ADDRESS_PREFIX ?= 172.19.0
5252
NETWORK_STORAGEMGMT_ADDRESS_PREFIX ?= 172.20.0
5353
NETWORK_DESIGNATE_ADDRESS_PREFIX ?= 172.28.0
54+
# Additional routes that will be forwarded to nncp and net-attach-def
5455
INTERNALAPI_HOST_ROUTES ?=
55-
STORAGE_HOST_ROUTES ?=
5656
TENANT_HOST_ROUTES ?=
57-
STORAGEMGMT_HOST_ROUTES ?=
5857

5958
# network isolation
6059
NETWORK_ISOLATION ?= true
@@ -2395,6 +2394,8 @@ netattach: export DESIGNATE_PREFIX=${NETWORK_DESIGNATE_ADDRESS_PREFIX}
23952394
netattach: export VLAN_START=${NETWORK_VLAN_START}
23962395
netattach: export VLAN_STEP=${NETWORK_VLAN_STEP}
23972396
netattach: export CTLPLANE_IP_ADDRESS_PREFIX=${NNCP_CTLPLANE_IP_ADDRESS_PREFIX}
2397+
netattach: export NETATT_INTERNALAPI_HOST_ROUTES=${INTERNALAPI_HOST_ROUTES}
2398+
netattach: export NETATT_TENANT_HOST_ROUTES=${TENANT_HOST_ROUTES}
23982399
netattach: namespace ## Creates network-attachment-definitions for the networks the workers are attached via nncp
23992400
$(eval $(call vars,$@,netattach))
24002401
bash scripts/gen-netatt.sh

scripts/gen-netatt.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,19 @@ if [ -n "$IPV4_ENABLED" ]; then
120120
cat >> ${DEPLOY_DIR}/internalapi.yaml <<EOF_CAT
121121
"range": "${INTERNALAPI_PREFIX}.0/24",
122122
"range_start": "${INTERNALAPI_PREFIX}.30",
123-
"range_end": "${INTERNALAPI_PREFIX}.70"
123+
"range_end": "${INTERNALAPI_PREFIX}.70",
124124
EOF_CAT
125+
# In the data-plane adoption scenario A (where different IP subnet ranges
126+
# between next-gen and wallaby are used) the net-attach-def needs additional routes.
127+
if [ -n "$NETATT_INTERNALAPI_HOST_ROUTES" ]; then
128+
cat >> ${DEPLOY_DIR}/internalapi.yaml <<EOF_CAT
129+
"routes": [
130+
{
131+
"dst": "${NETATT_INTERNALAPI_HOST_ROUTES}"
132+
}
133+
]
134+
EOF_CAT
135+
fi
125136
elif [ -n "$IPV6_ENABLED" ]; then
126137
cat >> ${DEPLOY_DIR}/internalapi.yaml <<EOF_CAT
127138
"range": "fd00:bbbb::/64",
@@ -188,8 +199,19 @@ if [ -n "$IPV4_ENABLED" ]; then
188199
cat >> ${DEPLOY_DIR}/tenant.yaml <<EOF_CAT
189200
"range": "${TENANT_PREFIX}.0/24",
190201
"range_start": "${TENANT_PREFIX}.30",
191-
"range_end": "${TENANT_PREFIX}.70"
202+
"range_end": "${TENANT_PREFIX}.70",
192203
EOF_CAT
204+
# In the data-plane adoption scenario A (where different IP subnet ranges
205+
# between next-gen and wallaby are used) the net-attach-def needs additional routes.
206+
if [ -n "$NETATT_TENANT_HOST_ROUTES" ]; then
207+
cat >> ${DEPLOY_DIR}/tenant.yaml <<EOF_CAT
208+
"routes": [
209+
{
210+
"dst": "${NETATT_TENANT_HOST_ROUTES}"
211+
}
212+
]
213+
EOF_CAT
214+
fi
193215
elif [ -n "$IPV6_ENABLED" ]; then
194216
cat >> ${DEPLOY_DIR}/tenant.yaml <<EOF_CAT
195217
"range": "fd00:dddd::/64",

0 commit comments

Comments
 (0)