Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional host macvlan for storage network #731

Merged
merged 1 commit into from
Feb 21, 2024
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
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ NETWORK_VLAN_STEP ?= 1
NETWORK_ISOLATION_IPV4_ADDRESS ?= 172.16.1.1/24
NETWORK_ISOLATION_IPV6_ADDRESS ?= fd00:aaaa::1/64

# This creates a macvlan on the host network namespace on top of the storage VLAN
# to allow host to/from pod network communication on the same host using that VLAN.
# An example when this is useful is when using Cinder Volume with LVM + iSCSI
# without using the host's IP address.
NETWORK_STORAGE_MACVLAN ?=

# are we deploying to microshift
MICROSHIFT ?= 0

Expand Down Expand Up @@ -2079,6 +2085,7 @@ endif
nncp: export INTERFACE_MTU=${NETWORK_MTU}
nncp: export VLAN_START=${NETWORK_VLAN_START}
nncp: export VLAN_STEP=${NETWORK_VLAN_STEP}
nncp: export STORAGE_MACVLAN=${NETWORK_STORAGE_MACVLAN}
## NOTE(ldenny): When applying the nncp resource the OCP API can momentarly drop, below retry is added to aviod checking status while API is down and failing.
nncp: ## installs the nncp resources to configure the interface connected to the edpm node, right now only single nic vlan. Interface referenced via NNCP_INTERFACE
$(eval $(call vars,$@,nncp))
Expand Down
26 changes: 23 additions & 3 deletions scripts/gen-nncp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ echo INTERFACE_BGP_2 ${INTERFACE_BGP_2}
echo INTERFACE_MTU ${INTERFACE_MTU}
echo VLAN_START ${VLAN_START}
echo VLAN_STEP ${VLAN_STEP}
echo STORAGE_MACVLAN ${STORAGE_MACVLAN}
if [ -n "$IPV4_ENABLED" ]; then
echo CTLPLANE_IP_ADDRESS_PREFIX ${CTLPLANE_IP_ADDRESS_PREFIX}
echo CTLPLANE_IP_ADDRESS_SUFFIX ${CTLPLANE_IP_ADDRESS_SUFFIX}
Expand Down Expand Up @@ -207,16 +208,35 @@ EOF_CAT
#
# storage VLAN interface
#
cat >> ${DEPLOY_DIR}/${WORKER}_nncp.yaml <<EOF_CAT
storage_vlan_id=$((VLAN_START + VLAN_STEP))

cat >> "${DEPLOY_DIR}/${WORKER}_nncp.yaml" <<EOF_CAT
- description: storage vlan interface
name: ${INTERFACE}.$((${VLAN_START}+${VLAN_STEP}))
name: ${INTERFACE}.${storage_vlan_id}
state: up
type: vlan
vlan:
base-iface: ${INTERFACE}
id: $((${VLAN_START}+${VLAN_STEP}))
id: ${storage_vlan_id}
reorder-headers: true
EOF_CAT

if [ -n "${STORAGE_MACVLAN}" ]; then
cat >> ${DEPLOY_DIR}/${WORKER}_nncp.yaml <<EOF_CAT
ipv4:
enabled: false
ipv6:
enabled: false
- description: macvlan interface for storage NW
name: storage
state: up
type: mac-vlan
mac-vlan:
base-iface: ${INTERFACE}.${storage_vlan_id}
mode: bridge
EOF_CAT
fi

if [ -n "$IPV4_ENABLED" ]; then
cat >> ${DEPLOY_DIR}/${WORKER}_nncp.yaml <<EOF_CAT
ipv4:
Expand Down