-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We want to use bonded interface pairs on these system. The nodes aren't yet wired for it, but setting this up now will allow us to refer to the `bond0` interface in e.g. VLAN configurations (and means we won't have to re-work those later). Because we're using OVNKubernetes, we can't use nmstate [1] to enact the configuration. The recommended mechanism for modifying the primary interface configuration is to apply the configuration using a MachineConfig [2] resource. By taking advantage of the changes in the previous commit, we can simply install NetworkManager connection files for bond0, eth2, and eth3. This will take effect when the system reboots (which will happen when the MachineConfig Operator applies our changes). [1]: https://docs.openshift.com/container-platform/4.10/networking/k8s_nmstate/k8s-nmstate-about-the-k8s-nmstate-operator.html [2]: https://docs.openshift.com/container-platform/4.10/post_installation_configuration/machine-configuration-tasks.html x-branch: feature/bond0-beta
- Loading branch information
Showing
9 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
cluster-scope/overlays/nerc-ocp-infra/machineconfigs/configure-bond0/Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
MACHINECONFIGS = \ | ||
configure-bond0.yaml | ||
|
||
%.yaml: src/%.bu | ||
butane -o $@ -d src $< | ||
|
||
all: $(MACHINECONFIGS) | ||
|
||
clean: | ||
rm -f $(MACHINECONFIGS) |
7 changes: 7 additions & 0 deletions
7
cluster-scope/overlays/nerc-ocp-infra/machineconfigs/configure-bond0/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
26 changes: 26 additions & 0 deletions
26
cluster-scope/overlays/nerc-ocp-infra/machineconfigs/configure-bond0/configure-bond0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
name: configure-bond0 | ||
spec: | ||
config: | ||
ignition: | ||
version: 3.2.0 | ||
storage: | ||
files: | ||
- contents: | ||
compression: gzip | ||
source: data:;base64,H4sIAAAAAAAC/0zMwQqDMAzG8XvepaOCjO2QJ5EeavsNCzaRmgp7++EQtlvgn+83JRVBsqISqGSeVbIne2/4nlTE0F4xwUmsuHLspteOrXXQD7n9Nbev8cDOA9EEW9AEFqha56f3nmg6tUBVM3iOa5QE1xrVUqoKD+P5UrZjDFRhi2Y+bcpL2pyVCu3Gj/voPX0CAAD//04u+Q/FAAAA | ||
mode: 384 | ||
path: /etc/NetworkManager/system-connections/bond0.nmconnection | ||
- contents: | ||
source: data:,%5Bconnection%5D%0Aid%3Deth2%0Atype%3Dethernet%0Ainterface-name%3Deth2%0Amaster%3Dbond0%0Aslave-type%3Dbond%0Aautoconnect%3Dtrue%0A%0A%5Bethernet%5D%0Amtu%3D9000%0A | ||
mode: 384 | ||
path: /etc/NetworkManager/system-connections/eth2.nmconnection | ||
- contents: | ||
source: data:,%5Bconnection%5D%0Aid%3Deth3%0Atype%3Dethernet%0Ainterface-name%3Deth3%0Amaster%3Dbond0%0Aslave-type%3Dbond%0Aautoconnect%3Dtrue%0A%0A%5Bethernet%5D%0Amtu%3D9000%0A | ||
mode: 384 | ||
path: /etc/NetworkManager/system-connections/eth3.nmconnection |
4 changes: 4 additions & 0 deletions
4
cluster-scope/overlays/nerc-ocp-infra/machineconfigs/configure-bond0/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- configure-bond0.yaml |
17 changes: 17 additions & 0 deletions
17
cluster-scope/overlays/nerc-ocp-infra/machineconfigs/configure-bond0/src/bond0.nmconnection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=balance-rr | ||
miimon=140 | ||
|
||
[ipv4] | ||
method=auto | ||
dhcp-timeout=86400 |
20 changes: 20 additions & 0 deletions
20
cluster-scope/overlays/nerc-ocp-infra/machineconfigs/configure-bond0/src/configure-bond0.bu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/eth2.nmconnection | ||
mode: 0600 | ||
contents: | ||
local: eth2.nmconnection | ||
- path: /etc/NetworkManager/system-connections/eth3.nmconnection | ||
mode: 0600 | ||
contents: | ||
local: eth3.nmconnection |
10 changes: 10 additions & 0 deletions
10
cluster-scope/overlays/nerc-ocp-infra/machineconfigs/configure-bond0/src/eth2.nmconnection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[connection] | ||
id=eth2 | ||
type=ethernet | ||
interface-name=eth2 | ||
master=bond0 | ||
slave-type=bond | ||
autoconnect=true | ||
|
||
[ethernet] | ||
mtu=9000 |
10 changes: 10 additions & 0 deletions
10
cluster-scope/overlays/nerc-ocp-infra/machineconfigs/configure-bond0/src/eth3.nmconnection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[connection] | ||
id=eth3 | ||
type=ethernet | ||
interface-name=eth3 | ||
master=bond0 | ||
slave-type=bond | ||
autoconnect=true | ||
|
||
[ethernet] | ||
mtu=9000 |