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

Configure bond0 interface (alternative implementation) #22

Merged
merged 3 commits into from
Jun 27, 2022
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
3 changes: 3 additions & 0 deletions cluster-scope/overlays/nerc-ocp-infra/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ resources:
- ../../bundles/acm
- ../../bundles/odf
- clusterversion.yaml
- machineconfigs/disable-net-ifnames.yaml
- machineconfigs/mellanox-udev-rules
- machineconfigs/configure-bond0

patches:
- path: oauths/cluster_patch.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MACHINECONFIGS = \
machineconfig.yaml

%.yaml: src/%.bu $(wildcard src/*.nmconnection)
butane -o $@ -d src $<

all: $(MACHINECONFIGS)

clean:
rm -f $(MACHINECONFIGS)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Including file content in ignition configs is a pain, because it has to be base64 encoded. The `Makefile` in this directory uses [Butane][] to transpile `MachineConfig` resources, automatically including and encoding content from files.

Read "[Creating machine configs with Butane][]" in the [OpenShift documentation][] for more information.

[butane]: https://coreos.github.io/butane/
[openshift documentation]: https://docs.openshift.com/container-platform/4.10/installing/install_config/installing-customizing.html
[creating machine configs with butane]: https://docs.openshift.com/container-platform/4.10/installing/install_config/installing-customizing.html#installation-special-config-butane_installing-customizing
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- machineconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Butane; do not edit
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
jtriley marked this conversation as resolved.
Show resolved Hide resolved
name: configure-bond0
spec:
config:
ignition:
version: 3.2.0
storage:
files:
- contents:
compression: gzip
source: data:;base64,H4sIAAAAAAAC/0zMwaqDMBCF4f15FyXeKxfvYp5EskiTKQY6M6IToW9fLEK7O/BzvjmbKmevphG10M20BPhz5fdEVeftnjJ3moSvnJrb9SPfGuOD9F+t2x/p4J0GYGZfeFP2CPFG/yEEYD61CLHCNIWf/jcVSK1iSsN49roeY4SwL1bohFGWvHZeha05TX9jCHgFAAD///WlE5PCAAAA
mode: 384
path: /etc/NetworkManager/system-connections/bond0.nmconnection
- contents:
source: data:,%5Bconnection%5D%0Aid%3Dnic1%0Atype%3Dethernet%0Ainterface-name%3Dnic1%0Amaster%3Dbond0%0Aslave-type%3Dbond%0Aautoconnect%3Dtrue%0A%0A%5Bethernet%5D%0Amtu%3D9000%0A
mode: 384
path: /etc/NetworkManager/system-connections/nic1.nmconnection
- contents:
source: data:,%5Bconnection%5D%0Aid%3Dnic2%0Atype%3Dethernet%0Ainterface-name%3Dnic2%0Amaster%3Dbond0%0Aslave-type%3Dbond%0Aautoconnect%3Dtrue%0A%0A%5Bethernet%5D%0Amtu%3D9000%0A
mode: 384
path: /etc/NetworkManager/system-connections/nic2.nmconnection
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[connection]
id=bond0
type=bond
interface-name=bond0
autoconnect=true
connection.autoconnect-slaves=1

[ethernet]
mtu=9000

[bond]
mode=802.3ad
miimon=140

[ipv4]
method=auto
dhcp-timeout=86400
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
variant: openshift
version: 4.10.0
metadata:
name: configure-bond0
labels:
machineconfiguration.openshift.io/role: master
storage:
files:
- path: /etc/NetworkManager/system-connections/bond0.nmconnection
mode: 0600
contents:
local: bond0.nmconnection
- path: /etc/NetworkManager/system-connections/nic1.nmconnection
mode: 0600
contents:
local: nic1.nmconnection
- path: /etc/NetworkManager/system-connections/nic2.nmconnection
mode: 0600
contents:
local: nic2.nmconnection
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[connection]
id=nic1
type=ethernet
interface-name=nic1
master=bond0
slave-type=bond
autoconnect=true

[ethernet]
mtu=9000
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[connection]
id=nic2
type=ethernet
interface-name=nic2
master=bond0
slave-type=bond
autoconnect=true

[ethernet]
mtu=9000
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: disable-net-ifnames
spec:
config:
ignition:
version: 3.2.0
kernelArguments:
- net.ifnames=0
- biosdevname=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
MACHINECONFIGS = \
machineconfig.yaml

%.yaml: src/%.bu
butane -o $@ -d src $<

all: $(MACHINECONFIGS)

clean:
rm -f $(MACHINECONFIGS)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- machineconfig.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Butane; do not edit
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: master
name: mellanox-udev-rules
spec:
config:
ignition:
version: 3.2.0
storage:
files:
- contents:
compression: gzip
source: data:;base64,H4sIAAAAAAAC/woOdQqODA5x9bW1VcpLLVHScQnyDHMNCra1VcrNqTCNT84vSlXS8XYN8nP1AQkaGBgYWBmYWRkY6Bko6Tg6h3j6+9naKiWmpCjp+Dn6utoq5WUmGypxUWCuIU5zjZS4AAEAAP//AAlzT7AAAAA=
mode: 420
path: /etc/udev/rules.d/90-mellanox.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
variant: openshift
version: 4.10.0
metadata:
name: mellanox-udev-rules
labels:
machineconfiguration.openshift.io/role: master
storage:
files:
- path: /etc/udev/rules.d/90-mellanox.rules
contents:
local: mellanox.rules
mode: 0644
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SUBSYSTEM=="net",DRIVERS=="mlx5_core",KERNELS=="0000:06:00.0",ACTION=="add",NAME="nic1"
SUBSYSTEM=="net",DRIVERS=="mlx5_core",KERNELS=="0000:06:00.1",ACTION=="add",NAME="nic2"