This repository was archived by the owner on Mar 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
cnv: fixes issue #18 #33
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,22 @@ | ||
apiVersion: machineconfiguration.openshift.io/v1 | ||
kind: MachineConfig | ||
metadata: | ||
labels: | ||
machineconfiguration.openshift.io/role: master | ||
name: 99-brext-master | ||
spec: | ||
config: | ||
ignition: | ||
version: 2.2.0 | ||
storage: | ||
files: | ||
- contents: | ||
source: data:text/plain;charset=utf-8;base64,${interface_content} | ||
filesystem: root | ||
mode: 0644 | ||
path: /etc/sysconfig/network-scripts/ifcfg-${interface} | ||
- contents: | ||
source: data:text/plain;charset=utf-8;base64,${bridge_content} | ||
filesystem: root | ||
mode: 0644 | ||
path: /etc/sysconfig/network-scripts/ifcfg-${bridge} |
This file contains hidden or 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
This file contains hidden or 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,31 @@ | ||
#!/bin/bash | ||
|
||
export bridge="${bridge:-brext}" | ||
|
||
set -e | ||
|
||
echo "Deploying Bridge ${bridge}..." | ||
|
||
FIRST_MASTER=$(oc get node -o custom-columns=IP:.status.addresses[0].address --no-headers | head -1) | ||
export interface=$(ssh -q core@$FIRST_MASTER "ip r | grep default | grep -Po '(?<=dev )(\S+)'") | ||
if [ "$interface" == "" ] ; then | ||
echo "Issue detecting interface to use! Leaving..." | ||
exit 1 | ||
fi | ||
|
||
if [ "$interface" != "$bridge" ] ; then | ||
echo "Using interface $interface" | ||
export interface_content=$(envsubst < ifcfg-interface | base64 -w0) | ||
export bridge_content=$(envsubst < ifcfg-bridge | base64 -w0) | ||
envsubst < 99-brext-master.yaml | oc create -f - | ||
echo "Waiting 30s for machine-config change to get applied..." | ||
# This sleep is required because the machine-config changes are not immediate | ||
sleep 30 | ||
echo "Waiting for bridge to be deployed on all the nodes..." | ||
# The while is required because in the process of rebooting the hosts, the | ||
# oc wait connection is lost a few times, which is normal | ||
while ! oc wait mcp/master --for condition=updated --timeout 900s ; do sleep 1 ; done | ||
echo "Done installing Bridge!" | ||
else | ||
echo "Bridge already there!" | ||
fi |
This file contains hidden or 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
This file contains hidden or 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,8 @@ | ||
DEVICE=${bridge} | ||
NAME=${bridge} | ||
TYPE=Bridge | ||
ONBOOT=yes | ||
NM_CONTROLLED=yes | ||
BOOTPROTO=dhcp | ||
BRIDGING_OPTS=vlan_filtering=1 | ||
BRIDGE_VLANS="1 pvid untagged,20,300-400 untagged" |
This file contains hidden or 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,5 @@ | ||
DEVICE=${interface} | ||
BRIDGE=${bridge} | ||
ONBOOT=yes | ||
NM_CONTROLLED=yes | ||
BOOTPROTO=none |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.