Skip to content

Commit 64fdadb

Browse files
authored
OCPEDGE-1703: Add workload partitioning and two node fencing block to install config (#1740)
* feat: add workload partitioning add workload partitioning to install config renamed arbiter stanza function to follow more common bash conventions simplify if logic Signed-off-by: ehila <[email protected]> * feat: add control plane fencing credentials added ability to enable fencing credentials for Two Node Fencing deployments (TNA) when number of masters is 2 and arbiter is not enabled Signed-off-by: ehila <[email protected]> --------- Signed-off-by: ehila <[email protected]>
1 parent a548d56 commit 64fdadb

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

config_example.sh

+10
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,16 @@ set -x
462462
#
463463
#export ENABLE_ARBITER=1
464464

465+
# ENABLE_WORKLOAD_PARTITIONING -
466+
# Set to any non zero length string value to enable workload partitioning in the install config.
467+
#
468+
# Workload partitioning allows for workloads to be pinned to specific CPUSets with Performance Profiles
469+
# from the Node Tuning Operator.
470+
# For more info see:
471+
# https://github.com/openshift/cluster-node-tuning-operator/blob/main/docs/performanceprofile/performance_profile.md
472+
#
473+
#export ENABLE_WORKLOAD_PARTITIONING=true
474+
465475
# MASTER_HOSTNAME_FORMAT -
466476
# Set a custom hostname format for masters. This is a format string that should
467477
# include one %d field, which will be replaced with the number of the node.

ocp_install_env.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ EOF
181181
fi
182182
}
183183

184-
function arbiterStanza() {
185-
if [[ ! -z "${ENABLE_ARBITER:-}" ]]; then
184+
function arbiter_stanza() {
185+
if [[ -n "${ENABLE_ARBITER:-}" ]]; then
186186
cat <<EOF
187187
arbiter:
188188
name: arbiter
@@ -195,6 +195,14 @@ EOF
195195
fi
196196
}
197197

198+
function workload_partitioning() {
199+
if [[ -n "${ENABLE_WORKLOAD_PARTITIONING}" ]]; then
200+
cat <<EOF
201+
cpuPartitioningMode: AllNodes
202+
EOF
203+
fi
204+
}
205+
198206
function libvirturi() {
199207
if [[ "$REMOTE_LIBVIRT" -ne 0 ]]; then
200208
cat <<EOF
@@ -313,6 +321,7 @@ function generate_ocp_install_config() {
313321
cat > "${outdir}/install-config.yaml" << EOF
314322
apiVersion: v1
315323
baseDomain: ${BASE_DOMAIN}
324+
$(workload_partitioning)
316325
networking:
317326
networkType: ${NETWORK_TYPE}
318327
$(cluster_network)
@@ -328,7 +337,8 @@ controlPlane:
328337
architecture: $(get_arch install_config)
329338
platform:
330339
baremetal: {}
331-
$(arbiterStanza)
340+
$(node_map_to_install_config_fencing_credentials)
341+
$(arbiter_stanza)
332342
$(featureSet)
333343
platform:
334344
baremetal:

utils.sh

+23
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,29 @@ EOF
303303
done
304304
}
305305

306+
function node_map_to_install_config_fencing_credentials() {
307+
if [[ -z "${ENABLE_ARBITER:-}" ]] && [[ "${NUM_MASTERS}" -eq 2 ]]; then
308+
cat <<EOF
309+
fencing:
310+
credentials:
311+
EOF
312+
for ((idx=0;idx<$(($NUM_MASTERS));idx++)); do
313+
name=$(node_val ${idx} "name")
314+
username=$(node_val ${idx} "driver_info.username")
315+
password=$(node_val ${idx} "driver_info.password")
316+
address=$(node_val ${idx} "driver_info.address")
317+
318+
cat <<EOF
319+
- hostname: ${name}
320+
address: ${address}
321+
username: ${username}
322+
password: ${password}
323+
sslInsecure: true
324+
EOF
325+
done
326+
fi
327+
}
328+
306329
function sync_repo_and_patch {
307330
REPO_PATH=${REPO_PATH:-$HOME}
308331
DEST="${REPO_PATH}/$1"

0 commit comments

Comments
 (0)