Skip to content

Commit

Permalink
docs: fix node affinity for satellites
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Wanzenböck <moritz.wanzenboeck@linbit.com>
  • Loading branch information
WanzenBug committed Dec 1, 2023
1 parent c3e2652 commit ea34acf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/how-to/upgrade/collect-operator-v1-information.sh
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,14 @@ for IDX in $(seq 0 "$(jq '.items | length - 1' "$TEMPDIR/linstorsatellitesets.js
jq --arg CONFIG "$NAME.yaml" '.resources += [$CONFIG]' "$TEMPDIR/linstorsatelliteconfiguration/kustomization.yaml" > "$TEMPDIR/linstorsatelliteconfiguration/kustomization.yaml.new"
mv "$TEMPDIR/linstorsatelliteconfiguration/kustomization.yaml.new" "$TEMPDIR/linstorsatelliteconfiguration/kustomization.yaml"

if [ "$(jq_item '.spec.affinity?.nodeAffinity?.requiredDuringSchedulingIgnoredDuringExecution | length')" -gt 0 ]; then
jq_item '.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution' \
| format_patch LinstorSatelliteConfiguration "$NAME" '[{"op": "add", "path": "/spec/nodeAffinity", "value": .}]' \
| append_patch "$TEMPDIR/linstorsatelliteconfiguration" \
| diff_patch "$TEMPDIR/linstorsatelliteconfiguration"
confirm_patch "$TEMPDIR/linstorsatelliteconfiguration" y
fi

if [ "$(jq_item '.spec.additionalEnv | length')" -gt 0 ]; then
echo "Found additional environment variables passed to LINSTOR Satellite"
jq_item '.spec.additionalEnv' \
Expand Down Expand Up @@ -492,7 +500,9 @@ echo "|---------------------|--------------------------------|------------------
[ -z "$(jq -r '.items[0].spec.priorityClassName' "$TEMPDIR/linstorcsidrivers.json")" ] || print_row LinstorCSIDriver .spec.priorityClassName "Use LinstorCluster.spec.patches" "$(jq -r '.items[0].spec.priorityClassName' "$TEMPDIR/linstorcsidrivers.json")"

for IDX in $(seq 0 "$(jq '.items | length - 1' "$TEMPDIR/linstorsatellitesets.json")"); do
[ "$(jq_item '.spec.affinity | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.affinity "Use LinstorSatelliteConfiguration.spec.nodeSelector" "$(jq_item -c '.spec.affinity')"
[ "$(jq_item '.spec.affinity?.nodeAffinity?.preferredDuringSchedulingIgnoredDuringExecution | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution "Use LinstorSatelliteConfiguration.spec.nodeAffinity" "$(jq_item -c '.spec.affinity.nodeAffinity.preferredDuringSchedulingIgnoredDuringExecution')"
[ "$(jq_item '.spec.affinity?.podAffinity | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.affinity.podAffinity "Use LinstorSatelliteConfiguration.spec.nodeAffinity" "$(jq_item -c '.spec.affinity.podAffinity')"
[ "$(jq_item '.spec.affinity?.podAntiAffinity | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.affinity.podAntiAffinity "Use LinstorSatelliteConfiguration.spec.nodeAffinity" "$(jq_item -c '.spec.affinity.podAntiAffinity')"
[ "$(jq_item '.spec.storagePools.zfsPools | length')" -eq 0 ] || print_row LinstorSatelliteSet .spec.storagePools.zfsPools "Manually configure ZFS pools" "$(jq_item -c '.spec.storagePools.zfsPools')"
[ "$(jq_item -r '.spec.automaticStorageType')" == "None" ] || print_row LinstorSatelliteSet .spec.automaticStorageType "Use LinstorSatelliteConfiguration.spec.storagePools" "$(jq_item -r '.spec.automaticStorageType')"
[ "$(jq_item -r '.spec.controllerEndpoint')" == "$EXPECTED_CONTROLLER_ENDPOINT" ] || print_row LinstorSatelliteSet .spec.controllerEndpoint "Set LinstorCluster.spec.externalController" "$(jq_item -r '.spec.controllerEndpoint')"
Expand Down

0 comments on commit ea34acf

Please sign in to comment.