Deploying Openshift Worker on Physical blade Server with Trunk networking (bond/single interface)

Why this article

What went wrong ?

Solution

# ip link add link eth0 name eth0.100 type vlan id 100
# ip addr add 192.168.0.5/24 brd 192.168.100.255 dev eth0.100
# ip route add default via 192.168.0.1
# ping 192.168.0.1
# curl -LO http://bastion/pub/ign/worker.ign
# curl -LO http://bastion/pub/pxe/rhocs-4.3.8.raw.xz
# coreos-installer -i worker.ign -f rhcos-4.3.8.raw.xz --firstboot-args "rd.neednet=1 vlan=vlan100:eth0 ip=vlan100:dhcp --insecure /dev/sda
# reboot

working with Bond and VLAN TAG

PXE configuration

rd.neetnet=1 ip=bond0.100:dhcp vlan=bond0.100:bond0 bond=bond0:eth0,eth1:mode=active-backup,primary=eth0,miimon=100
# cd /var/www/html/pub/ign/
# cat >> worker1.ign << EOF
{
"ignition": {
"config": {
"append": [
{
"source": "http://bastion/pub/ign/worker.ign",
"verification": {}
}
]
},
"timeouts": {},
"version": "2.1.0"
},
"networkd": {},
"passwd": {},
"storage": {},
"systemd": {}

}
EOF
# mkdir network-scripts (can be in any directory)# cd network-scripts# cat > ifcfg-eth0 << EOF
DEVICE=eth0
NAME=eth0
BOOTPROTO=none
SLAVE=yes
MASTER=bond0
EOF
# cat > ifcfg-eth1 << EOF
DEVICE=eth1
NAME=eth1
BOOTPROTO=none
SLAVE=yes
MASTER=bond0
EOF
# cat > ifcfg-bond0 << EOF
NAME=bond0
DEVICE=bond0
ONBOOT=yes
BOOTPROTO=none
TYPE=Bond
BONDING_MASTER=yes
BONDING_OPTS="mode=1 miimon=100"
EOF
# cat > ifcfg-bond0.100 << EOF
NAME="bond0.100"
IPADDR="192.168.10.2"
NETMASK="255.255.255.0"
GATEWAY="192.168.1.1"
BOOTPROTO="static"
DEVICE="bond0.100"
TYPE="Vlan"
ONBOOT="yes"
VLAN=yes
DNS1="192.168.10.11"
DNS2="192.168.10.12"
DNS3="192.168.10.13"
EOF
network-scripts]$ ls -la
total 24
drwxrwxr-x. 2 paas paas 4096 Jun 3 11:11 .
drwx------. 29 paas paas 4096 Jun 3 11:10 ..
-rw-rw-r--. 1 paas paas 112 Jun 3 11:11 ifcfg-bond0
-rw-rw-r--. 1 paas paas 220 Jun 3 11:11 ifcfg-bond0.100
-rw-rw-r--. 1 paas paas 60 Jun 3 11:10 ifcfg-eth0
-rw-rw-r--. 1 paas paas 60 Jun 3 11:11 ifcfg-eth1
# for file in `ls ifcfg-*`; do
echo $file
cat $file | base64 -w0 ; echo
done

Modifying Append

..
"storage": {
"files": [
{
"contents": {
"source": "data:text/plain;base64,<ETH0_BASE64>"
},
"filesystem": "root",
"mode": 644,
"path": "/etc/sysconfig/network-scripts/ifcfg-eth0"
},
{
"contents": {
"source": "data:text/plain;base64,<ETH1_BASE64>"
},
"filesystem": "root",
"mode": 644,
"path": "/etc/sysconfig/network-scripts/ifcfg-eth1"
},
{
"contents": {
"source": "data:text/plain;base64,<BOND0_BASE64>"
},
"filesystem": "root",
"mode": 644,
"path": "/etc/sysconfig/network-scripts/ifcfg-bond0"
},
{
"contents": {
"source": "data:text/plain;base64,<BOND0_100_BASE64>"
},
"filesystem": "root",
"mode": 644,
"path": "/etc/sysconfig/network-scripts/ifcfg-bond0.100"
},
]
},
# export ETH0_BASE64=`cat ifcfg-eth0 | base64 -w0`
# cat worker1.ign | jq .storage.files | sed -i "s/<ETH0_BASE64>/${ETH0_BASE64}/g" worker1.ign
coreos.inst.ignition_url=http://bastion.exmaple.com/pub/ign/worker1.ign

--

--

Open Source contributer for the past 15 years

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store